public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL55 - Allow gfs2_edit to display and print gfs1 rgrps
@ 2009-08-31 17:56 Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2009-08-31 17:56 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9ae354d72b41c51e0efa44d6839859f6f5d43877
Commit: 9ae354d72b41c51e0efa44d6839859f6f5d43877
Parent: 2a411be17ec6431e80ac654f976b2d45b03b1b9a
Author: Bob Peterson <bob@ganesha.peterson>
AuthorDate: Mon Aug 31 11:17:14 2009 -0500
Committer: Bob Peterson <rpeterso@redhat.com>
CommitterDate: Mon Aug 31 12:58:09 2009 -0500
Allow gfs2_edit to display and print gfs1 rgrps
Before gfs2_edit was interpreting gfs1 rgrps as gfs2 rgrps
for displaying and printing purposes.
rhbz#503529
---
gfs2/edit/gfs2hex.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 977770d..ab41796 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -66,6 +66,25 @@ const char *block_type_str[15] = {
"Quota Change",
};
+struct gfs1_rgrp {
+ struct gfs2_meta_header rg_header;
+
+ uint32_t rg_flags; /* ?? */
+
+ uint32_t rg_free; /* Number (qty) of free data blocks */
+
+ /* Dinodes are USEDMETA, but are handled separately from other METAs */
+ uint32_t rg_useddi; /* Number (qty) of dinodes (used or free) */
+ uint32_t rg_freedi; /* Number (qty) of unused (free) dinodes */
+ struct gfs2_inum rg_freedi_list; /* 1st block in chain of free dinodes */
+
+ /* These META statistics do not include dinodes (used or free) */
+ uint32_t rg_usedmeta; /* Number (qty) of used metadata blocks */
+ uint32_t rg_freemeta; /* Number (qty) of unused metadata blocks */
+
+ char rg_reserved[64];
+};
+
void eol(int col) /* end of line */
{
if (termlines) {
@@ -474,6 +493,40 @@ void gfs2_sb_print2(struct gfs2_sb *sb)
#endif
}
+/**
+ * gfs1_rgrp_in - read in a gfs1 rgrp
+ */
+void gfs1_rgrp_in(struct gfs1_rgrp *rgrp, char *rbuf)
+{
+ struct gfs1_rgrp *str = (struct gfs1_rgrp *)rbuf;
+
+ gfs2_meta_header_in(&rgrp->rg_header, rbuf);
+ rgrp->rg_flags = be32_to_cpu(str->rg_flags);
+ rgrp->rg_free = be32_to_cpu(str->rg_free);
+ rgrp->rg_useddi = be32_to_cpu(str->rg_useddi);
+ rgrp->rg_freedi = be32_to_cpu(str->rg_freedi);
+ gfs2_inum_in(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
+ rgrp->rg_usedmeta = be32_to_cpu(str->rg_usedmeta);
+ rgrp->rg_freemeta = be32_to_cpu(str->rg_freemeta);
+ memcpy(rgrp->rg_reserved, str->rg_reserved, 64);
+}
+
+/**
+ * gfs_rgrp_print - Print out a resource group header
+ */
+void gfs1_rgrp_print(struct gfs1_rgrp *rg)
+{
+ gfs2_meta_header_print(&rg->rg_header);
+ pv(rg, rg_flags, "%u", "0x%x");
+ pv(rg, rg_free, "%u", "0x%x");
+ pv(rg, rg_useddi, "%u", "0x%x");
+ pv(rg, rg_freedi, "%u", "0x%x");
+ gfs2_inum_print(&rg->rg_freedi_list);
+
+ pv(rg, rg_usedmeta, "%u", "0x%x");
+ pv(rg, rg_freemeta, "%u", "0x%x");
+}
+
/******************************************************************************
*******************************************************************************
**
@@ -523,8 +576,15 @@ int display_gfs2(void)
break;
case GFS2_METATYPE_RG:
- gfs2_rgrp_in(&rg, buf);
- gfs2_rgrp_print(&rg);
+ if (gfs1) {
+ struct gfs1_rgrp rg1;
+
+ gfs1_rgrp_in(&rg1, buf);
+ gfs1_rgrp_print(&rg1);
+ } else {
+ gfs2_rgrp_in(&rg, buf);
+ gfs2_rgrp_print(&rg);
+ }
break;
case GFS2_METATYPE_RB:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-31 17:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-31 17:56 cluster: RHEL55 - Allow gfs2_edit to display and print gfs1 rgrps Bob Peterson
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 read-only IMAP folder(s) and NNTP newsgroup(s).