]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: new inode extent list lookup helpers
authorChristoph Hellwig <hch@lst.de>
Tue, 10 Jan 2017 02:18:39 +0000 (20:18 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:18:39 +0000 (20:18 -0600)
commit41db92d9fe6a5eb3a9794a313dbb7b7cb2526155
tree0197ef739939d332ab8db4bac3b60077216ef812
parent342ec632217b46a0a049d79906aef4cc5fdefb7d
xfs: new inode extent list lookup helpers

Source kernel commit: 93533c7855c3c78c8a900cac65c8d669bb14935d

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_inode_fork.c
libxfs/xfs_inode_fork.h