}
static const char * const cmd_subvol_list_usage[] = {
- "btrfs subvolume list [-apurts] [-g [+|-]value] [-c [+|-]value] "
+ "btrfs subvolume list [-aopurts] [-g [+|-]value] [-c [+|-]value] "
"[--sort=gen,ogen,rootid,path] <path>",
"List subvolumes (and snapshots)",
"",
"-a print all the subvolumes in the filesystem and",
" distinguish absolute and relative path with respect",
" to the given <path>",
+ "-o print only subvolumes bellow specified path",
"-u print the uuid of subvolumes (and snapshots)",
"-t print the result as a table",
"-s list snapshots only in the filesystem",
char *subvol;
int is_tab_result = 0;
int is_list_all = 0;
+ int is_only_in_path = 1;
struct option long_options[] = {
{"sort", 1, NULL, 'S'},
{0, 0, 0, 0}
optind = 1;
while(1) {
c = getopt_long(argc, argv,
- "apsurg:c:t", long_options, NULL);
+ "aopsurg:c:t", long_options, NULL);
if (c < 0)
break;
case 'a':
is_list_all = 1;
break;
+ case 'o':
+ is_only_in_path = 1;
+ break;
case 't':
is_tab_result = 1;
break;
btrfs_list_setup_filter(&filter_set,
BTRFS_LIST_FILTER_FULL_PATH,
top_id);
- else
+ else if (is_only_in_path)
btrfs_list_setup_filter(&filter_set,
BTRFS_LIST_FILTER_TOPID_EQUAL,
top_id);
.PP
\fBbtrfs\fP \fBsubvolume create\fP\fI [<dest>/]<name>\fP
.PP
-\fBbtrfs\fP \fBsubvolume list\fP\fI [-aprts] [-g [+|-]value] [-c [+|-]value] [--rootid=rootid,gen,ogen,path] <path>\fP
+\fBbtrfs\fP \fBsubvolume list\fP\fI [-aoprts] [-g [+|-]value] [-c [+|-]value] [--rootid=rootid,gen,ogen,path] <path>\fP
.PP
\fBbtrfs\fP \fBsubvolume set-default\fP\fI <id> <path>\fP
.PP
\fI<dest>\fR is omitted).
.TP
-\fBsubvolume list\fR\fI [-aprts][-g [+|-]value] [-c [+|-]value] [--sort=gen,ogen,rootid,path] <path>\fR
+\fBsubvolume list\fR\fI [-aoprts][-g [+|-]value] [-c [+|-]value] [--sort=gen,ogen,rootid,path] <path>\fR
.RS
List the subvolumes present in the filesystem \fI<path>\fR. For every
subvolume the following information is shown by default.
\fB-a\fP print all the subvolumes in the filesystem and distinguish between
absolute and relative path with respect to the given <path>.
+\fB-o\fP print only subvolumes bellow specified <path>.
+
\fB-r\fP only readonly subvolumes in the filesystem wille be listed.
\fB-s\fP only snapshot subvolumes in the filesystem will be listed.