mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-09 00:00:17 +03:00
bcacheadm: fix variable bucket size input
If the user added n caches but <n bucket_sizes, print a message saying that cache# will be using the default bucket_size Change-Id: I025474ca672bf79d1c88813e6f030ba7590e820d Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
parent
d7d289efaf
commit
cbf0900b35
14
bcache.c
14
bcache.c
@ -582,10 +582,18 @@ void write_cache_sbs(int *fds, struct cache_sb *sb,
|
||||
for (i = 0; i < sb->nr_in_set; i++) {
|
||||
struct cache_member *m = sb->members + i;
|
||||
|
||||
if (num_bucket_sizes <= 1)
|
||||
if (num_bucket_sizes <= 1) {
|
||||
sb->bucket_size = bucket_sizes[0];
|
||||
else
|
||||
sb->bucket_size = bucket_sizes[i];
|
||||
} else {
|
||||
if (!bucket_sizes[i]) {
|
||||
printf("No bucket size specified for cache %d,"
|
||||
" using the default of %d",
|
||||
i, bucket_sizes[0]);
|
||||
sb->bucket_size = bucket_sizes[0];
|
||||
} else {
|
||||
sb->bucket_size = bucket_sizes[i];
|
||||
}
|
||||
}
|
||||
SET_CACHE_BTREE_NODE_SIZE(sb, min_size);
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user