Whamcloud - gitweb
e2fsprogs/filefrag: print shared extent flag
authorMark Fasheh <mfasheh@suse.de>
Sun, 27 Apr 2014 00:23:00 +0000 (20:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 5 May 2014 03:15:48 +0000 (23:15 -0400)
Filefrag doesn't catch and print the shared extent flag. Add this for
users of filefrag on file systems with shared extents (such as btrfs).

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/fiemap.h
misc/filefrag.c

index 30bf555..895cd0b 100644 (file)
@@ -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 */
index a050a22..929a33b 100644 (file)
@@ -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,");