Skip to content

RFC xfs: reverse mapping btree support

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest20 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20xfs: xfs_alloc_fix_freelist() can use incore perag structuresfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +1 more+37 -461 reply
2/20xfs: factor out free space extent length checkfs/xfs/libxfs/xfs_alloc.c+44 -271 reply
3/20xfs: sanitise error handling in xfs_alloc_fix_freelistfs/xfs/libxfs/xfs_alloc.c+47 -564 replies
4/20xfs: clean up XFS_MIN_FREELIST macrosfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +4 more+26 -211 reply
5/20xfs: introduce rmap btree definitionsfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_btree.c fs/xfs/libxfs/xfs_btree.h +2 more+30 -92 replies
6/20xfs: add rmap btree stats infrastructurefs/xfs/libxfs/xfs_btree.h fs/xfs/xfs_stats.c fs/xfs/xfs_stats.h+20 -30 replies
7/20xfs: rmap btree add more reserved blocksfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_format.h +3 more+20 -110 replies
8/20xfs: add owner field to extent allocation and freeingfs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +8 more+71 -313 replies
9/20xfs: introduce rmap extent operation stubsfs/xfs/Makefile fs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_rmap.c +2 more+168 -00 replies
10/20xfs: define the on-disk rmap btree formatfs/xfs/Makefile fs/xfs/libxfs/xfs_btree.c fs/xfs/libxfs/xfs_btree.h +6 more+269 -80 replies
11/20xfs: add rmap btree growfs supportfs/xfs/xfs_fsops.c+68 -00 replies
12/20xfs: rmap btree transaction reservationsfs/xfs/libxfs/xfs_trans_resv.c fs/xfs/libxfs/xfs_trans_resv.h+39 -270 replies
13/20xfs: rmap btree requires more reserved free spacefs/xfs/libxfs/xfs_alloc.c fs/xfs/libxfs/xfs_alloc.h fs/xfs/libxfs/xfs_bmap.c +6 more+85 -422 replies
14/20xfs: add rmap btree operationsfs/xfs/libxfs/xfs_btree.h fs/xfs/libxfs/xfs_rmap.c fs/xfs/libxfs/xfs_rmap_btree.c+263 -00 replies
15/20xfs: add an extent to the rmap btreefs/xfs/libxfs/xfs_rmap.c+138 -12 replies
16/20xfs: remove an extent from the rmap btreefs/xfs/libxfs/xfs_rmap.c+153 -10 replies
17/20xfs: add rmap btree geometry feature flagfs/xfs/libxfs/xfs_fs.h fs/xfs/xfs_fsops.c+3 -00 replies
18/20xfs: add rmap btree block detection to log recoveryfs/xfs/xfs_log_recover.c+4 -00 replies
19/20xfs: disable XFS_IOC_SWAPEXT when rmap btree is enabledfs/xfs/xfs_bmap_util.c+13 -00 replies
20/20xfs: enable the rmap btree functionalityfs/xfs/libxfs/xfs_format.h fs/xfs/libxfs/xfs_sb.c+8 -10 replies

Reviews trailers per patch

4 of 20 patches have a Reviewed-by or Acked-by.

PatchBrian Foster
1/20R-b
2/20R-b
3/20R-b
4/20R-b
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/20] xfs: reverse mapping btree support

Hi Folks,

This is the first pass at kernel support for reverse block mapping btree support in XFS. It is a single [block, owner] tree, so does not support multiple mappings of a single block. That's left as an exercise for Darrick to solve with the reflink btree code he is working on. :P

The patch set is based on the current for-next branch (i.e. on top of the sparse inode branch). I've also got my DAX branch and all the current pending fixes applied ahead of this series too, so if you have problems applying it, those will go away in the next couple of days as those patchsets are pushed into the for-next branch.

The first 4 patches are not rmap btree patches - they do an initial cleanup on xfs_alloc_fix_freelist() to be easier to read and also to clean up some of the macros we need to add rmap support to. These 4 patches stand alone and can be reviewed and committed sepearately to the rest of the rmap btree code.

In general, the approach I;ve taken is to add a piece at a time in each patch. I've added stubs to show how owner information is will be passed around, as well as how the rmap btree will be modified long before the the rmap implementation is added. I did this to clearly separate the rmap btree implementation details from surrounding code that drives it. hence it should be easier to review as the changes are as simply as possible.

It's not 100% complete - there is still things like XFS_IOC_SWAPEXT that needs to be handled, but like the original CRC implementation swapping the owners of extents is not straight forward, and so that will be done once the core implementation has settled down.

As for testing, this really is only lightly smoke tested right now; sufficient to post it as an RFC, but that's really it because the userspace side is not yet complete. e.g. xfs_repair will typically SEGV in phase 5 because there's no code to rebuild the rmap btree yet. xfs_repair -n, however, does work, and it does validate the consistency of the rmap btree against the free space btrees and the used space indexed by the filesystem in phases 3 and 4. That said, it has passed the entire "quick" group in xfstests, except for the tests dependent on swapext or repair working correctly, so it's not entirely broken. ;)

The current userspace code is still based on the older single-patch code that I started with a couple of days ago before splitting the kernel kernel code into this series. It's just a single patch right now based on top of the libxfs-4.1-update branch in the kernel.org tree. Get it from the following repo branch:

git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git rmap-btree

I've been testing with:

# mkfs.xfs -f -m crc=1,finobt=1,rmapbt=1 <dev>

Over the next couple of days, I'll rebase the libxfs-4.1-update branch to the current master branch and push Brian's sparse inode support patchset into it as well. Then I'll start cleaning up the userspace patchset and implementing some of the missing pieces.

Comments, flames, insanity pleas, testing and discussion all welcome.

-Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs