int mixed = 0;
int data_profile_opt = 0;
int metadata_profile_opt = 0;
- int nodiscard = 0;
+ int discard = 1;
int ssd = 0;
int force_overwrite = 0;
source_dir_set = 1;
break;
case 'K':
- nodiscard=1;
+ discard = 0;
break;
default:
print_usage();
}
first_file = file;
ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
- block_count, &mixed, nodiscard);
+ block_count, &mixed, discard);
if (block_count && block_count > dev_block_count) {
fprintf(stderr, "%s is smaller than requested size\n", file);
exit(1);
continue;
}
ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
- block_count, &mixed, nodiscard);
+ block_count, &mixed, discard);
mixed = old_mixed;
BUG_ON(ret);
}
int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
- u64 max_block_count, int *mixed, int nodiscard)
+ u64 max_block_count, int *mixed, int discard)
{
u64 block_count;
u64 bytenr;
*mixed = 1;
}
- if (!nodiscard) {
+ if (discard) {
/*
* We intentionally ignore errors from the discard ioctl. It is
* not necessary for the mkfs functionality but just an optimization.
int btrfs_make_root_dir(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 objectid);
int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
- u64 max_block_count, int *mixed, int nodiscard);
+ u64 max_block_count, int *mixed, int discard);
int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int fd, char *path,
u64 block_count, u32 io_width, u32 io_align,