mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-03-10 00:00:04 +03:00
bcache-tools: update for superblock changes
Change-Id: I660fef1366005377041cac5d75771d2fdc8c0824
This commit is contained in:
parent
eb1d49d3f1
commit
7ae2165053
2
bcache.c
2
bcache.c
@ -891,8 +891,6 @@ void show_super_cache(struct cache_sb *sb, bool force_csum)
|
||||
printf("cache.tier\t%llu\n", CACHE_TIER(m));
|
||||
|
||||
printf("cache.replication_set\t%llu\n", CACHE_REPLICATION_SET(m));
|
||||
printf("cache.cur_meta_replicas\t%llu\n", REPLICATION_SET_CUR_META_REPLICAS(m));
|
||||
printf("cache.cur_data_replicas\t%llu\n", REPLICATION_SET_CUR_DATA_REPLICAS(m));
|
||||
|
||||
printf("cache.has_metadata\t%llu\n", CACHE_HAS_METADATA(m));
|
||||
printf("cache.has_data\t%llu\n", CACHE_HAS_DATA(m));
|
||||
|
27
bcacheadm.c
27
bcacheadm.c
@ -301,6 +301,7 @@ static NihOption options[] = {
|
||||
int make_bcache(NihCommand *command, char *const *args)
|
||||
{
|
||||
int cache_dev_fd[devs];
|
||||
int data_replicas_num, metadata_replicas_num;
|
||||
|
||||
int backing_dev_fd[devs];
|
||||
|
||||
@ -332,23 +333,33 @@ int make_bcache(NihCommand *command, char *const *args)
|
||||
}
|
||||
|
||||
if (metadata_replicas) {
|
||||
SET_CACHE_SET_META_REPLICAS_WANT(cache_set_sb,
|
||||
strtoul_or_die(metadata_replicas,
|
||||
CACHE_SET_META_REPLICAS_WANT_MAX,
|
||||
"meta replicas"));
|
||||
metadata_replicas_num =
|
||||
strtoul_or_die(metadata_replicas,
|
||||
CACHE_SET_META_REPLICAS_WANT_MAX,
|
||||
"meta replicas");
|
||||
} else {
|
||||
SET_CACHE_SET_META_REPLICAS_WANT(cache_set_sb, 1);
|
||||
metadata_replicas_num = 1;
|
||||
}
|
||||
|
||||
SET_CACHE_SET_META_REPLICAS_WANT(cache_set_sb,
|
||||
metadata_replicas_num);
|
||||
SET_CACHE_SET_META_REPLICAS_HAVE(cache_set_sb,
|
||||
metadata_replicas_num);
|
||||
|
||||
if (data_replicas) {
|
||||
SET_CACHE_SET_DATA_REPLICAS_WANT(cache_set_sb,
|
||||
data_replicas_num =
|
||||
strtoul_or_die(data_replicas,
|
||||
CACHE_SET_DATA_REPLICAS_WANT_MAX,
|
||||
"data replicas"));
|
||||
"data replicas");
|
||||
} else {
|
||||
SET_CACHE_SET_DATA_REPLICAS_WANT(cache_set_sb, 1);
|
||||
data_replicas_num = 1;
|
||||
}
|
||||
|
||||
SET_CACHE_SET_DATA_REPLICAS_WANT(cache_set_sb,
|
||||
data_replicas_num);
|
||||
SET_CACHE_SET_DATA_REPLICAS_HAVE(cache_set_sb,
|
||||
data_replicas_num);
|
||||
|
||||
if (bdev == -1) {
|
||||
fprintf(stderr, "Please specify -C or -B\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
Loading…
Reference in New Issue
Block a user