path: root/ctree.h
diff options
authorQu Wenruo <>2017-02-23 13:53:25 +0800
committerDavid Sterba <>2017-03-16 17:02:44 +0100
commit5613d32e75fe6f55e1c41f86389624b46a9ef5a7 (patch)
treec719630163dae19f89f7bc84b434e67df44ded10 /ctree.h
parente8d2163e06e82dcc0f0987006fc08ecea08bc896 (diff)
btrfs-progs: file: Introduce function to read out file content
Introduce a new function, btrfs_read_file(), to read out data of a file inode. This function will iterate through EXTENT_DATA items and handle inline/prealloc/hole file extents. Compression is not supported yet. Signed-off-by: Qu Wenruo <> Signed-off-by: David Sterba <>
Diffstat (limited to 'ctree.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index 1d0622d9..f89ffeb7 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2776,4 +2776,7 @@ int btrfs_get_extent(struct btrfs_trans_handle *trans,
int btrfs_punch_hole(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
u64 ino, u64 offset, u64 len);
+int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, u64 len,
+ char *dest);