From 9c00602051032aaa7ff7eab6955af8b0cb0a087c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 15 May 2017 09:45:49 -0700 Subject: [PATCH] scoutfs-utils: print extent flags Signed-off-by: Zach Brown --- utils/src/format.h | 3 +++ utils/src/print.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/utils/src/format.h b/utils/src/format.h index a58d12b6..63cc07be 100644 --- a/utils/src/format.h +++ b/utils/src/format.h @@ -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; diff --git a/utils/src/print.c b/utils/src/print.c index d9e4cc21..8921d182 100644 --- a/utils/src/print.c +++ b/utils/src/print.c @@ -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)