Print symlink items

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-02-09 16:25:37 -08:00
parent 77d0268cb2
commit 2e2ee3b2f1
2 changed files with 15 additions and 4 deletions

View File

@@ -301,6 +301,12 @@ struct scoutfs_xattr_val_header {
__u8 last_part;
} __packed;
/* value is the null terminated target path */
struct scoutfs_symlink_key {
__u8 type;
__be64 ino;
} __packed;
struct scoutfs_btree_root {
u8 height;
struct scoutfs_block_ref ref;

View File

@@ -184,13 +184,17 @@ static void print_link_backref(void *key, int key_len, void *val, int val_len)
be64_to_cpu(lbkey->ino), be64_to_cpu(lbkey->dir_ino), name);
}
#if 0
/* for now show the raw component items not the whole path */
static void print_symlink(char *str, unsigned int val_len)
static void print_symlink(void *key, int key_len, void *val, int val_len)
{
printf(" symlink: %.*s\n", val_len, str);
struct scoutfs_symlink_key *skey = key;
u8 *name = global_printable_name(val, val_len - 1);
printf(" symlink: ino %llu\n"
" target %s\n",
be64_to_cpu(skey->ino), name);
}
#if 0
#define EXT_FLAG(f, flags, str) \
(flags & f) ? str : "", (flags & (f - 1)) ? "|" : ""
@@ -212,6 +216,7 @@ static print_func_t printers[] = {
[SCOUTFS_ORPHAN_KEY] = print_orphan,
[SCOUTFS_DIRENT_KEY] = print_dirent,
[SCOUTFS_READDIR_KEY] = print_readdir,
[SCOUTFS_SYMLINK_KEY] = print_symlink,
[SCOUTFS_LINK_BACKREF_KEY] = print_link_backref,
[SCOUTFS_DATA_KEY] = print_data,
};