diff --git a/Documentation/btrfs-quota.rst b/Documentation/btrfs-quota.rst index 8e7be90d..5cadf6f8 100644 --- a/Documentation/btrfs-quota.rst +++ b/Documentation/btrfs-quota.rst @@ -52,9 +52,9 @@ rescan [-s] ``Options`` - -s + -s|--status show status of a running rescan operation. - -w + -w|--wait wait for rescan operation to finish(can be already in progress). EXIT STATUS diff --git a/cmds/quota.c b/cmds/quota.c index 5f2836c3..9e26d2cb 100644 --- a/cmds/quota.c +++ b/cmds/quota.c @@ -109,8 +109,8 @@ static const char * const cmd_quota_rescan_usage[] = { "btrfs quota rescan [-sw] ", "Trash all qgroup numbers and scan the metadata again with the current config.", "", - "-s show status of a running rescan operation", - "-w wait for rescan operation to finish (can be already in progress)", + "-s|--status show status of a running rescan operation", + "-w|--wait wait for rescan operation to finish (can be already in progress)", HELPINFO_INSERT_GLOBALS, HELPINFO_INSERT_QUIET, NULL @@ -129,9 +129,17 @@ static int cmd_quota_rescan(const struct cmd_struct *cmd, int argc, char **argv) optind = 0; while (1) { - int c = getopt(argc, argv, "sw"); + static const struct option long_options[] = { + {"status", no_argument, NULL, 's'}, + {"wait", no_argument, NULL, 'w'}, + {NULL, 0, NULL, 0} + }; + int c; + + c = getopt_long(argc, argv, "sw", long_options, NULL); if (c < 0) break; + switch (c) { case 's': ioctlnum = BTRFS_IOC_QUOTA_RESCAN_STATUS;