btrfs-progs: mkfs: clear whole mkfs_cfg at once

Zero out the structure and set only the requested fields.

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2017-02-01 14:15:08 +01:00
parent 2920c8d526
commit e945e27712
1 changed files with 1 additions and 3 deletions

View File

@ -1216,15 +1216,13 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
printf("\tnodesize: %u\n", nodesize);
printf("\tfeatures: %s\n", features_buf);
memset(&mkfs_cfg, 0, sizeof(mkfs_cfg));
mkfs_cfg.label = cctx.volume_name;
mkfs_cfg.num_bytes = total_bytes;
mkfs_cfg.nodesize = nodesize;
mkfs_cfg.sectorsize = blocksize;
mkfs_cfg.stripesize = blocksize;
mkfs_cfg.features = features;
/* New convert need these space */
memset(mkfs_cfg.chunk_uuid, 0, BTRFS_UUID_UNPARSED_SIZE);
memset(mkfs_cfg.fs_uuid, 0, BTRFS_UUID_UNPARSED_SIZE);
ret = make_convert_btrfs(fd, &mkfs_cfg, &cctx);
if (ret) {