cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 4/6] libgfs2: Move some debug messages out into mkfs/fsck
Date: Wed, 30 Nov 2011 15:04:40 +0000	[thread overview]
Message-ID: <1322665482-28435-5-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1322665482-28435-1-git-send-email-swhiteho@redhat.com>

We don't need to print these messages from the function which
calculates the resource group layout, we can do it afterwards.
There are still some other messages which need to be relocated
from this function, but that is a more tricky operation.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
 gfs2/fsck/rgrepair.c       |   19 +++++++++++++++++++
 gfs2/libgfs2/fs_geometry.c |   12 ------------
 gfs2/mkfs/gfs2_mkfs.h      |    9 +++++----
 gfs2/mkfs/main_grow.c      |   19 +++++++++++++++++++
 gfs2/mkfs/main_mkfs.c      |    1 +
 5 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 1ffa2c0..c11558b 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -593,6 +593,24 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
 	return 0;
 }
 
+static void debug_print_rgrps(struct gfs2_sbd *sdp, struct osi_root *rgtree)
+{
+	struct osi_node *n, *next;
+	struct rgrp_tree *rl;
+
+	if (sdp->debug) {
+		log_info("\n");
+
+		for (n = osi_first(rgtree); n; n = next) {
+			next = osi_next(n);
+			rl = (struct rgrp_tree *)n;
+			log_info("rg_o = %llu, rg_l = %llu\n",
+				 (unsigned long long)rl->start,
+				 (unsigned long long)rl->length);
+		}
+	}
+}
+
 /*
  * gfs2_rindex_calculate - calculate what the rindex should look like
  *                          in a perfect world (trust_lvl == open_minded)
@@ -643,6 +661,7 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
 	}
 	/* Compute the default resource group layout as mkfs would have done */
 	compute_rgrp_layout(sdp, &sdp->rgcalc, TRUE);
+	debug_print_rgrps(sdp, &sdp->rgcalc);
 	build_rgrps(sdp, FALSE); /* FALSE = calc but don't write to disk. */
 	log_debug( _("fs_total_size = 0x%llx blocks.\n"),
 		  (unsigned long long)sdp->device.length);
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 4278bbf..5ff9813 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -142,18 +142,6 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree,
 	}
 
 	sdp->rgrps = nrgrp;
-
-	if (sdp->debug) {
-		log_info("\n");
-
-		for (n = osi_first(rgtree); n; n = next) {
-			next = osi_next(n);
-			rl = (struct rgrp_tree *)n;
-			log_info("rg_o = %llu, rg_l = %llu\n",
-				 (unsigned long long)rl->start,
-				 (unsigned long long)rl->length);
-		}
-	}
 }
 
 /**
diff --git a/gfs2/mkfs/gfs2_mkfs.h b/gfs2/mkfs/gfs2_mkfs.h
index 14bf4f6..6f0ac2b 100644
--- a/gfs2/mkfs/gfs2_mkfs.h
+++ b/gfs2/mkfs/gfs2_mkfs.h
@@ -6,16 +6,17 @@
 #include "copyright.cf"
 
 /* main_grow */
-void main_grow(int argc, char *argv[]);
+extern void main_grow(int argc, char *argv[]);
+extern void debug_print_rgrps(struct gfs2_sbd *sdp, struct osi_root *rgtree);
 
 /* main_jadd */
-void main_jadd(int argc, char *argv[]);
+extern void main_jadd(int argc, char *argv[]);
 
 /* main_mkfs */
-void main_mkfs(int argc, char *argv[]);
+extern void main_mkfs(int argc, char *argv[]);
 
 /* main_shrink */
-void main_shrink(int argc, char *argv[]);
+extern void main_shrink(int argc, char *argv[]);
 
 /*
  * The following inode IOCTL macros and inode flags 
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index f6d7bf0..1dc911a 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -284,6 +284,24 @@ static void print_info(struct gfs2_sbd *sdp)
 		   (unsigned long long)fsgrowth / MB);
 }
 
+void debug_print_rgrps(struct gfs2_sbd *sdp, struct osi_root *rgtree)
+{
+	struct osi_node *n, *next;
+	struct rgrp_tree *rl;
+
+	if (sdp->debug) {
+		log_info("\n");
+
+		for (n = osi_first(rgtree); n; n = next) {
+			next = osi_next(n);
+			rl = (struct rgrp_tree *)n;
+			log_info("rg_o = %llu, rg_l = %llu\n",
+				 (unsigned long long)rl->start,
+				 (unsigned long long)rl->length);
+		}
+	}
+}
+
 /**
  * main_grow - do everything
  * @argc:
@@ -391,6 +409,7 @@ main_grow(int argc, char *argv[])
 			int old_rg_count;
 
 			compute_rgrp_layout(sdp, &sdp->rgtree, TRUE);
+			debug_print_rgrps(sdp, &sdp->rgtree);
 			print_info(sdp);
 			initialize_new_portion(sdp, &old_rg_count);
 			fix_rindex(sdp, rindex_fd, old_rg_count);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index eeff47b..700b434 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -629,6 +629,7 @@ void main_mkfs(int argc, char *argv[])
 	/* Compute the resource group layouts */
 
 	compute_rgrp_layout(sdp, &sdp->rgtree, rgsize_specified);
+	debug_print_rgrps(sdp, &sdp->rgtree);
 
 	/* Generate a random uuid */
 	get_random_bytes(uuid, sizeof(uuid));
-- 
1.7.4.4



  parent reply	other threads:[~2011-11-30 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 15:04 [Cluster-devel] libgfs2 cleanups Steven Whitehouse
2011-11-30 15:04 ` [Cluster-devel] [PATCH 1/6] libgfs2: Move generic_interrupt() into utils Steven Whitehouse
2011-11-30 15:04 ` [Cluster-devel] [PATCH 2/6] libgfs2: Move gfs2_getch " Steven Whitehouse
2011-11-30 15:04 ` [Cluster-devel] [PATCH 3/6] libgfs2: Prepare to remove log_xxx() macros from library Steven Whitehouse
2011-11-30 15:04 ` Steven Whitehouse [this message]
2011-11-30 15:04 ` [Cluster-devel] [PATCH 5/6] libgfs2: Clean up sb read/check functions Steven Whitehouse
2011-11-30 15:04 ` [Cluster-devel] [PATCH 6/6] libgfs2: Remove some more log_xxx calls Steven Whitehouse
2011-11-30 15:55 ` [Cluster-devel] libgfs2 cleanups Bob Peterson

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=1322665482-28435-5-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    /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).