public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - Allow gfs2_edit to display and print gfs1 rgrps Date: Mon, 31 Aug 2009 17:33:00 -0000 [thread overview] Message-ID: <20090831173317.11CBE1201D4@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5dd73044bf882876b16d924d81159a032a1a8f87 Commit: 5dd73044bf882876b16d924d81159a032a1a8f87 Parent: d0d61c12bc72ae7d15cd71f1e9cfbe4c9e6c2691 Author: Bob Peterson <bob@ganesha.peterson> AuthorDate: Mon Aug 31 11:17:59 2009 -0500 Committer: Bob Peterson <bob@ganesha.peterson> CommitterDate: Mon Aug 31 11:17:59 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 7fe1a19..07b42c7 100644 --- a/gfs2/edit/gfs2hex.c +++ b/gfs2/edit/gfs2hex.c @@ -89,6 +89,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) { @@ -497,6 +516,40 @@ static void gfs2_sb_print2(struct gfs2_sb *sbp2) #endif } +/** + * gfs1_rgrp_in - read in a gfs1 rgrp + */ +static 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 + */ +static 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"); +} + /****************************************************************************** ******************************************************************************* ** @@ -546,8 +599,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:
reply other threads:[~2009-08-31 17:33 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090831173317.11CBE1201D4@lists.fedorahosted.org \ --to=rpeterso@fedoraproject.org \ --cc=cluster-cvs-relay@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: linkBe 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 read-only IMAP folder(s) and NNTP newsgroup(s).