diff options
author | Josef Bacik <josef@redhat.com> | 2012-04-25 14:22:32 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-07-03 16:27:46 -0400 |
commit | 3f388b9690a3040139f4f899118e0701073de0c7 (patch) | |
tree | f0c99470ba7fe50bdff401445fae8b1634356b30 /cmds-filesystem.c | |
parent | 8ad8e789fc03423a9f1d33051b592419399184bb (diff) |
Btrfs-progs: make btrfs filesystem show <uuid> actually work
The btrfs filesystem show command is only actually searching for labels,
it's not searching for UUID's at all. This patch fixes that problem.
Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r-- | cmds-filesystem.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c index ea9e7886..87f0717e 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -155,8 +155,15 @@ static int cmd_df(int argc, char **argv) static int uuid_search(struct btrfs_fs_devices *fs_devices, char *search) { + char uuidbuf[37]; struct list_head *cur; struct btrfs_device *device; + int search_len = strlen(search); + + search_len = min(search_len, 37); + uuid_unparse(fs_devices->fsid, uuidbuf); + if (!strncmp(uuidbuf, search, search_len)) + return 1; list_for_each(cur, &fs_devices->devices) { device = list_entry(cur, struct btrfs_device, dev_list); |