Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] xfs: consolidate metadir creation code
@ 2026-07-12  9:33 Johannes Thumshirn
  2026-07-12  9:33 ` [PATCH 1/3] xfs: add xfs_metadir_create_file helper Johannes Thumshirn
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johannes Thumshirn @ 2026-07-12  9:33 UTC (permalink / raw)
  To: linux-xfs
  Cc: Christoph Hellwig, Damien Le Moal, Carlos Maiolino,
	Johannes Thumshirn

The XFS metadata directory tree has grown several nearly identical
open-coded copies of the "create a metadata inode" sequence: allocate the
creation transaction, create and link the inode, do a bit of type
specific inode setup, commit, and finish or tear down the inode on both
the success and error paths.

Factor that boilerplate into a single helper, xfs_metadir_create_file(),
which takes the file mode and an optional callback to finish initializing
the new inode inside the creation transaction, and convert the existing
users - xfs_metadir_mkdir(), the quota inodes and the rtgroup inodes -
over to it.

Having a single helper also makes it straightforward to add new metadata
inode types without copying the sequence yet again.

No functional change intended otherwise.

Johannes Thumshirn (3):
  xfs: add xfs_metadir_create_file helper
  xfs: create quota metadir inodes using xfs_metadir_create_file
  xfs: create rtgroup metadir inodes using xfs_metadir_create_file

 fs/xfs/libxfs/xfs_dquot_buf.c | 29 +++++++-----------
 fs/xfs/libxfs/xfs_metadir.c   | 58 ++++++++++++++++++++++-------------
 fs/xfs/libxfs/xfs_metadir.h   |  6 ++++
 fs/xfs/libxfs/xfs_rtgroup.c   | 58 ++++++++++++++++-------------------
 4 files changed, 80 insertions(+), 71 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-13  6:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12  9:33 [PATCH 0/3] xfs: consolidate metadir creation code Johannes Thumshirn
2026-07-12  9:33 ` [PATCH 1/3] xfs: add xfs_metadir_create_file helper Johannes Thumshirn
2026-07-13  6:51   ` Christoph Hellwig
2026-07-12  9:33 ` [PATCH 2/3] xfs: create quota metadir inodes using xfs_metadir_create_file Johannes Thumshirn
2026-07-13  6:55   ` Christoph Hellwig
2026-07-12  9:33 ` [PATCH 3/3] xfs: create rtgroup " Johannes Thumshirn
2026-07-13  6:58   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox