diff options
author | Anand Jain <anand.jain@oracle.com> | 2012-08-14 14:04:06 +0800 |
---|---|---|
committer | root <root@localhost.localdomain> | 2012-10-04 16:26:32 -0400 |
commit | 8a25bb834b218068dec79983fdfc76ef4f8e605f (patch) | |
tree | 2a68d58828b42d1f15a9b0bd2f00998d370fefb5 /cmds-subvolume.c | |
parent | 2e6bcfac11542a1da015e19efc5f120f71ce411c (diff) |
Btrfs-progs: add -u to show subvol uuid
Applications would need to know the uuid to manage the configurations
associated with the subvol and snapshots
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 8a81d36e..aaf5dde5 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -31,7 +31,7 @@ #include "commands.h" /* btrfs-list.c */ -int list_subvols(int fd, int print_parent, int get_default); +int list_subvols(int fd, int print_parent, int print_uuid, int get_default); int find_updated_files(int fd, u64 root_id, u64 oldest_gen); static const char * const subvolume_cmd_group_usage[] = { @@ -278,10 +278,11 @@ static int cmd_subvol_list(int argc, char **argv) int print_snap_only = 0; int order = 0; char *subvol; + int print_uuid = 0; optind = 1; while(1) { - int c = getopt(argc, argv, "ps:"); + int c = getopt(argc, argv, "ps:u"); if (c < 0) break; @@ -293,6 +294,9 @@ static int cmd_subvol_list(int argc, char **argv) print_snap_only = 1; order = atoi(optarg); break; + case 'u': + print_uuid =1; + break; default: usage(cmd_subvol_list_usage); } @@ -319,9 +323,9 @@ static int cmd_subvol_list(int argc, char **argv) return 12; } if (!print_snap_only) - ret = list_subvols(fd, print_parent, 0); + ret = list_subvols(fd, print_parent, 0, print_uuid); else - ret = list_snapshots(fd, print_parent, order); + ret = list_snapshots(fd, print_parent, order, print_uuid); if (ret) return 19; return 0; @@ -502,7 +506,7 @@ static int cmd_subvol_get_default(int argc, char **argv) fprintf(stderr, "ERROR: can't access '%s'\n", subvol); return 12; } - ret = list_subvols(fd, 0, 1); + ret = list_subvols(fd, 0, 1, 0); if (ret) return 19; return 0; |