@@ -64,5 +64,7 @@ struct fiemap {
#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
* support extents. Result
* merged for efficiency. */
+#define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other
+ * files. */
#endif /* _LINUX_FIEMAP_H */
@@ -165,6 +165,8 @@ static void print_extent_info(struct fiemap_extent *fm_extent, int cur_ex,
strcat(flags, "unwritten,");
if (fm_extent->fe_flags & FIEMAP_EXTENT_MERGED)
strcat(flags, "merged,");
+ if (fm_extent->fe_flags & FIEMAP_EXTENT_SHARED)
+ strcat(flags, "shared,");
if (fm_extent->fe_logical + fm_extent->fe_length >= (__u64) st->st_size)
strcat(flags, "eof,");
Filesystems, such as ocfs2 and btrfs, support shared space that is shared among different files, so the upstream introduces flag FIEMAP_EXTENT_SHARED for that. With this, e2fsprogs's filefrag also support the flag. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> --- lib/ext2fs/fiemap.h | 2 ++ misc/filefrag.c | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-)