[PATCH 5/5] btrfs-progs: qgroup assign can't handle --no-rescan option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* actual result

  ==================================================
  # btrfs qgroup assign --no-rescan 0/260 1/261 /btrfs
  btrfs qgroup assign: unrecognized option '--no-rescan'
  usage: btrfs qgroup assign [options] <src> <dst> <path>

      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 <takeuchi_satoru@xxxxxxxxxxxxxx>
---
 cmds-qgroup.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index ebd66ef..4b4149d 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -44,9 +44,13 @@ 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 = 257,
+			};
 			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);
@@ -57,6 +61,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(usage_str);
 			}
@@ -206,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
 };

--
2.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux