From 6b1dd980f07a4a1169a99779e0e65b3bf148982c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 13 Oct 2020 11:50:10 -0700 Subject: [PATCH] scoutfs-utils: remove btree item owner We no longer have an owner offset trailing btree item values. Signed-off-by: Zach Brown --- utils/src/btree.c | 6 ------ utils/src/format.h | 5 ----- utils/src/print.c | 5 +---- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/utils/src/btree.c b/utils/src/btree.c index 5cec36bb..4008af63 100644 --- a/utils/src/btree.c +++ b/utils/src/btree.c @@ -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); diff --git a/utils/src/format.h b/utils/src/format.h index 34ebed1a..0ccf78ca 100644 --- a/utils/src/format.h +++ b/utils/src/format.h @@ -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 */ diff --git a/utils/src/print.c b/utils/src/print.c index c8009cd0..077a7db7 100644 --- a/utils/src/print.c +++ b/utils/src/print.c @@ -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));