mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-09 05:13:18 +00:00
scoutfs-utils: remove scoutfs_log_trees_val
We're just using the one log_trees struct for both network messages and persistent btree item values. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -430,16 +430,6 @@ struct scoutfs_log_trees {
|
||||
__le64 nr;
|
||||
};
|
||||
|
||||
struct scoutfs_log_trees_val {
|
||||
struct scoutfs_alloc_list_head meta_avail;
|
||||
struct scoutfs_alloc_list_head meta_freed;
|
||||
struct scoutfs_btree_root item_root;
|
||||
struct scoutfs_btree_ref bloom_ref;
|
||||
struct scoutfs_alloc_root data_avail;
|
||||
struct scoutfs_alloc_root data_freed;
|
||||
struct scoutfs_srch_file srch_file;
|
||||
};
|
||||
|
||||
struct scoutfs_log_item_value {
|
||||
__le64 vers;
|
||||
__u8 flags;
|
||||
|
||||
@@ -290,7 +290,7 @@ static int print_logs_item(struct scoutfs_key *key, void *val,
|
||||
static int print_log_trees_item(struct scoutfs_key *key, void *val,
|
||||
unsigned val_len, void *arg)
|
||||
{
|
||||
struct scoutfs_log_trees_val *ltv = val;
|
||||
struct scoutfs_log_trees *lt = val;
|
||||
|
||||
printf(" rid %llu nr %llu\n",
|
||||
le64_to_cpu(key->sklt_rid), le64_to_cpu(key->sklt_nr));
|
||||
@@ -303,17 +303,21 @@ static int print_log_trees_item(struct scoutfs_key *key, void *val,
|
||||
" bloom_ref: blkno %llu seq %llu\n"
|
||||
" data_avail: "ALCROOT_F"\n"
|
||||
" data_freed: "ALCROOT_F"\n"
|
||||
" srch_file: "SRF_FMT"\n",
|
||||
AL_HEAD_A(<v->meta_avail),
|
||||
AL_HEAD_A(<v->meta_freed),
|
||||
ltv->item_root.height,
|
||||
le64_to_cpu(ltv->item_root.ref.blkno),
|
||||
le64_to_cpu(ltv->item_root.ref.seq),
|
||||
le64_to_cpu(ltv->bloom_ref.blkno),
|
||||
le64_to_cpu(ltv->bloom_ref.seq),
|
||||
ALCROOT_A(<v->data_avail),
|
||||
ALCROOT_A(<v->data_freed),
|
||||
SRF_A(<v->srch_file));
|
||||
" srch_file: "SRF_FMT"\n"
|
||||
" rid: %016llx\n"
|
||||
" nr: %llu\n",
|
||||
AL_HEAD_A(<->meta_avail),
|
||||
AL_HEAD_A(<->meta_freed),
|
||||
lt->item_root.height,
|
||||
le64_to_cpu(lt->item_root.ref.blkno),
|
||||
le64_to_cpu(lt->item_root.ref.seq),
|
||||
le64_to_cpu(lt->bloom_ref.blkno),
|
||||
le64_to_cpu(lt->bloom_ref.seq),
|
||||
ALCROOT_A(<->data_avail),
|
||||
ALCROOT_A(<->data_freed),
|
||||
SRF_A(<->srch_file),
|
||||
le64_to_cpu(lt->rid),
|
||||
le64_to_cpu(lt->nr));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -678,35 +682,35 @@ struct print_recursion_args {
|
||||
static int print_log_trees_roots(struct scoutfs_key *key, void *val,
|
||||
unsigned val_len, void *arg)
|
||||
{
|
||||
struct scoutfs_log_trees_val *ltv = val;
|
||||
struct scoutfs_log_trees *lt = val;
|
||||
struct print_recursion_args *pa = arg;
|
||||
int ret = 0;
|
||||
int err;
|
||||
|
||||
/* XXX doesn't print the bloom block */
|
||||
|
||||
err = print_alloc_list_block(pa->fd, "ltv_meta_avail",
|
||||
<v->meta_avail.ref);
|
||||
err = print_alloc_list_block(pa->fd, "lt_meta_avail",
|
||||
<->meta_avail.ref);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
err = print_alloc_list_block(pa->fd, "ltv_meta_freed",
|
||||
<v->meta_freed.ref);
|
||||
err = print_alloc_list_block(pa->fd, "lt_meta_freed",
|
||||
<->meta_freed.ref);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
err = print_btree(pa->fd, pa->super, "data_avail",
|
||||
<v->data_avail.root, print_alloc_item, NULL);
|
||||
<->data_avail.root, print_alloc_item, NULL);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
err = print_btree(pa->fd, pa->super, "data_freed",
|
||||
<v->data_freed.root, print_alloc_item, NULL);
|
||||
<->data_freed.root, print_alloc_item, NULL);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
err = print_srch_block(pa->fd, <v->srch_file.ref,
|
||||
ltv->srch_file.height - 1);
|
||||
err = print_srch_block(pa->fd, <->srch_file.ref,
|
||||
lt->srch_file.height - 1);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
|
||||
err = print_btree(pa->fd, pa->super, "", <v->item_root,
|
||||
err = print_btree(pa->fd, pa->super, "", <->item_root,
|
||||
print_logs_item, NULL);
|
||||
if (err && !ret)
|
||||
ret = err;
|
||||
|
||||
Reference in New Issue
Block a user