x('g', group, "label", "Disk group")\
x(0, discard, NULL, NULL) \
x(0, data_allowed, "journal,btree,data", "Allowed types of data on this device")\
+x(0, durability, "#", "Number of times data written to this device will have been considered replicated")\
t("Device specific options must come before corresponding devices, e.g.") \
t(" bcachefs format --group cache /dev/sdb --tier 1 /dev/sdc") \
t("") \
" --fs_size=size Size of filesystem on device\n"
" --bucket=size Bucket size\n"
" --discard Enable discards\n"
+ " --durability=# Device durability (0-4)\n"
" -g, --group=label Disk group\n"
"\n"
" -q, --quiet Only print errors\n"
read_flag_list_or_die(optarg,
bch2_data_types, "data type");
break;
+ case O_durability:
+ if (kstrtouint(optarg, 10, &dev_opts.durability) ||
+ dev_opts.durability > BCH_REPLICAS_MAX)
+ die("invalid durability");
+ break;
case O_no_opt:
dev_opts.path = strdup(optarg);
darray_append(devices, dev_opts);
SET_BCH_MEMBER_REPLACEMENT(m, CACHE_REPLACEMENT_LRU);
SET_BCH_MEMBER_DISCARD(m, i->discard);
SET_BCH_MEMBER_DATA_ALLOWED(m, i->data_allowed);
+ SET_BCH_MEMBER_DURABILITY(m, i->durability + 1);
}
/* Disk groups */