]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: new inode extent list lookup helpers
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Nov 2016 00:39:32 +0000 (11:39 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 24 Nov 2016 00:39:32 +0000 (11:39 +1100)
commita48529dbbdd96f2fe8c5a081f6a765ebc0a52268
tree1548227b5ad58d17ef45d37fd493d48733318817
parenta012b583ef5edf820eb0fa9dc2a814f87e546484
xfs: new inode extent list lookup helpers

xfs_iext_lookup_extent looks up a single extent at the passed in offset,
and returns the extent covering the area, or the one behind it in case
of a hole, as well as the index of the returned extent in arguments,
as well as a simple bool as return value that is set to false if no
extent could be found because the offset is behind EOF.  It is a simpler
replacement for xfs_bmap_search_extent that leaves looking up the rarely
needed previous extent to the caller and has a nicer calling convention.

xfs_iext_get_extent is a helper for iterating over the extent list,
it takes an extent index as input, and returns the extent at that index
in it's expanded form in an argument if it exists.  The actual return
value is a bool whether the index is valid or not.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_inode_fork.h