diff --git a/utils/src/format.h b/utils/src/format.h index a2931169..28125b6c 100644 --- a/utils/src/format.h +++ b/utils/src/format.h @@ -262,6 +262,12 @@ struct scoutfs_readdir_key { __be64 pos; } __packed; +/* no value */ +struct scoutfs_orphan_key { + __u8 type; + __be64 ino; +} __packed; + struct scoutfs_btree_root { u8 height; struct scoutfs_block_ref ref; diff --git a/utils/src/print.c b/utils/src/print.c index 412cf3a7..7c5b1321 100644 --- a/utils/src/print.c +++ b/utils/src/print.c @@ -103,6 +103,13 @@ static void print_inode(void *key, int key_len, void *val, int val_len) le32_to_cpu(inode->mtime.nsec)); } +static void print_orphan(void *key, int key_len, void *val, int val_len) +{ + struct scoutfs_orphan_key *okey = key; + + printf(" orphan: ino %llu\n", be64_to_cpu(okey->ino)); +} + #if 0 static void print_xattr(struct scoutfs_xattr *xat) @@ -193,6 +200,7 @@ typedef void (*print_func_t)(void *key, int key_len, void *val, int val_len); static print_func_t printers[] = { [SCOUTFS_INODE_KEY] = print_inode, + [SCOUTFS_ORPHAN_KEY] = print_orphan, [SCOUTFS_DIRENT_KEY] = print_dirent, [SCOUTFS_READDIR_KEY] = print_readdir, };