diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-01-02 15:12:30 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-02-02 14:16:38 +0100 |
commit | aae2c8421bb39014ed606b7bd9f37641c27d5a52 (patch) | |
tree | b78b33e993cfb5cea578eb77472f2cf9578c75dc /ctree.h | |
parent | 0ddf63c09f2e24cd8f94e662c93055099fff2e2c (diff) | |
download | btrfs-progs-aae2c8421bb39014ed606b7bd9f37641c27d5a52.tar.gz |
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>
Diffstat (limited to 'ctree.h')
-rw-r--r-- | ctree.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2468,4 +2468,13 @@ int btrfs_add_orphan_item(struct btrfs_trans_handle *trans, u64 ino); int btrfs_mkdir(struct btrfs_trans_handle *trans, struct btrfs_root *root, char *name, int namelen, u64 parent_ino, u64 *ino, int mode); + +/* file.c */ +int btrfs_get_extent(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_path *path, + u64 ino, u64 offset, u64 len, int ins_len); +int btrfs_punch_hole(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + u64 ino, u64 offset, u64 len); #endif |