From 9fa1f12caa414c9d396f2ceb54762d3d3a93fc75 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Fri, 18 Mar 2016 10:36:29 +0900 Subject: [PATCH] btrfs-progs: qgroup assign: handle --no-rescan option * actual result ================================================== # btrfs qgroup assign --no-rescan 0/260 1/261 /btrfs btrfs qgroup assign: unrecognized option '--no-rescan' usage: btrfs qgroup assign [options] Assign SRC as the child qgroup of DST --rescan schedule qutoa rescan if needed --no-rescan ================================================== * expected result ================================================== # ./btrfs qgroup assign --no-rescan 0/260 1/261 /btrfs # ================================================== Signed-off-by: Satoru Takeuchi Signed-off-by: David Sterba --- cmds-qgroup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 45075a3b..14418d45 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -44,10 +44,12 @@ static int _cmd_qgroup_assign(int assign, int argc, char **argv, if (assign) { while (1) { - enum { GETOPT_VAL_RESCAN = 256 }; + enum { GETOPT_VAL_RESCAN = 256, GETOPT_VAL_NO_RESCAN }; static const struct option long_options[] = { { "rescan", no_argument, NULL, GETOPT_VAL_RESCAN }, + { "no-rescan", no_argument, NULL, + GETOPT_VAL_NO_RESCAN }, { NULL, 0, NULL, 0 } }; int c = getopt_long(argc, argv, "", long_options, NULL); @@ -58,6 +60,9 @@ static int _cmd_qgroup_assign(int assign, int argc, char **argv, case GETOPT_VAL_RESCAN: rescan = 1; break; + case GETOPT_VAL_NO_RESCAN: + rescan = 0; + break; default: /* Usage printed by the caller */ return -1; @@ -208,7 +213,7 @@ static const char * const cmd_qgroup_assign_usage[] = { "Assign SRC as the child qgroup of DST", "", "--rescan schedule qutoa rescan if needed", - "--no-rescan ", + "--no-rescan don't schedule quota rescan", NULL };