All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] xfs: consolidate metadir creation code
@ 2026-07-13 12:42 Johannes Thumshirn
  2026-07-13 12:42 ` [PATCH v2 1/4] xfs: add xfs_metadir_create_file helper Johannes Thumshirn
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Johannes Thumshirn @ 2026-07-13 12:42 UTC (permalink / raw)
  To: linux-xfs
  Cc: Christoph Hellwig, Carlos Maiolino, Damien Le Moal,
	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.

Changes to v1:
- Re-based onto xfs/for-next HEAD: f88caa121eac ("xfs: use xfs_csn_t for xlog_cil_push_now() push_seq parameter")
- Added patch 4/4
- Added Christoph's review

Johannes Thumshirn (4):
  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
  xfs: mark internal metadir file creation helpers static

 fs/xfs/libxfs/xfs_dquot_buf.c | 39 ++++++---------------
 fs/xfs/libxfs/xfs_metadir.c   | 64 ++++++++++++++++++++++-------------
 fs/xfs/libxfs/xfs_metadir.h   |  8 +++--
 fs/xfs/libxfs/xfs_rtgroup.c   | 58 ++++++++++++++-----------------
 4 files changed, 82 insertions(+), 87 deletions(-)

-- 
2.54.0


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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 12:42 [PATCH v2 0/4] xfs: consolidate metadir creation code Johannes Thumshirn
2026-07-13 12:42 ` [PATCH v2 1/4] xfs: add xfs_metadir_create_file helper Johannes Thumshirn
2026-07-13 13:31   ` Christoph Hellwig
2026-07-13 22:51   ` Darrick J. Wong
2026-07-13 12:42 ` [PATCH v2 2/4] xfs: create quota metadir inodes using xfs_metadir_create_file Johannes Thumshirn
2026-07-13 22:52   ` Darrick J. Wong
2026-07-13 12:42 ` [PATCH v2 3/4] xfs: create rtgroup " Johannes Thumshirn
2026-07-13 22:54   ` Darrick J. Wong
2026-07-13 12:42 ` [PATCH v2 4/4] xfs: mark internal metadir file creation helpers static Johannes Thumshirn
2026-07-13 13:32   ` Christoph Hellwig
2026-07-13 22:55   ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.