btrfs-progs: cmds: subvolume: add -p option on creating subvol
Subsystems (2)
PATCH v4 1/1 btrfs-progs: cmds: subvolume: add -p option on creating subvol
This patch resolves github issue #429. Add an option that create parent directories when it creates subvolumes on nonexisting parents. This option tokenizes dstdir and checks each paths whether it's existing directory and make directory for creating subvolume.
Signed-off-by Sidong Yang <[email protected]>
---
v2: fixed the case using realpath() that path nonexists, added description on docs.
v3: added longopt, used strncpy_null than strcpy, use perm 0777
v4: removed trailing whitespace, fix doc and comment.
--- Documentation/btrfs-subvolume.rst | 5 +++- cmds/subvolume.c | 43 +++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-)
Documentation/btrfs-subvolume.rst +4 -1
@@ -49,7 +49,7 @@ do not affect the files in the original subvolume. SUBCOMMAND ----------- -create [-i <qgroupid>] [<dest>/]<name> +create [-i <qgroupid>] [-p|--parents] [<dest>/]<name> Create a subvolume *name* in *dest*. If *dest* is not given, subvolume *name* will be created in the current
@@ -61,6 +61,9 @@ create [-i <qgroupid>] [<dest>/]<name> Add the newly created subvolume to a qgroup. This option can be given multiple times. + -p|--parents + Make any missing parent directories for each argument. + delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid> <path> Delete the subvolume(s) from the filesystem.
cmds/subvolume.c +41 -2
76 lines not on this page · raw message
Signature · 1 line
2.25.1