btrfs-progs: btrfstune: rework change_uuid
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 15 May 2015 06:28:23 +0000 (14:28 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 26 May 2015 14:48:16 +0000 (16:48 +0200)
commite737a9d56b2cec644f1462bf540cb78f858d146d
tree6e4ea10643f98557801ac46d063303746c84618d
parentaf3b243358d3d352f59b4bcc38b695d5b4aa2644
btrfs-progs: btrfstune: rework change_uuid

Change the change_uuid():
1) Remove new_chunk_tree_uuid parameter
   As chunk_tree_uuid is only internal used, no need to manual specify it.
   Use random generated UUID instead.

2) Don't use heap allocated memory for fs_info->new_fsid/chunk_tree_id.
   It's easy to forgot free or double free heap memory.
   Use stack memory instead.
   (In fact, I forgot to free them in previous patchset)

3) Print destination fsid.
   As now it's possible to change fsid to random uuid, it's better to print
   it out.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfstune.c