* [Cluster-devel] [PATCH 1/3] gfs2-utils: Remove references to unlinked file tag
@ 2012-05-25 10:07 Andrew Price
2012-05-25 10:07 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures Andrew Price
2012-05-25 10:07 ` [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets Andrew Price
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Price @ 2012-05-25 10:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
Remove references to an obsolete unlinked tag file (or file tag).
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/man/gfs2_jadd.8 | 3 ---
gfs2/man/mkfs.gfs2.8 | 3 ---
gfs2/mkfs/main_mkfs.c | 5 +----
4 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index e2a7e45..8ed08dd 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -255,7 +255,6 @@ struct gfs2_sbd {
unsigned int bsize; /* The block size of the FS (in bytes) */
unsigned int jsize; /* Size of journals (in MB) */
unsigned int rgsize; /* Size of resource groups (in MB) */
- unsigned int utsize; /* Size of unlinked tag files (in MB) */
unsigned int qcsize; /* Size of quota change files (in MB) */
int debug;
diff --git a/gfs2/man/gfs2_jadd.8 b/gfs2/man/gfs2_jadd.8
index a645fb7..5453edd 100644
--- a/gfs2/man/gfs2_jadd.8
+++ b/gfs2/man/gfs2_jadd.8
@@ -50,9 +50,6 @@ The number of new journals to add.
\fB-q\fP
Be quiet. Don't print anything.
.TP
-\fB-u MegaBytes\fP
-Initial size of each journal's unlinked tag file
-.TP
\fB-V\fP
Version. Print version information, then exit.
.
diff --git a/gfs2/man/mkfs.gfs2.8 b/gfs2/man/mkfs.gfs2.8
index 63348f8..d17e272 100644
--- a/gfs2/man/mkfs.gfs2.8
+++ b/gfs2/man/mkfs.gfs2.8
@@ -75,9 +75,6 @@ Fsname is a unique file system name used to distinguish this GFS2 file
system from others created (1 to 16 characters). Lock_nolock doesn't
use this field.
.TP
-\fB-u\fP \fIMegaBytes\fR
-Initial size of each journal's unlinked tag file
-.TP
\fB-V\fP
Print program version information, then exit.
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 7c93621..e6b00a0 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -109,7 +109,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
sdp->orig_fssize = 0;
while (cont) {
- optchar = getopt(argc, argv, "-b:c:DhJ:j:KOp:qr:t:u:VX");
+ optchar = getopt(argc, argv, "-b:c:DhJ:j:KOp:qr:t:VX");
switch (optchar) {
case 'b':
@@ -166,9 +166,6 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
strcpy(sdp->locktable, optarg);
break;
- case 'u':
- break;
-
case 'V':
printf("gfs2_mkfs %s (built %s %s)\n", VERSION,
__DATE__, __TIME__);
--
1.7.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures
2012-05-25 10:07 [Cluster-devel] [PATCH 1/3] gfs2-utils: Remove references to unlinked file tag Andrew Price
@ 2012-05-25 10:07 ` Andrew Price
2012-05-25 10:27 ` Andrew Price
2012-05-25 10:07 ` [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets Andrew Price
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Price @ 2012-05-25 10:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
Fixes up find_mtype to really iterate over the metadata array and to
choose between gfs2 and gfs1 structures.
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/edit/hexedit.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 69d1940..8311534 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -813,14 +813,15 @@ int display_block_type(int from_restore)
return ret_type;
}
-static const struct lgfs2_metadata *find_mtype(uint32_t mtype)
+static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
{
const struct lgfs2_metadata *m = lgfs2_metadata;
unsigned n = 0;
do {
- if (m->gfs2 && m->mh_type == mtype)
- return m;
+ if (((gfs1 && m[n].gfs1) || (!gfs1 && m[n].gfs2))
+ && m[n].mh_type == mtype)
+ return &m[n];
n++;
} while (n < lgfs2_metadata_size);
@@ -934,7 +935,7 @@ static int hexdump(uint64_t startaddr, int len)
}
print_gfs2("] ");
if (print_field >= 0) {
- const struct lgfs2_metadata *m = find_mtype(get_block_type(bh));
+ const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
if (m) {
const struct lgfs2_metafield *f;
unsigned n;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets
2012-05-25 10:07 [Cluster-devel] [PATCH 1/3] gfs2-utils: Remove references to unlinked file tag Andrew Price
2012-05-25 10:07 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures Andrew Price
@ 2012-05-25 10:07 ` Andrew Price
2012-05-25 10:19 ` Steven Whitehouse
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Price @ 2012-05-25 10:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
Replace some uses of magic offsets with equivalent struct member
accesses.
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/edit/hexedit.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 8311534..b4e6d15 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -838,6 +838,7 @@ static int hexdump(uint64_t startaddr, int len)
uint64_t l;
const char *lpBuffer = bh->b_data;
int print_field, cursor_line;
+ const uint32_t block_type = get_block_type(bh);
strcpy(edit_fmt,"%02x");
pointer = (unsigned char *)lpBuffer + offset;
@@ -935,7 +936,7 @@ static int hexdump(uint64_t startaddr, int len)
}
print_gfs2("] ");
if (print_field >= 0) {
- const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
+ const struct lgfs2_metadata *m = find_mtype(block_type, sbd.gfs1);
if (m) {
const struct lgfs2_metafield *f;
unsigned n;
@@ -951,9 +952,9 @@ static int hexdump(uint64_t startaddr, int len)
}
if (cursor_line) {
- if (((*(bh->b_data + 7) == GFS2_METATYPE_IN) ||
- (*(bh->b_data + 7) == GFS2_METATYPE_DI &&
- (*(bh->b_data + 0x8b) || *(bh->b_data + 0x8a))))) {
+ if (block_type == GFS2_METATYPE_IN ||
+ ((block_type == GFS2_METATYPE_DI) &&
+ ((struct gfs2_dinode*)bh->b_data)->di_height)) {
int ptroffset = edit_row[dmode] * 16 +
edit_col[dmode];
--
1.7.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets
2012-05-25 10:07 ` [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets Andrew Price
@ 2012-05-25 10:19 ` Steven Whitehouse
0 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2012-05-25 10:19 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Those all look ok to me,
Steve.
On Fri, 2012-05-25 at 11:07 +0100, Andrew Price wrote:
> Replace some uses of magic offsets with equivalent struct member
> accesses.
>
> Signed-off-by: Andrew Price <anprice@redhat.com>
> ---
> gfs2/edit/hexedit.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
> index 8311534..b4e6d15 100644
> --- a/gfs2/edit/hexedit.c
> +++ b/gfs2/edit/hexedit.c
> @@ -838,6 +838,7 @@ static int hexdump(uint64_t startaddr, int len)
> uint64_t l;
> const char *lpBuffer = bh->b_data;
> int print_field, cursor_line;
> + const uint32_t block_type = get_block_type(bh);
>
> strcpy(edit_fmt,"%02x");
> pointer = (unsigned char *)lpBuffer + offset;
> @@ -935,7 +936,7 @@ static int hexdump(uint64_t startaddr, int len)
> }
> print_gfs2("] ");
> if (print_field >= 0) {
> - const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
> + const struct lgfs2_metadata *m = find_mtype(block_type, sbd.gfs1);
> if (m) {
> const struct lgfs2_metafield *f;
> unsigned n;
> @@ -951,9 +952,9 @@ static int hexdump(uint64_t startaddr, int len)
>
> }
> if (cursor_line) {
> - if (((*(bh->b_data + 7) == GFS2_METATYPE_IN) ||
> - (*(bh->b_data + 7) == GFS2_METATYPE_DI &&
> - (*(bh->b_data + 0x8b) || *(bh->b_data + 0x8a))))) {
> + if (block_type == GFS2_METATYPE_IN ||
> + ((block_type == GFS2_METATYPE_DI) &&
> + ((struct gfs2_dinode*)bh->b_data)->di_height)) {
> int ptroffset = edit_row[dmode] * 16 +
> edit_col[dmode];
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures
2012-05-25 10:07 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures Andrew Price
@ 2012-05-25 10:27 ` Andrew Price
2012-05-25 10:40 ` Steven Whitehouse
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Price @ 2012-05-25 10:27 UTC (permalink / raw)
To: cluster-devel.redhat.com
On 25/05/12 11:07, Andrew Price wrote:
> Fixes up find_mtype to really iterate over the metadata array and to
> choose between gfs2 and gfs1 structures.
>
> Signed-off-by: Andrew Price<anprice@redhat.com>
> ---
> gfs2/edit/hexedit.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
> index 69d1940..8311534 100644
> --- a/gfs2/edit/hexedit.c
> +++ b/gfs2/edit/hexedit.c
> @@ -813,14 +813,15 @@ int display_block_type(int from_restore)
> return ret_type;
> }
>
> -static const struct lgfs2_metadata *find_mtype(uint32_t mtype)
> +static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
> {
> const struct lgfs2_metadata *m = lgfs2_metadata;
> unsigned n = 0;
>
> do {
> - if (m->gfs2&& m->mh_type == mtype)
> - return m;
> + if (((gfs1&& m[n].gfs1) || (!gfs1&& m[n].gfs2))
I'm wondering if we should represent the version metadata as flags
instead of separate gfs1 and gfs2 fields and define some constants so we
can do the comparison in one go, e.g.
if ((m[n].versions & versions) ...
Where versions is some combination of defined constants passed into the
function like LGFS2_VER_1 | LGFS2_VER_2
But that has its own drawbacks I guess so I'm probably just splitting
hairs. What do you think?
Andy
> + && m[n].mh_type == mtype)
> + return&m[n];
> n++;
> } while (n< lgfs2_metadata_size);
>
> @@ -934,7 +935,7 @@ static int hexdump(uint64_t startaddr, int len)
> }
> print_gfs2("] ");
> if (print_field>= 0) {
> - const struct lgfs2_metadata *m = find_mtype(get_block_type(bh));
> + const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
> if (m) {
> const struct lgfs2_metafield *f;
> unsigned n;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures
2012-05-25 10:27 ` Andrew Price
@ 2012-05-25 10:40 ` Steven Whitehouse
0 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2012-05-25 10:40 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
On Fri, 2012-05-25 at 11:27 +0100, Andrew Price wrote:
> On 25/05/12 11:07, Andrew Price wrote:
> > Fixes up find_mtype to really iterate over the metadata array and to
> > choose between gfs2 and gfs1 structures.
> >
> > Signed-off-by: Andrew Price<anprice@redhat.com>
> > ---
> > gfs2/edit/hexedit.c | 9 +++++----
> > 1 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
> > index 69d1940..8311534 100644
> > --- a/gfs2/edit/hexedit.c
> > +++ b/gfs2/edit/hexedit.c
> > @@ -813,14 +813,15 @@ int display_block_type(int from_restore)
> > return ret_type;
> > }
> >
> > -static const struct lgfs2_metadata *find_mtype(uint32_t mtype)
> > +static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
> > {
> > const struct lgfs2_metadata *m = lgfs2_metadata;
> > unsigned n = 0;
> >
> > do {
> > - if (m->gfs2&& m->mh_type == mtype)
> > - return m;
> > + if (((gfs1&& m[n].gfs1) || (!gfs1&& m[n].gfs2))
>
> I'm wondering if we should represent the version metadata as flags
> instead of separate gfs1 and gfs2 fields and define some constants so we
> can do the comparison in one go, e.g.
>
> if ((m[n].versions & versions) ...
>
> Where versions is some combination of defined constants passed into the
> function like LGFS2_VER_1 | LGFS2_VER_2
>
> But that has its own drawbacks I guess so I'm probably just splitting
> hairs. What do you think?
>
> Andy
>
I think that makes sense. I don't remember now why I did that with a
bitfield and not flags, but it is probably better to convert it to
flags. We'll want to give them a longer name though, as everything in
the library will land up with a LGFS2_ or lgfs2_ prefix in the end,
Steve.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-05-25 10:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25 10:07 [Cluster-devel] [PATCH 1/3] gfs2-utils: Remove references to unlinked file tag Andrew Price
2012-05-25 10:07 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Fix find_mtype and support gfs1 structures Andrew Price
2012-05-25 10:27 ` Andrew Price
2012-05-25 10:40 ` Steven Whitehouse
2012-05-25 10:07 ` [Cluster-devel] [PATCH 3/3] gfs2_edit: Clean up some magic offsets Andrew Price
2012-05-25 10:19 ` Steven Whitehouse
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).