Skip to content

xfs: make btree cursor private unions anonymous

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7xfs: introduce new private btree cursor namesfs/xfs/libxfs/xfs_btree.h+2 -02 replies
2/7xfs: convert btree cursor ag private member namefs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc_btree.c fs/xfs/libxfs/xfs_btree.c +14 more+187 -1872 replies
3/7xfs: convert btree cursor btree private member namefs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap_btree.c fs/xfs/libxfs/xfs_btree.c +3 more+76 -760 replies
4/7xfs: rename btree cursur private btree member flagsfs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_bmap_btree.c fs/xfs/libxfs/xfs_btree.c +1 more+9 -92 replies
5/7xfs: make btree cursor private union anonymousfs/xfs/libxfs/xfs_btree.h+3 -50 replies
6/7xfs: make the btree cursor union members named structurefs/xfs/libxfs/xfs_btree.h+21 -150 replies
7/7xfs: make the btree ag cursor private union anonymousfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc_btree.c fs/xfs/libxfs/xfs_btree.h +2 more+33 -360 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] xfs: make btree cursor private unions anonymous

This is a "make things less verbose" cleanup from looking at the changes Darrick is making to add a staging/fake cursor to the union for bulk btree loading.

The process is to create a @defines of the new name to the existing union name, then replace all users of each union via a script. Then the union is made anonymous and the members renamed to match the new code. Then the #defines get removed.

We do this for the bc_private union, then we name the ag and btree structures and make them use anonymous unions internally via the same process.

That means we go from doubly nested private stuff like this:

cur->bc_private.a.priv.abt.active

To the much cleaner, less verbose and more readable:

cur->bc_ag.abt.active

Simples, yes?

This series can be found at:

https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git/h?xfs-btree-cursor-cleanup

Note: the code changes are all scripted, I have not done any followup to do things like aggregate split lines back into single lines as that is out of scope of the structure definition cleanup I'm trying to acheive here. That can be done in future as we modify the code that now has lines that can be merged....

Dave Chinner (7):
xfs: introduce new private btree cursor names
xfs: convert btree cursor ag private member name
xfs: convert btree cursor btree private member name
xfs: rename btree cursur private btree member flags
xfs: make btree cursor private union anonymous
xfs: make the btree cursor union members named structure
xfs: make the btree ag cursor private union anonymous

 fs/xfs/libxfs/xfs_alloc.c          |  16 ++---
 fs/xfs/libxfs/xfs_alloc_btree.c    |  24 +++----
 fs/xfs/libxfs/xfs_bmap.c           |  46 ++++++------
 fs/xfs/libxfs/xfs_bmap_btree.c     |  50 ++++++-------
 fs/xfs/libxfs/xfs_btree.c          |  62 ++++++++--------
 fs/xfs/libxfs/xfs_btree.h          |  51 ++++++-------
 fs/xfs/libxfs/xfs_ialloc.c         |   2 +-
 fs/xfs/libxfs/xfs_ialloc_btree.c   |  20 +++---
 fs/xfs/libxfs/xfs_refcount.c       | 110 ++++++++++++++---------------
 fs/xfs/libxfs/xfs_refcount_btree.c |  28 ++++----
 fs/xfs/libxfs/xfs_rmap.c           | 110 ++++++++++++++---------------
 fs/xfs/libxfs/xfs_rmap_btree.c     |  28 ++++----
 fs/xfs/scrub/agheader_repair.c     |   2 +-
 fs/xfs/scrub/alloc.c               |   2 +-
 fs/xfs/scrub/bmap.c                |   4 +-
 fs/xfs/scrub/ialloc.c              |   8 +--
 fs/xfs/scrub/refcount.c            |   2 +-
 fs/xfs/scrub/rmap.c                |   2 +-
 fs/xfs/scrub/trace.c               |   4 +-
 fs/xfs/scrub/trace.h               |   4 +-
 fs/xfs/xfs_fsmap.c                 |   4 +-
 21 files changed, 291 insertions(+), 288 deletions(-)
Signature · 1 line
2.24.0.rc0