scoutfs-utils: print extent flags

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-05-15 09:45:49 -07:00
parent a9cb464d49
commit 9c00602051
2 changed files with 7 additions and 2 deletions

View File

@@ -206,8 +206,11 @@ struct scoutfs_file_extent_key {
__be64 last_blk_off;
__be64 last_blkno;
__be64 blocks;
__u8 flags;
} __packed;
#define SCOUTFS_FILE_EXTENT_OFFLINE (1 << 0)
/* no value */
struct scoutfs_free_extent_blkno_key {
__u8 type;

View File

@@ -191,8 +191,10 @@ static void print_file_extent(void *key, int key_len, void *val, int val_len)
u64 blk_off = be64_to_cpu(fext->last_blk_off) - blocks + 1;
u64 blkno = be64_to_cpu(fext->last_blkno) - blocks + 1;
printf(" extent: ino %llu blk_off %llu blkno %llu blocks %llu\n",
be64_to_cpu(fext->ino), blk_off, blkno, blocks);
printf(" extent: ino %llu blk_off %llu blkno %llu blocks %llu "
"flags %x (%c)\n",
be64_to_cpu(fext->ino), blk_off, blkno, blocks, fext->flags,
(fext->flags & SCOUTFS_FILE_EXTENT_OFFLINE) ? 'O' : '-');
}
static void print_free_extent(void *key, int key_len, void *val, int val_len)