common/btrfs: refactor _require_btrfs_corrupt_block to check option

The -v and -o short options in btrfs-corrupt-block were introduced and
replaced with the long options --value and --offset in the same
btrfs-progs release 5.19 by the following commits:

  b2ada0594116 ("btrfs-progs: corrupt-block: corrupt generic item data")
  22ffee3c6cf2 ("btrfs-progs: corrupt-block: use only long options for value and offset")

We hope that if these commits are backported, they are both backported at
the same time.

Use only the long options of btrfs-corrupt-block in the test cases. Also,
check if btrfs-corrupt-block has the options --value and --offset.

[zlang: use -w option for grep, and remove "ret" local value]

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
1 file changed