scoutfs-utils: update btree constants

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-04-13 08:59:06 -07:00
committed by Zach Brown
parent 8e6c18a0fa
commit f275020baa
+11 -9
View File
@@ -121,15 +121,9 @@ struct scoutfs_key_be {
__u8 _sk_fourth;
}__packed;
/*
* Assert that we'll be able to represent all possible keys with 8 64bit
* primary sort values.
*/
#define SCOUTFS_BTREE_GREATEST_KEY_LEN 32
/* level >0 segments can have a full key and some metadata */
#define SCOUTFS_BTREE_MAX_KEY_LEN 320
/* level 0 segments can have two full keys in the value :/ */
#define SCOUTFS_BTREE_MAX_VAL_LEN 768
/* chose reasonable max key and value lens that have room for some u64s */
#define SCOUTFS_BTREE_MAX_KEY_LEN 40
#define SCOUTFS_BTREE_MAX_VAL_LEN 64
/*
* The min number of free bytes we must leave in a parent as we descend
@@ -143,6 +137,14 @@ struct scoutfs_key_be {
sizeof(struct scoutfs_btree_item) + SCOUTFS_BTREE_MAX_KEY_LEN +\
sizeof(struct scoutfs_btree_ref))
/*
* When debugging we can tune the splitting and merging thresholds to
* create much larger trees by having blocks with many fewer items. We
* implement this by pretending the blocks are tiny. They're still
* large enough for a handful of items.
*/
#define SCOUTFS_BTREE_TINY_BLOCK_SIZE 512
/*
* A 4EB test image measured a worst case height of 17. This is plenty
* generous.