* [PATCH] Btrfs-progs: make btrfs filesystem show <uuid> actually work
@ 2012-04-25 18:22 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2012-04-25 18:22 UTC (permalink / raw)
To: linux-btrfs
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>
---
cmds-filesystem.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 1f53d1c..ff98a77 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);
--
1.7.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-04-25 18:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25 18:22 [PATCH] Btrfs-progs: make btrfs filesystem show <uuid> actually work Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).