f2fs: recognize encrypted data in f2fs_fiemap
authorChao Yu <chao2.yu@samsung.com>
Fri, 8 Jan 2016 12:19:27 +0000 (20:19 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 8 Jan 2016 19:51:58 +0000 (11:51 -0800)
This patch fixes to teach f2fs_fiemap to recognize encrypted data.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 6fae75ddae6d13b4efd1dfa3485361ddb09daa93..a3bce12b0cce535b11878d0a628e458d115a2a15 100644 (file)
@@ -830,9 +830,13 @@ next:
                flags |= FIEMAP_EXTENT_LAST;
        }
 
-       if (size)
+       if (size) {
+               if (f2fs_encrypted_inode(inode))
+                       flags |= FIEMAP_EXTENT_DATA_ENCRYPTED;
+
                ret = fiemap_fill_next_extent(fieinfo, logical,
                                phys, size, flags);
+       }
 
        if (start_blk > last_blk || ret)
                goto out;