Skip to contentSkip to conversation

libgfs2: Add pointer restriction flags

Cluster-devel Steven Whitehouse 1 participant 1 message Feb 13, 2012

lore
Share & tools
lore
#0 lore raw

This patch adds a couple of new metadata block types to represent free blocks and data blocks. This then allows these types to be used to specify all the valid block target types which pointers might point to. We can then add a new field to store this restriction information.

Also this adds a new test to check that the restriction information is supplied for all pointers.

gfs2/libgfs2/libgfs2.h +5 -1
index ef80b63..4bd01a8 100644
@@ -99,7 +99,9 @@ enum lgfs2_meta_type {
 	LGFS2_MT_STATFS_CHANGE = 23,
 	LGFS2_MT_GFS_JINDEX = 24,
 	LGFS2_MT_GFS_BLOCK_TAG = 25,
-	
+	LGFS2_MT_DATA = 26,
+	LGFS2_MT_FREE = 27,
+
 	LGFS2_MT_NR,
 };
 
@@ -132,6 +134,8 @@ struct lgfs2_metafield {
 #define LGFS2_MFF_MAJOR    0x08000	/* Major device number */
 #define LGFS2_MFF_MINOR    0x10000	/* Minor device number */
 
+	/* If it is a pointer, then this field must be set */
+	const unsigned points_to;
 	/* If isenum or ismask are set, these must also be filled in */
 	const struct lgfs2_symbolic *symtab;
 	const unsigned nsyms;
gfs2/libgfs2/meta.c +78 -32

227 lines not on this page · raw message