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>
This commit is contained in:

committed by
Darrick J. Wong

父節點
c1f09188e8
當前提交
d367a868e4
@@ -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,
|
||||
|
Reference in New Issue
Block a user