Skip to content

xfs: embed firstblock in xfs_trans

Brian Foster linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest25 patches 32 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25xfs: allow null firstblock in xfs_bmapi_write() when tp is nullfs/xfs/libxfs/xfs_bmap.c fs/xfs/xfs_reflink.c+4 -72 replies
2/25xfs: add firstblock field to xfs_transfs/xfs/xfs_trans.c fs/xfs/xfs_trans.h+3 -02 replies
3/25xfs: use ->t_firstblock in dir opsfs/xfs/xfs_inode.c fs/xfs/xfs_symlink.c+23 -281 reply
4/25xfs: remove firstblock param from xfs dir opsfs/xfs/libxfs/xfs_dir2.c fs/xfs/libxfs/xfs_dir2.h fs/xfs/xfs_inode.c +1 more+20 -332 replies
5/25xfs: use ->t_firstblock in attrfork addfs/xfs/libxfs/xfs_bmap.c+13 -201 reply
6/25xfs: use ->t_firstblock in xattr opsfs/xfs/libxfs/xfs_attr.c fs/xfs/libxfs/xfs_attr_leaf.c fs/xfs/libxfs/xfs_attr_remote.c +4 more+33 -381 reply
7/25xfs: use ->t_firstblock for all xfs_bmapi_write() callersfs/xfs/xfs_bmap_util.c fs/xfs/xfs_dquot.c fs/xfs/xfs_iomap.c +2 more+20 -251 reply
8/25xfs: use ->t_firstblock for all xfs_bunmapi() callersfs/xfs/libxfs/xfs_bmap.c fs/xfs/xfs_bmap_util.c fs/xfs/xfs_inode.c +2 more+15 -261 reply
9/25xfs: use ->t_firstblock in xfs_bmapi_remap()fs/xfs/libxfs/xfs_bmap.c+2 -31 reply
10/25xfs: use ->t_firstblock in insert/collapse rangefs/xfs/xfs_bmap_util.c+4 -61 reply
11/25xfs: remove xfs_bmapi_write() firstblock paramfs/xfs/libxfs/xfs_attr_remote.c fs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap.h +7 more+22 -381 reply
12/25xfs: remove xfs_bunmapi() firstblock paramfs/xfs/libxfs/xfs_attr_remote.c fs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap.h +6 more+22 -321 reply
13/25xfs: remove bmap insert/collapse firstblock paramfs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap.h fs/xfs/xfs_bmap_util.c+8 -101 reply
14/25xfs: use ->t_firstblock in bmap extent splitfs/xfs/libxfs/xfs_bmap.c+6 -91 reply
15/25xfs: remove xfs_bmalloca firstblock fieldfs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap.h+23 -221 reply
16/25xfs: remove bmap extent add helper firstblock paramsfs/xfs/libxfs/xfs_bmap.c+10 -161 reply
17/25xfs: remove bmap format helpers firstblock paramsfs/xfs/libxfs/xfs_bmap.c+29 -341 reply
18/25xfs: remove xfs_btree_cur private firstblock fieldfs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap_btree.c fs/xfs/libxfs/xfs_btree.h+7 -321 reply
19/25xfs: remove xfs_alloc_arg firstblock fieldfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +3 more+11 -171 reply
20/25xfs: use ->t_firstblock in dq allocfs/xfs/xfs_dquot.c+1 -21 reply
21/25xfs: replace no-op firstblock init with ->t_firstblockfs/xfs/libxfs/xfs_refcount.c+1 -11 reply
22/25xfs: use ->t_firstblock in reflink cow block cancelfs/xfs/xfs_reflink.c+1 -21 reply
23/25xfs: use ->t_firstblock in extent swapfs/xfs/xfs_bmap_util.c+2 -41 reply
24/25xfs: use ->t_firstblock in inode inactivatefs/xfs/xfs_inode.c+1 -21 reply
25/25xfs: remove xfs_defer_init() firstblock paramfs/xfs/libxfs/xfs_attr.c fs/xfs/libxfs/xfs_attr_remote.c fs/xfs/libxfs/xfs_bmap.c +11 more+44 -584 replies

Reviews trailers per patch

24 of 25 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDarrick J. WongChristoph Hellwig
SeriesR-b
1/25R-b R-b
2/25R-b R-b
3/25R-b
4/25
5/25R-b
6/25R-b
7/25R-b
8/25R-b
9/25R-b
10/25R-b
11/25R-b
12/25R-b
13/25R-b
14/25R-b
15/25R-b
16/25R-b
17/25R-b
18/25R-b
19/25R-b
20/25R-b
21/25R-b
22/25R-b
23/25R-b
24/25R-b
25/25R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/25] xfs: embed firstblock in xfs_trans

Hi all,

