Skip to contentSkip to conversation

btrfs-progs: add quota-related info to usage messages

PATCH In review Koen De Wit 2 participants 2 messages Mar 27, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: add quota-related info to usage messages

Extending usage messages with some info on the quota functionality:
- The -i option of "subvol create" and "subvol snapshot" was not
documented
- The -c option of "qgroup limit" is the default option
- The "qouta rescan" command is not yet implemented, while it should be executed after enabling quota on a non-empty filesystem.

---
 cmds-qgroup.c    |    3 ++-
 cmds-quota.c     |    4 ++++
 cmds-subvolume.c |   11 ++++++++---
 3 files changed, 14 insertions(+), 4 deletions(-)
cmds-qgroup.c +2 -1
index 275f00f..95aca9b 100644
@@ -326,7 +326,8 @@ static const char * const cmd_qgroup_limit_usage[] = {
     "btrfs qgroup limit [options] <size>|none [<qgroupid>] <path>",
     "Limit the size of a subvolume quota group.",
     "",
-    "-c   limit amount of data after compression",
+    "-c   limit amount of data after compression. This is the default,",
+    "     it is currently not possible to turn off this option.",
     "-e   limit space exclusively assigned to this qgroup",
     NULL
 };
cmds-quota.c +4 -0
index 8481514..71cd9f1 100644
@@ -64,6 +64,9 @@ int quota_ctl(int cmd, int argc, char **argv)
 static const char * const cmd_quota_enable_usage[] = {
     "btrfs quota enable <path>",
     "Enable subvolume quota support for a filesystem.",
+    "Any data already present on the filesystem will not count towards",
+    "the space usage numbers. It is recommended to enable quota for a",
+    "filesystem before writing any data to it.",
     NULL
 };
 
@@ -92,6 +95,7 @@ static int cmd_quota_disable(int argc, char **argv)
 static const char * const cmd_quota_rescan_usage[] = {
     "btrfs quota rescan <path>",
     "Rescan the subvolume for a changed quota setting.",
+    "Not yet implemented.",
     NULL
 };
 
cmds-subvolume.c +8 -3
index 74e2130..b762470 100644
@@ -61,10 +61,13 @@ static int test_isdir(char *path)
 }
 
 static const char * const cmd_subvol_create_usage[] = {
-    "btrfs subvolume create [<dest>/]<name>",
+    "btrfs subvolume create [-i <qgroupid>] [<dest>/]<name>",
     "Create a subvolume",
     "Create a subvolume <name> in <dest>.  If <dest> is not given",
     "subvolume <name> will be created in the current directory.",
+    "",
+    "-i <qgroupid>  add the newly created subvolume to a qgroup. This",
+    "               option can be given multiple times.",
     NULL
 };
 
@@ -480,12 +483,14 @@ out:
 }
 
 static const char * const cmd_snapshot_usage[] = {
-    "btrfs subvolume snapshot [-r] <source> [<dest>/]<name>",
+    "btrfs subvolume snapshot [-r] [-i <qgroupid>] <source> [<dest>/]<name>",
     "Create a snapshot of the subvolume",
     "Create a writable/readonly snapshot of the subvolume <source> with",
     "the name <name> in the <dest> directory",
     "",
-    "-r     create a readonly snapshot",
+    "-r             create a readonly snapshot",
+    "-i <qgroupid>  add the newly created snapshot to a qgroup. This",
+    "               option can be given multiple times.",
     NULL
 };
 
Signature · 1 line
1.7.2.5
#1 lore raw

Hello,

Quoted 7 lines

Extending usage messages with some info on the quota functionality:
- The -i option of "subvol create" and "subvol snapshot" was not documented
- The -c option of "qgroup limit" is the default option
- The "qouta rescan" command is not yet implemented, while it should be executed after enabling quota on a non-empty filesystem.

These usage mesaages are really helpful now for users to try btrfs quota.

David, would you please pull this patch.

Thanks,
Wang

Quoted 85 lines

---

cmds-qgroup.c    |    3 ++-
cmds-quota.c     |    4 ++++
cmds-subvolume.c |   11 ++++++++---
3 files changed, 14 insertions(+), 4 deletions(-)
cmds-qgroup.c +2 -1
index 275f00f..95aca9b 100644
@@ -326,7 +326,8 @@ static const char * const cmd_qgroup_limit_usage[] = {
    "btrfs qgroup limit [options] <size>|none [<qgroupid>] <path>",
    "Limit the size of a subvolume quota group.",
    "",
-    "-c   limit amount of data after compression",
+    "-c   limit amount of data after compression. This is the default,",
+    "     it is currently not possible to turn off this option.",
    "-e   limit space exclusively assigned to this qgroup",
    NULL
 };
cmds-quota.c +4 -0
index 8481514..71cd9f1 100644
@@ -64,6 +64,9 @@ int quota_ctl(int cmd, int argc, char **argv)
 static const char * const cmd_quota_enable_usage[] = {
    "btrfs quota enable <path>",
    "Enable subvolume quota support for a filesystem.",
+    "Any data already present on the filesystem will not count towards",
+    "the space usage numbers. It is recommended to enable quota for a",
+    "filesystem before writing any data to it.",
    NULL
 };
 
@@ -92,6 +95,7 @@ static int cmd_quota_disable(int argc, char **argv)
 static const char * const cmd_quota_rescan_usage[] = {
    "btrfs quota rescan <path>",
    "Rescan the subvolume for a changed quota setting.",
+    "Not yet implemented.",
    NULL
 };
 
cmds-subvolume.c +8 -3
index 74e2130..b762470 100644
@@ -61,10 +61,13 @@ static int test_isdir(char *path)
 }
 
 static const char * const cmd_subvol_create_usage[] = {
-    "btrfs subvolume create [<dest>/]<name>",
+    "btrfs subvolume create [-i <qgroupid>] [<dest>/]<name>",
    "Create a subvolume",
    "Create a subvolume <name> in <dest>.  If <dest> is not given",
    "subvolume <name> will be created in the current directory.",
+    "",
+    "-i <qgroupid>  add the newly created subvolume to a qgroup. This",
+    "               option can be given multiple times.",
    NULL
 };
 
@@ -480,12 +483,14 @@ out:
 }
 
 static const char * const cmd_snapshot_usage[] = {
-    "btrfs subvolume snapshot [-r] <source> [<dest>/]<name>",
+    "btrfs subvolume snapshot [-r] [-i <qgroupid>] <source> [<dest>/]<name>",
    "Create a snapshot of the subvolume",
    "Create a writable/readonly snapshot of the subvolume <source> with",
    "the name <name> in the <dest> directory",
    "",
-    "-r     create a readonly snapshot",
+    "-r             create a readonly snapshot",
+    "-i <qgroupid>  add the newly created snapshot to a qgroup. This",
+    "               option can be given multiple times.",
    NULL
 };
 
Signature · 6 lines
1.7.2.5

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