linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dieter Ries <mail@dieterries.net>
To: linux-btrfs@vger.kernel.org, dave@jikos.cz
Cc: chris.mason@fusionio.com, Dieter Ries <mail@dieterries.net>
Subject: [PATCH 2/4] btrfs-progs: btrfsck: Print which filesystem to be checked to stdout
Date: Sun, 14 Oct 2012 17:17:19 +0200	[thread overview]
Message-ID: <1350227839-18806-1-git-send-email-mail@dieterries.net> (raw)
In-Reply-To: <20121009150844.GT4405@twin.jikos.cz>

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 |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/btrfsck.c b/btrfsck.c
index 67f4a9d..ea654de 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -20,6 +20,7 @@
 #define _GNU_SOURCE 1
 #include <stdio.h>
 #include <stdlib.h>
+#include <uuid/uuid.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -3492,6 +3493,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;
@@ -3540,9 +3542,10 @@ int main(int ac, char **av)
 	} else if(ret) {
 		fprintf(stderr, "%s is currently mounted. Aborting.\n", av[optind]);
 		return -EBUSY;
-	}
-
+	} 
 	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;
-- 
1.7.3.GIT


  parent reply	other threads:[~2012-10-14 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 19:07 [PATCH 0/4] Resend: btrfs-progs: Some cosmetic changes (mainly) to btrfsck Dieter Ries
2012-10-08 19:07 ` [PATCH 1/4] btrfs-progs: Remove redundant "Btrfs" string from version string Dieter Ries
2012-10-08 19:07 ` [PATCH 2/4] btrfs-progs: btrfsck: Print which filesystem to be checked to stdout Dieter Ries
2012-10-09 15:08   ` David Sterba
2012-10-14 15:15     ` [PATCH 3/4] btrfs-progs: btrfsck: Print feedback about fscking " Dieter Ries
2012-10-14 15:18       ` Dieter Ries
2012-10-14 15:17     ` Dieter Ries [this message]
2012-10-08 19:07 ` Dieter Ries
2012-10-09 15:21   ` David Sterba
2012-10-11 20:50     ` mail
2012-10-08 19:07 ` [PATCH 4/4] btrfs-progs: btrfsck: Remove binary error code output Dieter Ries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350227839-18806-1-git-send-email-mail@dieterries.net \
    --to=mail@dieterries.net \
    --cc=chris.mason@fusionio.com \
    --cc=dave@jikos.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).