This is a quick refactor of firstblock usage thoughout XFS. A firstblock variable is used to track the first allocation of a transaction to help maintain AG lock order, but it has historically been passed all over the place independent from the associated transaction (similar to dfops). This makes sense in some cases where the transaction is rolled, but even with that case, this can all be handled with a bit less code by pushing firstblock directly into the transaction.

These are mostly simple, mechanical refactoring patches. The whole thing could probably be squashed into half the patch count, but I opted to keep smaller patches as it is easier to squash them later than take them apart depending on preference. The series applies on top of the recent ->t_dfops refactoring series [1].

Patch 1 is a simple prepatory patch. Patch 2 adds the new ->t_firstblock field to xfs_trans. Patches 3-24 are a sequence of replacing on-stack firstblock usage with ->t_firstblock and removing unnecessary firstblock function parameters and args passing struct fields. Once every transaction that requires it is converted over to ->t_firstblock, patch 25 eliminates the unnecessary parameter and initialization from xfs_defer_init().

This all survives a couple rounds of xfstests (with KASAN enabled) without any explosions. Thoughts, reviews, flames appreciated.

Brian

[1] https://marc.info/?l=linux-xfs&m=153020380302037&w=2

Brian Foster (25):
xfs: allow null firstblock in xfs_bmapi_write() when tp is null
xfs: add firstblock field to xfs_trans
xfs: use ->t_firstblock in dir ops
xfs: remove firstblock param from xfs dir ops
xfs: use ->t_firstblock in attrfork add
xfs: use ->t_firstblock in xattr ops
xfs: use ->t_firstblock for all xfs_bmapi_write() callers
xfs: use ->t_firstblock for all xfs_bunmapi() callers
xfs: use ->t_firstblock in xfs_bmapi_remap()
xfs: use ->t_firstblock in insert/collapse range
xfs: remove xfs_bmapi_write() firstblock param
xfs: remove xfs_bunmapi() firstblock param
xfs: remove bmap insert/collapse firstblock param
xfs: use ->t_firstblock in bmap extent split
xfs: remove xfs_bmalloca firstblock field
xfs: remove bmap extent add helper firstblock params
xfs: remove bmap format helpers firstblock params
xfs: remove xfs_btree_cur private firstblock field
xfs: remove xfs_alloc_arg firstblock field
xfs: use ->t_firstblock in dq alloc
xfs: replace no-op firstblock init with ->t_firstblock
xfs: use ->t_firstblock in reflink cow block cancel
xfs: use ->t_firstblock in extent swap
xfs: use ->t_firstblock in inode inactivate
xfs: remove xfs_defer_init() firstblock param

 fs/xfs/libxfs/xfs_alloc.c          |  20 ++--
 fs/xfs/libxfs/xfs_alloc.h          |   1 -
 fs/xfs/libxfs/xfs_attr.c           |  29 ++---
 fs/xfs/libxfs/xfs_attr_leaf.c      |   2 -
 fs/xfs/libxfs/xfs_attr_remote.c    |  13 +--
 fs/xfs/libxfs/xfs_bmap.c           | 181 +++++++++--------------------
 fs/xfs/libxfs/xfs_bmap.h           |  13 +--
 fs/xfs/libxfs/xfs_bmap_btree.c     |  11 +-
 fs/xfs/libxfs/xfs_btree.h          |   1 -
 fs/xfs/libxfs/xfs_da_btree.c       |   9 +-
 fs/xfs/libxfs/xfs_da_btree.h       |   1 -
 fs/xfs/libxfs/xfs_defer.c          |   5 +-
 fs/xfs/libxfs/xfs_defer.h          |   3 +-
 fs/xfs/libxfs/xfs_dir2.c           |  12 +-
 fs/xfs/libxfs/xfs_dir2.h           |   6 +-
 fs/xfs/libxfs/xfs_refcount.c       |   2 +-
 fs/xfs/libxfs/xfs_refcount_btree.c |   1 -
 fs/xfs/xfs_bmap_util.c             |  29 ++---
 fs/xfs/xfs_dquot.c                 |   9 +-
 fs/xfs/xfs_inode.c                 |  55 ++++-----
 fs/xfs/xfs_iomap.c                 |  20 ++--
 fs/xfs/xfs_log_recover.c           |   3 +-
 fs/xfs/xfs_reflink.c               |  28 ++---
 fs/xfs/xfs_rtalloc.c               |   7 +-
 fs/xfs/xfs_symlink.c               |  14 +--
 fs/xfs/xfs_trace.h                 |   2 +-
 fs/xfs/xfs_trans.c                 |   2 +
 fs/xfs/xfs_trans.h                 |   1 +
 28 files changed, 170 insertions(+), 310 deletions(-)
Signature · 1 line
2.17.1