scoutfs-utils: support symlink item with nr field

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-06-22 11:26:00 -07:00
parent 6ae8e9743f
commit d78649e065
2 changed files with 13 additions and 4 deletions

View File

@@ -263,12 +263,15 @@ struct scoutfs_xattr_val_header {
__u8 last_part;
} __packed;
/* value is the null terminated target path */
/* size determines nr needed to store full target path in their values */
struct scoutfs_symlink_key {
__u8 type;
__be64 ino;
__u8 nr;
} __packed;
#define SCOUTFS_SYMLINK_MAX_VAL_SIZE 200
struct scoutfs_betimespec {
__be64 sec;
__be32 nsec;

View File

@@ -176,11 +176,17 @@ static void print_link_backref(void *key, int key_len, void *val, int val_len)
static void print_symlink(void *key, int key_len, void *val, int val_len)
{
struct scoutfs_symlink_key *skey = key;
u8 *name = global_printable_name(val, val_len - 1);
u8 *frag = val;
u8 *name;
printf(" symlink: ino %llu\n"
/* don't try to print null term */
if (frag[val_len - 1] == '\0')
val_len--;
name = global_printable_name(frag, val_len);
printf(" symlink: ino %llu nr %u\n"
" target %s\n",
be64_to_cpu(skey->ino), name);
be64_to_cpu(skey->ino), skey->nr, name);
}
/*