btrfs-progs: Add btrfs_get_extent() and btrfs_punch_hole().
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 2 Jan 2015 07:12:30 +0000 (15:12 +0800)
committerDavid Sterba <dsterba@suse.cz>
Mon, 2 Feb 2015 13:16:38 +0000 (14:16 +0100)
commitaae2c8421bb39014ed606b7bd9f37641c27d5a52
treeb78b33e993cfb5cea578eb77472f2cf9578c75dc
parent0ddf63c09f2e24cd8f94e662c93055099fff2e2c
btrfs-progs: Add btrfs_get_extent() and btrfs_punch_hole().

Add btrfs_get_extent() and btrfs_punch_hole() for btrfs-progs.

Btrfs_get_extent() will act much like kernel one, return the first
extent that covers the given range.
The difference will be that progs btrfs_get_extent() can't handle
no-holes feature, which means caller should handle it carefully.

Btrfs_punch_hole() will punch a hole in given range of given inode,
however it differs from kernel one since it won't zero any page or drop
any extents if there is any extent in the hole range.

These functions are mainly used for later I_ERR_FILE_EXTENT_DISCOUNT
repair function.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Makefile.in
ctree.h
file.c [new file with mode: 0644]