btrfs-progs: corrupt-block: Fix -D option
commit6fc1edc4c03fd4e9dc3e6cb6b025ab10bb933198
authorNikolay Borisov <nborisov@suse.com>
Mon, 14 May 2018 11:13:34 +0000 (14 14:13 +0300)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jun 2018 14:37:39 +0000 (7 16:37 +0200)
treed73c6c958247461e820ff3efed3f27ef005bf38b
parentf1404df7d1fe6193ec9e9901db4b4c3645781fdc
btrfs-progs: corrupt-block: Fix -D option

Currently the -D option is essentially defunct since it's the root,
where we are going to corrupt a dir item is always set to the tree
root. Fix this by passing the root from the "-r" option. Aditionally
convert the interface for this option to the new format. So if one
wants to corrupt a dir item in the default fs tree, they should now
invoke:

 btrfs-corrupt-block -r 5 -D <objectid,DIR_ITEM,offset> -f name

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-corrupt-block.c