Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 105d736c57b2691635bd047efe146ef0 > files > 10

btrfs-progs-0.20-0.rc1.20130117.2.mga3.src.rpm

From 629dfb8fa801a8fdbccae7b634b1d288120ce4b9 Mon Sep 17 00:00:00 2001
From: Dieter Ries <mail@dieterries.net>
Date: Sun, 14 Oct 2012 17:17:19 +0200
Subject: [PATCH] btrfs-progs: btrfsck: Print which filesystem to be checked to
 stdout

This patch makes btrfsck print the filesystem, which is to be checked,
to stdout, as well as the UUID of the corresponding partition.
This should be helpful when analyzing (copied and pasted) output of
btrfsck.

Signed-off-by: Dieter Ries <mail@dieterries.net>
---
 btrfsck.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/btrfsck.c b/btrfsck.c
index 58baade..dd0f18b 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -24,6 +24,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <getopt.h>
+#include <uuid/uuid.h>
 #include "kerncompat.h"
 #include "ctree.h"
 #include "volumes.h"
@@ -3498,6 +3499,7 @@ int main(int ac, char **av)
 	struct btrfs_fs_info *info;
 	struct btrfs_trans_handle *trans = NULL;
 	u64 bytenr = 0;
+	char uuidbuf[37];
 	int ret;
 	int num;
 	int repair = 0;
@@ -3550,6 +3552,8 @@ int main(int ac, char **av)
 	}
 
 	info = open_ctree_fs_info(av[optind], bytenr, rw, 1);
+	uuid_unparse(info->super_copy.fsid, uuidbuf);
+	printf("Checking filesystem on %s\nUUID: %s\n", av[optind], uuidbuf);
 
 	if (info == NULL)
 		return 1;