Skip to content

Commit

Permalink
xfs: hoist ->create_intent boilerplate to its callsite
Browse files Browse the repository at this point in the history
Hoist the dirty flag setting code out of each ->create_intent
implementation up to the callsite to reduce boilerplate further.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Darrick J. Wong committed Dec 7, 2023
1 parent e6e5299 commit f3fd7f6
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 15 deletions.
2 changes: 2 additions & 0 deletions fs/xfs/libxfs/xfs_defer.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ xfs_defer_create_intent(
if (IS_ERR(lip))
return PTR_ERR(lip);

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &lip->li_flags);
dfp->dfp_intent = lip;
return 1;
}
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_attr_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ xfs_attr_log_item(
{
struct xfs_attri_log_format *attrp;

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &attrip->attri_item.li_flags);

/*
* At this point the xfs_attr_intent has been constructed, and we've
* created the log intent. Fill in the attri log item and log format
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_bmap_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ xfs_bmap_update_log_item(
uint next_extent;
struct xfs_map_extent *map;

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &buip->bui_item.li_flags);

/*
* atomic_inc_return gives us the value after the increment;
* we want to use it as an array index so we need to subtract 1 from
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_extfree_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ xfs_extent_free_log_item(
uint next_extent;
struct xfs_extent *extp;

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &efip->efi_item.li_flags);

/*
* atomic_inc_return gives us the value after the increment;
* we want to use it as an array index so we need to subtract 1 from
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_refcount_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,6 @@ xfs_refcount_update_log_item(
uint next_extent;
struct xfs_phys_extent *pmap;

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &cuip->cui_item.li_flags);

/*
* atomic_inc_return gives us the value after the increment;
* we want to use it as an array index so we need to subtract 1 from
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_rmap_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ xfs_rmap_update_log_item(
uint next_extent;
struct xfs_map_extent *map;

tp->t_flags |= XFS_TRANS_DIRTY;
set_bit(XFS_LI_DIRTY, &ruip->rui_item.li_flags);

/*
* atomic_inc_return gives us the value after the increment;
* we want to use it as an array index so we need to subtract 1 from
Expand Down

0 comments on commit f3fd7f6

Please sign in to comment.