xfs: reduce transaction reservations with reflink
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Apr 2022 01:38:14 +0000 (18:38 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 28 Apr 2022 17:25:42 +0000 (10:25 -0700)
commitb037c4eed2df4568a7702cd512d26625962f95b9
treef486c5504d4793ef91e0aa6e7784584f53f8727e
parent4ecf9e7c69edcb8f5b98df471dd026419b881d2b
xfs: reduce transaction reservations with reflink

Before to the introduction of deferred refcount operations, reflink
would try to cram refcount btree updates into the same transaction as an
allocation or a free event.  Mainline XFS has never actually done that,
but we never refactored the transaction reservations to reflect that we
now do all refcount updates in separate transactions.  Fix this to
reduce the transaction reservation size even farther, so that between
this patch and the previous one, we reduce the tr_write and tr_itruncate
sizes by 66%.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_log_rlimit.c
fs/xfs/libxfs/xfs_refcount.c
fs/xfs/libxfs/xfs_trans_resv.c
fs/xfs/libxfs/xfs_trans_resv.h