u64 source_dir_size = 0;
int dev_cnt = 0;
int saved_optind;
- char estr[100];
char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = { 0 };
u64 features = BTRFS_MKFS_DEFAULT_FEATURES;
struct mkfs_allocation allocation = { 0 };
}
}
ret = test_num_disk_vs_raid(metadata_profile, data_profile,
- dev_cnt, mixed, estr);
- if (ret) {
- fprintf(stderr, "Error: %s\n", estr);
+ dev_cnt, mixed);
+ if (ret)
exit(1);
- }
/* if we are here that means all devs are good to btrfsify */
if (verbose) {
}
int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
- u64 dev_cnt, int mixed, char *estr)
+ u64 dev_cnt, int mixed)
{
- size_t sz = 100;
u64 allowed = 0;
switch (dev_cnt) {
if (dev_cnt > 1 &&
((metadata_profile | data_profile) & BTRFS_BLOCK_GROUP_DUP)) {
- snprintf(estr, sz,
- "DUP is not allowed when FS has multiple devices\n");
+ fprintf(stderr,
+ "ERROR: DUP is not allowed when FS has multiple devices\n");
return 1;
}
if (metadata_profile & ~allowed) {
- snprintf(estr, sz,
- "unable to create FS with metadata profile %s "
+ fprintf(stderr,
+ "ERROR: unable to create FS with metadata profile %s "
"(have %llu devices but %d devices are required)\n",
btrfs_group_profile_str(metadata_profile), dev_cnt,
group_profile_devs_min(metadata_profile));
return 1;
}
if (data_profile & ~allowed) {
- snprintf(estr, sz,
- "unable to create FS with data profile %s "
+ fprintf(stderr,
+ "ERROR: unable to create FS with data profile %s "
"(have %llu devices but %d devices are required)\n",
btrfs_group_profile_str(data_profile), dev_cnt,
group_profile_devs_min(data_profile));
}
if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) {
- snprintf(estr, sz,
- "dup for data is allowed only in mixed mode");
+ fprintf(stderr,
+ "ERROR: DUP for data is allowed only in mixed mode");
return 1;
}
return 0;
int test_dev_for_mkfs(char *file, int force_overwrite);
int get_label_mounted(const char *mount_path, char *labelp);
int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
- u64 dev_cnt, int mixed, char *estr);
+ u64 dev_cnt, int mixed);
int group_profile_max_safe_loss(u64 flags);
int is_vol_small(char *file);
int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,