diff mbox

[3/3] btrfs-progs: fix option handling for some commands

Message ID e0101e20-6536-9b84-2808-242408af3e0f@jp.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Misono Tomohiro Aug. 24, 2017, 5:25 a.m. UTC
This fixes "btrfs inspect-internal dump-super --bytenr"

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
  cmds-inspect-dump-super.c | 7 +++++++
  1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c
index 98e0270..c7afd80 100644
--- a/cmds-inspect-dump-super.c
+++ b/cmds-inspect-dump-super.c
@@ -519,11 +519,13 @@  int cmd_inspect_dump_super(int argc, char **argv)

  	while (1) {
  		int c;
+		enum { GETOPT_VAL_BYTENR = 257 };
  		static const struct option long_options[] = {
  			{"all", no_argument, NULL, 'a'},
  			{"full", no_argument, NULL, 'f'},
  			{"force", no_argument, NULL, 'F'},
  			{"super", required_argument, NULL, 's' },
+			{"bytenr", required_argument, NULL, GETOPT_VAL_BYTENR },
  			{NULL, 0, NULL, 0}
  		};

@@ -565,6 +567,11 @@  int cmd_inspect_dump_super(int argc, char **argv)
  			}
  			all = 0;
  			break;
+		case GETOPT_VAL_BYTENR:
+			arg = arg_strtou64(optarg);
+			sb_bytenr = arg;
+			all = 0;
+			break;
  		default:
  			usage(cmd_inspect_dump_super_usage);
  		}