瀏覽代碼

Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap

We should be doing this, it's weird we hadn't been doing this.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Josef Bacik 10 年之前
父節點
當前提交
0d2b2372e0
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/btrfs/extent_io.c

+ 2 - 0
fs/btrfs/extent_io.c

@@ -4497,6 +4497,8 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 		}
 		}
 		if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))
 		if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))
 			flags |= FIEMAP_EXTENT_ENCODED;
 			flags |= FIEMAP_EXTENT_ENCODED;
+		if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
+			flags |= FIEMAP_EXTENT_UNWRITTEN;
 
 
 		free_extent_map(em);
 		free_extent_map(em);
 		em = NULL;
 		em = NULL;