public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v29.2 1/8] xfs: move btree geometry to ops struct
@ 2024-02-01 19:39 Darrick J. Wong
  2024-02-01 19:39 ` [PATCH 01/23] xfs: consolidate btree block freeing tracepoints Darrick J. Wong
                   ` (22 more replies)
  0 siblings, 23 replies; 33+ messages in thread
From: Darrick J. Wong @ 2024-02-01 19:39 UTC (permalink / raw)
  To: djwong; +Cc: Christoph Hellwig, hch, linux-xfs

Hi all,

This patchset prepares the generic btree code to allow for the creation
of new btree types outside of libxfs.  The end goal here is for online
fsck to be able to create its own in-memory btrees that will be used to
improve the performance (and reduce the memory requirements of) the
refcount btree.

To enable this, I decided that the btree ops structure is the ideal
place to encode all of the geometry information about a btree. The btree
ops struture already contains the buffer ops (and hence the btree block
magic numbers) as well as the key and record sizes, so it doesn't seem
all that farfetched to encode the XFS_BTREE_ flags that determine the
geometry (ROOT_IN_INODE, LONG_PTRS, etc).

The rest of the patchset cleans up the btree functions that initialize
btree blocks and btree buffers.  The bulk of this work is to replace
btree geometry related function call arguments with a single pointer to
the ops structure, and then clean up everything else around that.  As a
side effect, we rename the functions.

Later, Christoph Hellwig and I merged together a bunch more cleanups
that he wanted to do for a while.  All the btree geometry information is
now in the btree ops structure, we've created an explicit btree type
(ag, inode, mem) and moved the per-btree type information to a separate
union.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=btree-geometry-in-ops

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=btree-geometry-in-ops
---
Commits in this patchset:
 * xfs: consolidate btree block freeing tracepoints
 * xfs: consolidate btree block allocation tracepoints
 * xfs: set the btree cursor bc_ops in xfs_btree_alloc_cursor
 * xfs: drop XFS_BTREE_CRC_BLOCKS
 * xfs: fix imprecise logic in xchk_btree_check_block_owner
 * xfs: encode the btree geometry flags in the btree ops structure
 * xfs: remove bc_ino.flags
 * xfs: consolidate the xfs_alloc_lookup_* helpers
 * xfs: turn the allocbt cursor active field into a btree flag
 * xfs: extern some btree ops structures
 * xfs: initialize btree blocks using btree_ops structure
 * xfs: rename btree block/buffer init functions
 * xfs: btree convert xfs_btree_init_block to xfs_btree_init_buf calls
 * xfs: remove the unnecessary daddr paramter to _init_block
 * xfs: set btree block buffer ops in _init_buf
 * xfs: move lru refs to the btree ops structure
 * xfs: move the btree stats offset into struct btree_ops
 * xfs: factor out a xfs_btree_owner helper
 * xfs: factor out a btree block owner check
 * xfs: store the btree pointer length in struct xfs_btree_ops
 * xfs: split out a btree type from the btree ops geometry flags
 * xfs: split the per-btree union in struct xfs_btree_cur
 * xfs: create predicate to determine if cursor is at inode root level
---
 fs/xfs/libxfs/xfs_ag.c             |   33 +--
 fs/xfs/libxfs/xfs_ag.h             |    2 
 fs/xfs/libxfs/xfs_alloc.c          |   54 +++--
 fs/xfs/libxfs/xfs_alloc_btree.c    |   39 ++--
 fs/xfs/libxfs/xfs_bmap.c           |   58 ++----
 fs/xfs/libxfs/xfs_bmap_btree.c     |   59 +++---
 fs/xfs/libxfs/xfs_bmap_btree.h     |    3 
 fs/xfs/libxfs/xfs_btree.c          |  365 ++++++++++++++++++------------------
 fs/xfs/libxfs/xfs_btree.h          |  165 +++++++++-------
 fs/xfs/libxfs/xfs_btree_staging.c  |   20 +-
 fs/xfs/libxfs/xfs_btree_staging.h  |    3 
 fs/xfs/libxfs/xfs_ialloc_btree.c   |   35 ++-
 fs/xfs/libxfs/xfs_refcount.c       |   24 +-
 fs/xfs/libxfs/xfs_refcount_btree.c |   24 +-
 fs/xfs/libxfs/xfs_rmap_btree.c     |   19 +-
 fs/xfs/libxfs/xfs_shared.h         |    9 +
 fs/xfs/scrub/btree.c               |   29 ++-
 fs/xfs/scrub/newbt.c               |    2 
 fs/xfs/scrub/trace.c               |    2 
 fs/xfs/xfs_trace.h                 |   83 ++++++++
 20 files changed, 566 insertions(+), 462 deletions(-)


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

