Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   libgfs2: Add a few structures missed from the initial version of meta.c (http://www.linux-archive.org/cluster-development/612785-libgfs2-add-few-structures-missed-initial-version-meta-c.html)

Steven Whitehouse 12-22-2011 10:59 AM

libgfs2: Add a few structures missed from the initial version of meta.c
 
>From d2cc9641066bff8a31aad132816d4378f20298cc Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Thu, 22 Dec 2011 11:48:07 +0000
Subject: [PATCH 1/2] libgfs2: Add a few structures missed from the initial
version of meta.c

Some GFS structures were missed from the original meta.c, so this
adds the missing ones.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
gfs2/libgfs2/libgfs2.h | 21 +++++++++-------
gfs2/libgfs2/meta.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 9 deletions(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 90da19e..dedf8b8 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -85,15 +85,18 @@ enum lgfs2_meta_type {
LGFS2_MT_GFS_INDIRECT = 9,
LGFS2_MT_DIR_LEAF = 10,
LGFS2_MT_GFS2_LOG_HEADER = 11,
- LGFS2_MT_GFS2_LOG_DESC = 12,
- LGFS2_MT_GFS2_LOG_BLOCK = 12,
- LGFS2_MT_EA_ATTR = 13,
- LGFS2_MT_EA_DATA = 14,
- LGFS2_MT_GFS2_QUOTA_CHANGE = 15,
- LGFS2_MT_DIRENT = 16,
- LGFS2_MT_EA_HEADER = 17,
- LGFS2_MT_GFS2_INUM_RANGE = 18,
- LGFS2_MT_STATFS_CHANGE = 19,
+ LGFS2_MT_GFS_LOG_HEADER = 12,
+ LGFS2_MT_GFS2_LOG_DESC = 13,
+ LGFS2_MT_GFS_LOG_DESC = 14,
+ LGFS2_MT_GFS2_LOG_BLOCK = 15,
+ LGFS2_MT_EA_ATTR = 16,
+ LGFS2_MT_EA_DATA = 17,
+ LGFS2_MT_GFS2_QUOTA_CHANGE = 18,
+ LGFS2_MT_DIRENT = 19,
+ LGFS2_MT_EA_HEADER = 20,
+ LGFS2_MT_GFS2_INUM_RANGE = 21,
+ LGFS2_MT_STATFS_CHANGE = 22,
+ LGFS2_MT_GFS_JINDEX = 23,

LGFS2_MT_NR,
};
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index c122d90..bff8c30 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -233,6 +233,20 @@ F(lh_hash)
};

#undef STRUCT
+#define STRUCT gfs_log_header
+
+static const struct lgfs2_metafield gfs_log_header_fields[] = {
+MH(lh_header)
+F(lh_flags)
+RF(lh_pad)
+F(lh_first)
+F(lh_sequence)
+F(lh_tail)
+F(lh_last_dump)
+RF(lh_reserved)
+};
+
+#undef STRUCT
#define STRUCT gfs2_log_descriptor

static const struct lgfs2_metafield gfs2_log_desc_fields[] = {
@@ -245,6 +259,18 @@ RF(ld_reserved)
};

#undef STRUCT
+#define STRUCT gfs_log_descriptor
+
+static const struct lgfs2_metafield gfs_log_desc_fields[] = {
+MH(ld_header)
+F(ld_type)
+F(ld_length)
+F(ld_data1)
+F(ld_data2)
+RF(ld_reserved)
+};
+
+#undef STRUCT
#define STRUCT gfs2_meta_header

static const struct lgfs2_metafield gfs2_log_block_fields[] = {
@@ -328,6 +354,16 @@ F(sc_free)
F(sc_dinodes)
};

+#undef STRUCT
+#define STRUCT gfs_jindex
+
+static const struct lgfs2_metafield gfs_jindex_fields[] = {
+FP(ji_addr)
+F(ji_nsegment)
+RF(ji_pad)
+RF(ji_reserved)
+};
+
const struct lgfs2_metadata lgfs2_metadata[] = {
[LGFS2_MT_GFS2_SB] = {
.gfs2 = 1,
@@ -449,6 +485,16 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.nfields = ARRAY_SIZE(gfs2_log_header_fields),
.size = sizeof(struct gfs2_log_header),
},
+ [LGFS2_MT_GFS_LOG_HEADER] = {
+ .gfs1 = 1,
+ .header = 1,
+ .mh_type = GFS2_METATYPE_LH,
+ .mh_format = GFS2_FORMAT_LH,
+ .name = "gfs_log_header",
+ .fields = gfs_log_header_fields,
+ .nfields = ARRAY_SIZE(gfs_log_header_fields),
+ .size = sizeof(struct gfs_log_header),
+ },
[LGFS2_MT_GFS2_LOG_DESC] = {
.gfs2 = 1,
.header = 1,
@@ -459,6 +505,16 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.nfields = ARRAY_SIZE(gfs2_log_desc_fields),
.size = sizeof(struct gfs2_log_descriptor),
},
+ [LGFS2_MT_GFS_LOG_DESC] = {
+ .gfs1 = 1,
+ .header = 1,
+ .mh_type = GFS2_METATYPE_LD,
+ .mh_format = GFS2_FORMAT_LD,
+ .name = "gfs_log_desc",
+ .fields = gfs_log_desc_fields,
+ .nfields = ARRAY_SIZE(gfs_log_desc_fields),
+ .size = sizeof(struct gfs_log_descriptor),
+ },
[LGFS2_MT_GFS2_LOG_BLOCK] = {
.gfs2 = 1,
.header = 1,
@@ -529,6 +585,13 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.nfields = ARRAY_SIZE(gfs2_statfs_change_fields),
.size = sizeof(struct gfs2_statfs_change),
},
+ [LGFS2_MT_GFS_JINDEX] = {
+ .gfs1 = 1,
+ .name = "gfs_jindex",
+ .fields = gfs_jindex_fields,
+ .nfields = ARRAY_SIZE(gfs_jindex_fields),
+ .size = sizeof(struct gfs_jindex),
+ },
};

const unsigned lgfs2_metadata_size = ARRAY_SIZE(lgfs2_metadata);
--
1.7.4.4


All times are GMT. The time now is 10:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.