25 May 17:05
[PATCH] libgfs2: Use flags for versions in metadata description
Andrew Price <anprice <at> redhat.com>
2012-05-25 15:05:28 GMT
2012-05-25 15:05:28 GMT
Consolidate the .gfs1 and .gfs2 fields into one .versions field and add
constants so we can test lgfs2_metadata versions more easily.
Signed-off-by: Andrew Price <anprice <at> redhat.com>
---
gfs2/edit/hexedit.c | 8 +++---
gfs2/libgfs2/libgfs2.h | 5 ++-
gfs2/libgfs2/meta.c | 67 ++++++++++++++++++++----------------------------
3 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index b4e6d15..2ff1125 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -813,14 +813,13 @@ int display_block_type(int from_restore)
return ret_type;
}
-static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
+static const struct lgfs2_metadata *find_mtype(uint32_t mtype, const unsigned versions)
{
const struct lgfs2_metadata *m = lgfs2_metadata;
unsigned n = 0;
do {
- if (((gfs1 && m[n].gfs1) || (!gfs1 && m[n].gfs2))
- && m[n].mh_type == mtype)
+ if ((m[n].versions & versions) && m[n].mh_type == mtype)
return &m[n];
n++;
(Continue reading)
RSS Feed