scoutfs-utils: remove btree item owner

We no longer have an owner offset trailing btree item values.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-10-13 11:50:10 -07:00
committed by Zach Brown
parent ea7c41d876
commit 6b1dd980f0
3 changed files with 1 additions and 15 deletions

View File

@@ -59,8 +59,6 @@ void btree_append_item(struct scoutfs_btree_block *bt,
{
struct scoutfs_btree_item *item;
struct scoutfs_avl_node *prev;
__le16 *own_buf;
__le16 own;
void *val_buf;
item = &bt->items[le16_to_cpu(bt->nr_items)];
@@ -86,10 +84,6 @@ void btree_append_item(struct scoutfs_btree_block *bt,
if (val_len == 0)
return;
own_buf = alloc_val(bt, SCOUTFS_BTREE_VAL_OWNER_BYTES);
own = cpu_to_le16((void *)item - (void *)bt);
memcpy(own_buf, &own, sizeof(own));
val_buf = alloc_val(bt, val_len);
item->val_off = cpu_to_le16((void *)val_buf - (void *)bt);
item->val_len = cpu_to_le16(val_len);

View File

@@ -196,9 +196,6 @@ struct scoutfs_avl_node {
/* when we split we want to have multiple items on each side */
#define SCOUTFS_BTREE_MAX_VAL_LEN 896
/* each value ends with an offset which lets compaction iterate over values */
#define SCOUTFS_BTREE_VAL_OWNER_BYTES sizeof(__le16)
/*
* A 4EB test image measured a worst case height of 17. This is plenty
* generous.
@@ -232,8 +229,6 @@ struct scoutfs_btree_block {
__le16 nr_items;
__le16 total_item_bytes;
__le16 mid_free_len;
__le16 last_free_off;
__le16 last_free_len;
__u8 level;
struct scoutfs_btree_item items[0];
/* leaf blocks have a fixed size item offset hash table at the end */

View File

@@ -466,8 +466,7 @@ static int print_btree_block(int fd, struct scoutfs_super_block *super,
if (bt->level == level) {
printf("%s btree blkno %llu\n"
" crc %08x fsid %llx seq %llu blkno %llu \n"
" total_item_bytes %u mid_free_len %u last_free_off %u "
"last_free_len %u\n"
" total_item_bytes %u mid_free_len %u\n"
" level %u nr_items %u item_root.node %u\n",
which, le64_to_cpu(ref->blkno),
le32_to_cpu(bt->hdr.crc),
@@ -476,8 +475,6 @@ static int print_btree_block(int fd, struct scoutfs_super_block *super,
le64_to_cpu(bt->hdr.blkno),
le16_to_cpu(bt->total_item_bytes),
le16_to_cpu(bt->mid_free_len),
le16_to_cpu(bt->last_free_off),
le16_to_cpu(bt->last_free_len),
bt->level,
le16_to_cpu(bt->nr_items),
le16_to_cpu(bt->item_root.node));