mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-08 21:03:12 +00:00
scoutfs-utils: remove btree item bit augmentation
We no longer need the complexity of augmenting the btree to find items with bits set. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -77,23 +77,6 @@ struct scoutfs_block_header {
|
||||
* generous.
|
||||
*/
|
||||
#define SCOUTFS_BTREE_MAX_HEIGHT 20
|
||||
#define SCOUTFS_BTREE_BITS 8
|
||||
|
||||
/*
|
||||
* Btree items can have bits associated with them. Their parent items
|
||||
* reflect all the bits that their child block contain. Thus searches
|
||||
* can find items with bits set.
|
||||
*
|
||||
* @SCOUTFS_BTREE_BIT_HALF1: Tracks blocks found in the first half of
|
||||
* the ring. It's used to migrate blocks from the old half of the ring
|
||||
* into the current half as blocks are dirtied. It's not found in leaf
|
||||
* items but is calculated based on the block number of referenced
|
||||
* blocks. _HALF2 is identical but for the second half of the ring.
|
||||
*/
|
||||
enum {
|
||||
SCOUTFS_BTREE_BIT_HALF1 = (1 << 0),
|
||||
SCOUTFS_BTREE_BIT_HALF2 = (1 << 1),
|
||||
};
|
||||
|
||||
struct scoutfs_btree_ref {
|
||||
__le64 blkno;
|
||||
@@ -116,7 +99,6 @@ struct scoutfs_btree_root {
|
||||
|
||||
struct scoutfs_btree_item_header {
|
||||
__le16 off;
|
||||
__u8 bits;
|
||||
} __packed;
|
||||
|
||||
struct scoutfs_btree_item {
|
||||
@@ -134,7 +116,6 @@ struct scoutfs_btree_block {
|
||||
__le16 free_end;
|
||||
__le16 free_reclaim;
|
||||
__le16 nr_items;
|
||||
__le16 bit_counts[SCOUTFS_BTREE_BITS];
|
||||
__u8 level;
|
||||
struct scoutfs_btree_item_header item_hdrs[0];
|
||||
} __packed;
|
||||
|
||||
@@ -468,8 +468,7 @@ static int print_btree_block(int fd, struct scoutfs_super_block *super,
|
||||
if (bt->level == level) {
|
||||
printf("%s btree blkno %llu\n"
|
||||
" fsid %llx blkno %llu seq %llu crc %08x \n"
|
||||
" level %u free_end %u free_reclaim %u nr_items %u\n"
|
||||
" bit_counts:",
|
||||
" level %u free_end %u free_reclaim %u nr_items %u\n",
|
||||
which, le64_to_cpu(ref->blkno),
|
||||
le64_to_cpu(bt->fsid),
|
||||
le64_to_cpu(bt->blkno),
|
||||
@@ -479,12 +478,6 @@ static int print_btree_block(int fd, struct scoutfs_super_block *super,
|
||||
le16_to_cpu(bt->free_end),
|
||||
le16_to_cpu(bt->free_reclaim),
|
||||
le16_to_cpu(bt->nr_items));
|
||||
for (i = 0; i < array_size(bt->bit_counts); i++) {
|
||||
if (bt->bit_counts[i])
|
||||
printf(" %u:%u",
|
||||
i, le16_to_cpu(bt->bit_counts[i]));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < le16_to_cpu(bt->nr_items); i++) {
|
||||
@@ -506,9 +499,8 @@ static int print_btree_block(int fd, struct scoutfs_super_block *super,
|
||||
continue;
|
||||
}
|
||||
|
||||
printf(" item [%u] off %u bits %02x key_len %u val_len %u\n",
|
||||
i, le16_to_cpu(bt->item_hdrs[i].off),
|
||||
bt->item_hdrs[i].bits, key_len, val_len);
|
||||
printf(" item [%u] off %u key_len %u val_len %u\n",
|
||||
i, le16_to_cpu(bt->item_hdrs[i].off), key_len, val_len);
|
||||
|
||||
if (level)
|
||||
print_btree_ref(key, key_len, val, val_len, func, arg);
|
||||
|
||||
Reference in New Issue
Block a user