summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rmap_item.c
diff options
context:
space:
mode:
authorChristoph Hellwig2019-06-29 04:27:32 +0200
committerDarrick J. Wong2019-06-29 04:27:32 +0200
commit9ce632a28a41bd9aeeaa3913d95b23648a82c2ee (patch)
treebe33e14549bbef071ce6b0d23f45012a6876d437 /fs/xfs/xfs_rmap_item.c
parentxfs: split iop_unlock (diff)
downloadkernel-qcow2-linux-9ce632a28a41bd9aeeaa3913d95b23648a82c2ee.tar.gz
kernel-qcow2-linux-9ce632a28a41bd9aeeaa3913d95b23648a82c2ee.tar.xz
kernel-qcow2-linux-9ce632a28a41bd9aeeaa3913d95b23648a82c2ee.zip
xfs: add a flag to release log items on commit
We have various items that are released from ->iop_comitting. Add a flag to just call ->iop_release from the commit path to avoid tons of boilerplate code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_rmap_item.c')
-rw-r--r--fs/xfs/xfs_rmap_item.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c
index e907bd169de5..3fbc7c5ffa96 100644
--- a/fs/xfs/xfs_rmap_item.c
+++ b/fs/xfs/xfs_rmap_item.c
@@ -235,38 +235,13 @@ xfs_rud_item_release(
}
/*
- * When the rud item is committed to disk, all we need to do is delete our
- * reference to our partner rui item and then free ourselves. Since we're
- * freeing ourselves we must return -1 to keep the transaction code from
- * further referencing this item.
- */
-STATIC xfs_lsn_t
-xfs_rud_item_committed(
- struct xfs_log_item *lip,
- xfs_lsn_t lsn)
-{
- struct xfs_rud_log_item *rudp = RUD_ITEM(lip);
-
- /*
- * Drop the RUI reference regardless of whether the RUD has been
- * aborted. Once the RUD transaction is constructed, it is the sole
- * responsibility of the RUD to release the RUI (even if the RUI is
- * aborted due to log I/O error).
- */
- xfs_rui_release(rudp->rud_ruip);
- kmem_zone_free(xfs_rud_zone, rudp);
-
- return (xfs_lsn_t)-1;
-}
-
-/*
* This is the ops vector shared by all rud log items.
*/
static const struct xfs_item_ops xfs_rud_item_ops = {
+ .flags = XFS_ITEM_RELEASE_WHEN_COMMITTED,
.iop_size = xfs_rud_item_size,
.iop_format = xfs_rud_item_format,
.iop_release = xfs_rud_item_release,
- .iop_committed = xfs_rud_item_committed,
};
/*