mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-03-10 00:00:04 +03:00
bcacheadm: increase btree node size for large buckets
buckets over 512k were causing deadlocks when the btree node size was smaller than the bucket size. Change-Id: Icb278d75c241e9643ab1355620e3d656df52c4ee Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
parent
f8d3f7da8f
commit
6257974a5a
13
bcache.c
13
bcache.c
@ -559,16 +559,6 @@ static unsigned min_bucket_size(int num_bucket_sizes, unsigned *bucket_sizes)
|
|||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned node_size(unsigned bucket_size) {
|
|
||||||
|
|
||||||
if (bucket_size <= 256)
|
|
||||||
return bucket_size;
|
|
||||||
else if (bucket_size <= 512)
|
|
||||||
return bucket_size / 2;
|
|
||||||
else
|
|
||||||
return bucket_size / 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_cache_sbs(int *fds, struct cache_sb *sb,
|
void write_cache_sbs(int *fds, struct cache_sb *sb,
|
||||||
unsigned block_size, unsigned *bucket_sizes,
|
unsigned block_size, unsigned *bucket_sizes,
|
||||||
int num_bucket_sizes)
|
int num_bucket_sizes)
|
||||||
@ -596,7 +586,8 @@ void write_cache_sbs(int *fds, struct cache_sb *sb,
|
|||||||
sb->bucket_size = bucket_sizes[0];
|
sb->bucket_size = bucket_sizes[0];
|
||||||
else
|
else
|
||||||
sb->bucket_size = bucket_sizes[i];
|
sb->bucket_size = bucket_sizes[i];
|
||||||
SET_CACHE_BTREE_NODE_SIZE(sb, node_size(min_size));
|
SET_CACHE_BTREE_NODE_SIZE(sb, min_size);
|
||||||
|
|
||||||
|
|
||||||
sb->uuid = m->uuid;
|
sb->uuid = m->uuid;
|
||||||
sb->nbuckets = getblocks(fds[i]) / sb->bucket_size;
|
sb->nbuckets = getblocks(fds[i]) / sb->bucket_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user