Print orphan items

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-01-25 11:16:21 -08:00
parent c4f2563cc1
commit 38c8a4901f
2 changed files with 14 additions and 0 deletions

View File

@@ -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;

View File

@@ -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,
};