xfs: introduce interval queries on btrees
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 3 Aug 2016 01:10:21 +0000 (11:10 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 3 Aug 2016 01:10:21 +0000 (11:10 +1000)
commit105f7d83db4f82ce170893eaaca946754e38541f
tree84975f57ee805392ba98180a075993afc1e65ece
parent2c813ad66a7218a64db68f0a4bfa8d2d9caef4c0
xfs: introduce interval queries on btrees

Create a function to enable querying of btree records mapping to a
range of keys.  This will be used in subsequent patches to allow
querying the reverse mapping btree to find the extents mapped to a
range of physical blocks, though the generic code can be used for
any range query.

The overlapped query range function needs to use the btree get_block
helper because the root block could be an inode, in which case
bc_bufs[nlevels-1] will be NULL.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/xfs_trace.h