[Cluster-devel] libgfs2.h: Add gfs_block_tag structure, and some more flag symbols

Andrew Price anprice at redhat.com
Thu Feb 2 16:15:24 UTC 2012


On 02/02/12 13:05, Steven Whitehouse wrote:
>
> 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 at redhat.com>

Looks good to me,

Andy

>
> 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);
>
>




More information about the Cluster-devel mailing list