end of thread, other threads:[~2024-02-02 16:36 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 19:39 [PATCHSET v29.2 1/8] xfs: move btree geometry to ops struct Darrick J. Wong
2024-02-01 19:39 ` [PATCH 01/23] xfs: consolidate btree block freeing tracepoints Darrick J. Wong
2024-02-02  6:18   ` Christoph Hellwig
2024-02-01 19:40 ` [PATCH 02/23] xfs: consolidate btree block allocation tracepoints Darrick J. Wong
2024-02-02  6:18   ` Christoph Hellwig
2024-02-01 19:40 ` [PATCH 03/23] xfs: set the btree cursor bc_ops in xfs_btree_alloc_cursor Darrick J. Wong
2024-02-01 19:40 ` [PATCH 04/23] xfs: drop XFS_BTREE_CRC_BLOCKS Darrick J. Wong
2024-02-02  6:19   ` Christoph Hellwig
2024-02-01 19:40 ` [PATCH 05/23] xfs: fix imprecise logic in xchk_btree_check_block_owner Darrick J. Wong
2024-02-02  6:22   ` Christoph Hellwig
2024-02-01 19:41 ` [PATCH 06/23] xfs: encode the btree geometry flags in the btree ops structure Darrick J. Wong
2024-02-02  6:23   ` Christoph Hellwig
2024-02-02 16:36     ` Darrick J. Wong
2024-02-01 19:41 ` [PATCH 07/23] xfs: remove bc_ino.flags Darrick J. Wong
2024-02-01 19:41 ` [PATCH 08/23] xfs: consolidate the xfs_alloc_lookup_* helpers Darrick J. Wong
2024-02-01 19:42 ` [PATCH 09/23] xfs: turn the allocbt cursor active field into a btree flag Darrick J. Wong
2024-02-01 19:42 ` [PATCH 10/23] xfs: extern some btree ops structures Darrick J. Wong
2024-02-01 19:42 ` [PATCH 11/23] xfs: initialize btree blocks using btree_ops structure Darrick J. Wong
2024-02-01 19:42 ` [PATCH 12/23] xfs: rename btree block/buffer init functions Darrick J. Wong
2024-02-01 19:43 ` [PATCH 13/23] xfs: btree convert xfs_btree_init_block to xfs_btree_init_buf calls Darrick J. Wong
2024-02-01 19:43 ` [PATCH 14/23] xfs: remove the unnecessary daddr paramter to _init_block Darrick J. Wong
2024-02-01 19:43 ` [PATCH 15/23] xfs: set btree block buffer ops in _init_buf Darrick J. Wong
2024-02-01 19:43 ` [PATCH 16/23] xfs: move lru refs to the btree ops structure Darrick J. Wong
2024-02-01 19:44 ` [PATCH 17/23] xfs: move the btree stats offset into struct btree_ops Darrick J. Wong
2024-02-01 19:44 ` [PATCH 18/23] xfs: factor out a xfs_btree_owner helper Darrick J. Wong
2024-02-01 19:44 ` [PATCH 19/23] xfs: factor out a btree block owner check Darrick J. Wong
2024-02-02  6:23   ` Christoph Hellwig
2024-02-01 19:44 ` [PATCH 20/23] xfs: store the btree pointer length in struct xfs_btree_ops Darrick J. Wong
2024-02-02  6:24   ` Christoph Hellwig
2024-02-01 19:45 ` [PATCH 21/23] xfs: split out a btree type from the btree ops geometry flags Darrick J. Wong
2024-02-01 19:45 ` [PATCH 22/23] xfs: split the per-btree union in struct xfs_btree_cur Darrick J. Wong
2024-02-01 19:45 ` [PATCH 23/23] xfs: create predicate to determine if cursor is at inode root level Darrick J. Wong
2024-02-02  6:24   ` Christoph Hellwig

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