]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: during btree split, save new block key & ptr for future insertion
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 10 Aug 2016 01:29:36 +0000 (11:29 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 10 Aug 2016 01:29:36 +0000 (11:29 +1000)
commitd3cd7a2729b66a0c3792466ee9cecc5c6139f46e
treeaaac4d1a8acd5a0312504f40a3f570b16ed92c5f
parentcff8bf94d0aa4d8bc50d3b3fee2c086ceebc0988
xfs: during btree split, save new block key & ptr for future insertion

Source kernel commit: e5821e57af54abc36ea299bde6c101a804cfac27

When a btree block has to be split, we pass the new block's ptr from
xfs_btree_split() back to xfs_btree_insert() via a pointer parameter;
however, we pass the block's key through the cursor's record.  It is a
little weird to "initialize" a record from a key since the non-key
attributes will have garbage values.

When we go to add support for interval queries, we have to be able to
pass the lowest and highest keys accessible via a pointer.  There's no
clean way to pass this back through the cursor's record field.
Therefore, pass the key directly back to xfs_btree_insert() the same
way that we pass the btree_ptr.

As a bonus, we no longer need init_rec_from_key and can drop it from the
codebase.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_alloc_btree.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_ialloc_btree.c