diff options
author | Mark Fasheh <mfasheh@suse.de> | 2014-04-26 20:23:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-05-04 23:15:48 -0400 |
commit | bd1413d499a70be5781cfe01258ca529482e7194 (patch) | |
tree | d05b8d890f49183ecd4350abc7aac195c1a0c54e | |
parent | 6d82e1f4c7af427975009063d387f66cf9672962 (diff) | |
download | e2fsprogs-bd1413d499a70be5781cfe01258ca529482e7194.tar.gz |
e2fsprogs/filefrag: print shared extent flag
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>
-rw-r--r-- | lib/ext2fs/fiemap.h | 2 | ||||
-rw-r--r-- | misc/filefrag.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/ext2fs/fiemap.h b/lib/ext2fs/fiemap.h index 30bf5555..895cd0ba 100644 --- a/lib/ext2fs/fiemap.h +++ b/lib/ext2fs/fiemap.h @@ -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 */ diff --git a/misc/filefrag.c b/misc/filefrag.c index a050a226..929a33bc 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -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,"); |