diff options
author | Jacob Malevich <jam@daterainc.com> | 2015-01-06 11:10:20 -0800 |
---|---|---|
committer | Jacob Malevich <jam@daterainc.com> | 2015-01-06 11:10:20 -0800 |
commit | 6257974a5ab20616ebf663270774e0b56fc6a6fc (patch) | |
tree | 1807bd27975234c9096cff5387caaf48bdf28fdf | |
parent | f8d3f7da8f3ca64480b3b11c5dc80e91c544ed58 (diff) |
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>
-rw-r--r-- | bcache.c | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -559,16 +559,6 @@ static unsigned min_bucket_size(int num_bucket_sizes, unsigned *bucket_sizes) 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, unsigned block_size, unsigned *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]; else 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->nbuckets = getblocks(fds[i]) / sb->bucket_size; |