aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_refcount_item.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-04-30 12:52:20 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-04 09:03:16 -0700
commitd367a868e46b025a8ced8e00ef2b3a3c2f3bf732 (patch)
treeaccb51f678e05b00c58ed05a4b25ac1536544c27 /fs/xfs/xfs_refcount_item.c
parentxfs: merge the ->log_item defer op into ->create_intent (diff)
downloadlinux-dev-d367a868e46b025a8ced8e00ef2b3a3c2f3bf732.tar.xz
linux-dev-d367a868e46b025a8ced8e00ef2b3a3c2f3bf732.zip
xfs: merge the ->diff_items defer op into ->create_intent
This avoids a per-item indirect call, and also simplifies the interface a bit. 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_refcount_item.c')
-rw-r--r--fs/xfs/xfs_refcount_item.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index 325d49fc0406..efc32ec55afd 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -333,7 +333,8 @@ STATIC void *
xfs_refcount_update_create_intent(
struct xfs_trans *tp,
struct list_head *items,
- unsigned int count)
+ unsigned int count,
+ bool sort)
{
struct xfs_mount *mp = tp->t_mountp;
struct xfs_cui_log_item *cuip = xfs_cui_init(mp, count);
@@ -342,6 +343,8 @@ xfs_refcount_update_create_intent(
ASSERT(count > 0);
xfs_trans_add_item(tp, &cuip->cui_item);
+ if (sort)
+ list_sort(mp, items, xfs_refcount_update_diff_items);
list_for_each_entry(refc, items, ri_list)
xfs_refcount_update_log_item(tp, cuip, refc);
return cuip;
@@ -422,7 +425,6 @@ xfs_refcount_update_cancel_item(
const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
.max_items = XFS_CUI_MAX_FAST_EXTENTS,
- .diff_items = xfs_refcount_update_diff_items,
.create_intent = xfs_refcount_update_create_intent,
.abort_intent = xfs_refcount_update_abort_intent,
.create_done = xfs_refcount_update_create_done,