Hi all, This series prepares the btree code to support realtime reverse mapping btrees by refactoring xfs_ifork_realloc to be fed a per-btree ops structure so that it can handle multiple types of inode-rooted btrees. It moves on to refactoring the btree code to use the new realloc routines and to support storing btree rcords in the inode root, because the current bmbt code does not support this. 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-ifork-records xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=btree-ifork-records --- db/bmap.c | 10 + db/bmap_inflate.c | 2 db/bmroot.c | 8 - db/btheight.c | 18 -- db/check.c | 8 - db/frag.c | 8 - db/metadump.c | 16 +- libxfs/xfs_alloc_btree.c | 6 - libxfs/xfs_alloc_btree.h | 3 libxfs/xfs_attr_leaf.c | 8 - libxfs/xfs_bmap.c | 59 +++---- libxfs/xfs_bmap_btree.c | 93 +++++++++- libxfs/xfs_bmap_btree.h | 219 +++++++++++++++++-------- libxfs/xfs_btree.c | 382 +++++++++++++++++++++++++++++++++---------- libxfs/xfs_btree.h | 4 libxfs/xfs_btree_staging.c | 4 libxfs/xfs_ialloc.c | 4 libxfs/xfs_ialloc_btree.c | 6 - libxfs/xfs_ialloc_btree.h | 3 libxfs/xfs_inode_fork.c | 163 ++++++++---------- libxfs/xfs_inode_fork.h | 27 +++ libxfs/xfs_refcount_btree.c | 5 - libxfs/xfs_refcount_btree.h | 3 libxfs/xfs_rmap_btree.c | 9 + libxfs/xfs_rmap_btree.h | 3 libxfs/xfs_sb.c | 16 +- libxfs/xfs_trans_resv.c | 2 repair/bmap_repair.c | 2 repair/dinode.c | 10 + repair/phase5.c | 16 +- repair/prefetch.c | 8 - repair/scan.c | 6 - 32 files changed, 749 insertions(+), 382 deletions(-)