All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <steve@chygwyn.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] libgfs2.h: Add gfs_block_tag structure, and some more flag symbols
Date: Thu, 02 Feb 2012 13:05:09 +0000	[thread overview]
Message-ID: <1328187909.2726.9.camel@menhir> (raw)


This adds the missing gfs_block_tag structure to the metadata
description and also adds some symbolic constants for log
header/descriptor blocks.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index ce1dae8..ef80b63 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -98,6 +98,7 @@ enum lgfs2_meta_type {
 	LGFS2_MT_GFS2_INUM_RANGE = 22,
 	LGFS2_MT_STATFS_CHANGE = 23,
 	LGFS2_MT_GFS_JINDEX = 24,
+	LGFS2_MT_GFS_BLOCK_TAG = 25,
 	
 	LGFS2_MT_NR,
 };
@@ -344,6 +345,12 @@ extern const struct lgfs2_symbolic lgfs2_metaformats[];
 extern const unsigned lgfs2_metaformat_size;
 extern const struct lgfs2_symbolic lgfs2_di_flags[];
 extern const unsigned lgfs2_di_flag_size;
+extern const struct lgfs2_symbolic lgfs2_lh_flags[];
+extern const unsigned lgfs2_lh_flag_size;
+extern const struct lgfs2_symbolic lgfs2_ld_types[];
+extern const unsigned lgfs2_ld_type_size;
+extern const struct lgfs2_symbolic lgfs2_ld1_types[];
+extern const unsigned lgfs2_ld1_type_size;
 extern int lgfs2_selfcheck(void);
 
 /* bitmap.c */
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index 65c535e..737182a 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -63,6 +63,30 @@ SYM(GFS2_DIF_INHERIT_JDATA)
 
 const unsigned lgfs2_di_flag_size = ARRAY_SIZE(lgfs2_di_flags);
 
+const struct lgfs2_symbolic lgfs2_lh_flags[] = {
+SYM(GFS2_LOG_HEAD_UNMOUNT)
+};
+
+const unsigned int lgfs2_lh_flag_size = ARRAY_SIZE(lgfs2_lh_flags);
+
+const struct lgfs2_symbolic lgfs2_ld_types[] = {
+SYM(GFS2_LOG_DESC_METADATA)
+SYM(GFS2_LOG_DESC_REVOKE)
+SYM(GFS2_LOG_DESC_JDATA)
+};
+
+const unsigned int lgfs2_ld_type_size = ARRAY_SIZE(lgfs2_ld_types);
+
+const struct lgfs2_symbolic lgfs2_ld1_types[] = {
+SYM(GFS_LOG_DESC_METADATA)
+SYM(GFS_LOG_DESC_IUL)
+SYM(GFS_LOG_DESC_IDA)
+SYM(GFS_LOG_DESC_Q)
+SYM(GFS_LOG_DESC_LAST)
+};
+
+const unsigned int lgfs2_ld1_type_size = ARRAY_SIZE(lgfs2_ld1_types);
+
 #undef SYM
 
 
@@ -304,7 +328,7 @@ F(lh_hash, .flags = LGFS2_MFF_CHECK)
 
 static const struct lgfs2_metafield gfs_log_header_fields[] = {
 MH(lh_header)
-F(lh_flags)
+F(lh_flags, .flags = LGFS2_MFF_MASK, .symtab = lgfs2_lh_flags, .nsyms = ARRAY_SIZE(lgfs2_lh_flags))
 RF(lh_pad)
 F(lh_first)
 F(lh_sequence)
@@ -318,7 +342,7 @@ RF(lh_reserved)
 
 static const struct lgfs2_metafield gfs2_log_desc_fields[] = {
 MH(ld_header)
-F(ld_type)
+F(ld_type, .flags = LGFS2_MFF_ENUM, .symtab = lgfs2_ld_types, .nsyms = ARRAY_SIZE(lgfs2_ld_types))
 F(ld_length, .flags = LGFS2_MFF_FSBLOCKS)
 F(ld_data1)
 F(ld_data2)
@@ -330,7 +354,7 @@ RF(ld_reserved)
 
 static const struct lgfs2_metafield gfs_log_desc_fields[] = {
 MH(ld_header)
-F(ld_type)
+F(ld_type, .flags = LGFS2_MFF_ENUM, .symtab = lgfs2_ld1_types, .nsyms = ARRAY_SIZE(lgfs2_ld1_types))
 F(ld_length, .flags = LGFS2_MFF_FSBLOCKS)
 F(ld_data1)
 F(ld_data2)
@@ -422,6 +446,20 @@ RF(ji_pad)
 RF(ji_reserved)
 };
 
+#undef STRUCT
+struct gfs_block_tag {
+	uint64_t bt_blkno;      /* inplace block number */
+	uint32_t bt_flags;      /* ?? */
+	uint32_t bt_pad;
+};
+#define STRUCT gfs_block_tag
+
+static const struct lgfs2_metafield gfs_block_tag_fields[] = {
+FP(bt_blkno)
+RF(bt_flags)
+RF(bt_pad)
+};
+
 const struct lgfs2_metadata lgfs2_metadata[] = {
 	[LGFS2_MT_GFS2_SB] = {
 		.gfs2 = 1,
@@ -661,6 +699,13 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
 		.nfields = ARRAY_SIZE(gfs_jindex_fields),
 		.size = sizeof(struct gfs_jindex),
 	},
+	[LGFS2_MT_GFS_BLOCK_TAG] = {
+		.gfs1 = 1,
+		.name = "gfs_block_tag",
+		.fields = gfs_block_tag_fields,
+		.nfields = ARRAY_SIZE(gfs_block_tag_fields),
+		.size = sizeof(struct gfs_block_tag),
+	},
 };
 
 const unsigned lgfs2_metadata_size = ARRAY_SIZE(lgfs2_metadata);




             reply	other threads:[~2012-02-02 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 13:05 Steven Whitehouse [this message]
2012-02-02 16:15 ` [Cluster-devel] libgfs2.h: Add gfs_block_tag structure, and some more flag symbols Andrew Price

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=1328187909.2726.9.camel@menhir \
    --to=steve@chygwyn.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.