Print data items

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-02-01 10:58:17 -08:00
parent 52291b2c75
commit 44f8551fb6
2 changed files with 17 additions and 0 deletions

View File

@@ -238,6 +238,7 @@ struct scoutfs_key {
#define SCOUTFS_SYMLINK_KEY 8
#define SCOUTFS_EXTENT_KEY 9
#define SCOUTFS_ORPHAN_KEY 10
#define SCOUTFS_DATA_KEY 11
#define SCOUTFS_MAX_UNUSED_KEY 255
#define SCOUTFS_MAX_ITEM_LEN 512
@@ -268,6 +269,13 @@ struct scoutfs_orphan_key {
__be64 ino;
} __packed;
/* value is data payload bytes */
struct scoutfs_data_key {
__u8 type;
__be64 ino;
__be64 block;
} __packed;
struct scoutfs_btree_root {
u8 height;
struct scoutfs_block_ref ref;

View File

@@ -171,6 +171,14 @@ static void print_readdir(void *key, int key_len, void *val, int val_len)
name);
}
static void print_data(void *key, int key_len, void *val, int val_len)
{
struct scoutfs_data_key *dat = key;
printf(" data: ino %llu block %llu\n",
be64_to_cpu(dat->ino), be64_to_cpu(dat->block));
}
#if 0
static void print_link_backref(struct scoutfs_link_backref *lref,
unsigned int val_len)
@@ -205,6 +213,7 @@ static print_func_t printers[] = {
[SCOUTFS_ORPHAN_KEY] = print_orphan,
[SCOUTFS_DIRENT_KEY] = print_dirent,
[SCOUTFS_READDIR_KEY] = print_readdir,
[SCOUTFS_DATA_KEY] = print_data,
};
/* utils uses big contiguous allocations */