summaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2012-12-10 14:06:02 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-12-10 14:06:02 -0500
commit941919856c11d4dd11d4fcabb4dab58bd2b146bf (patch)
treedcb06b13ca094575d9f32e49371560c1c956c874 /fs/ext4/extents.c
parent32f7f22c0b52e8189fef83986b16dc7abe95f2c4 (diff)
downloadop-kernel-dev-941919856c11d4dd11d4fcabb4dab58bd2b146bf.zip
op-kernel-dev-941919856c11d4dd11d4fcabb4dab58bd2b146bf.tar.gz
ext4: let fiemap work with inline data
fiemap is used to find the disk layout of a file, as for inline data, let us just pretend like a file with just one extent. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f2659f5..70dc6fc 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4802,6 +4802,15 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
ext4_lblk_t start_blk;
int error = 0;
+ if (ext4_has_inline_data(inode)) {
+ int has_inline = 1;
+
+ error = ext4_inline_data_fiemap(inode, fieinfo, &has_inline);
+
+ if (has_inline)
+ return error;
+ }
+
/* fallback to generic here if not in extents fmt */
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return generic_block_fiemap(inode, fieinfo, start, len,
OpenPOWER on IntegriCloud