[Ocfs2-commits] jlbec commits r2088 - in trunk/fs: configfs ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Mar 30 17:31:36 CST 2005


Author: jlbec
Signed-off-by: manish
Date: 2005-03-30 17:31:35 -0600 (Wed, 30 Mar 2005)
New Revision: 2088

Modified:
   trunk/fs/configfs/bobtest.c
   trunk/fs/configfs/configfs.h
   trunk/fs/configfs/dir.c
   trunk/fs/configfs/item.c
   trunk/fs/configfs/mount.c
   trunk/fs/ocfs2/cluster/nodemanager.c
Log:

o Add structure namespacing to struct config_group.

Signed-off-by: manish



Modified: trunk/fs/configfs/bobtest.c
===================================================================
--- trunk/fs/configfs/bobtest.c	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/configfs/bobtest.c	2005-03-30 23:31:35 UTC (rev 2088)
@@ -102,7 +102,7 @@
 
 static struct robert robert = {
 	.group = {
-		.item = {
+		.cg_item = {
 			.name = "robert",
 			.ktype = &uktype_robert,
 		},
@@ -323,7 +323,7 @@
 static struct bobset bobset = {
 	.subsys = {
 		.su_group = {
-			.item = {
+			.cg_item = {
 				.name = "bobset",
 				.ktype = &uktype_bobset,
 			},
@@ -652,16 +652,16 @@
 
 	memset(jerry, 0, sizeof(struct jerry));
 
-	config_item_set_name(&tom->group.item, name);
-	tom->group.item.ktype = &uktype_tom;
+	config_item_set_name(&tom->group.cg_item, name);
+	tom->group.cg_item.ktype = &uktype_tom;
 	config_group_init(&tom->group);
 
 	tom->showme = 0;
 	tom->storeme = 0;
 	tomset->n_toms++;
 
-	config_item_set_name(&jerry->group.item, "jer");
-	jerry->group.item.ktype = &uktype_jerry;
+	config_item_set_name(&jerry->group.cg_item, "jer");
+	jerry->group.cg_item.ktype = &uktype_jerry;
 	config_group_init(&jerry->group);
 
 	tom->group.default_groups[0] = &jerry->group;
@@ -675,7 +675,7 @@
 	struct tomset *tomset = to_tomset(group);
 	struct tom *tom = to_tom(item);
 
-	config_item_put(&tom->group.default_groups[0]->item);
+	config_item_put(&tom->group.default_groups[0]->cg_item);
 
 	tomset->n_toms--;
 	config_item_put(item);
@@ -699,7 +699,7 @@
 static struct tomset tomset = {
 	.subsys = {
 		.su_group = {
-			.item = {
+			.cg_item = {
 				.name = "tomset",
 				.ktype = &uktype_tomset,
 			},

Modified: trunk/fs/configfs/configfs.h
===================================================================
--- trunk/fs/configfs/configfs.h	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/configfs/configfs.h	2005-03-30 23:31:35 UTC (rev 2088)
@@ -91,9 +91,9 @@
  */
 
 struct config_group {
-	struct config_item	item;
-	struct list_head	list;
-	struct configfs_subsystem *subsys;
+	struct config_item		cg_item;
+	struct list_head		cg_list;
+	struct configfs_subsystem 	*cg_subsys;
 	struct config_group		**default_groups;
 };
 
@@ -105,17 +105,17 @@
 
 static inline struct config_group *to_config_group(struct config_item *item)
 {
-	return item ? container_of(item,struct config_group,item) : NULL;
+	return item ? container_of(item,struct config_group,cg_item) : NULL;
 }
 
 static inline struct config_group *config_group_get(struct config_group *group)
 {
-	return group ? to_config_group(config_item_get(&group->item)) : NULL;
+	return group ? to_config_group(config_item_get(&group->cg_item)) : NULL;
 }
 
 static inline void config_group_put(struct config_group *group)
 {
-	config_item_put(&group->item);
+	config_item_put(&group->cg_item);
 }
 
 extern struct config_item *config_group_find_obj(struct config_group *, const char *);

Modified: trunk/fs/configfs/dir.c
===================================================================
--- trunk/fs/configfs/dir.c	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/configfs/dir.c	2005-03-30 23:31:35 UTC (rev 2088)
@@ -405,7 +405,7 @@
 
 static void detach_groups(struct config_group *group)
 {
-	struct dentry * dentry = dget(group->item.dentry);
+	struct dentry * dentry = dget(group->cg_item.dentry);
 	struct dentry *child;
 	struct configfs_dirent *parent_sd;
 	struct configfs_dirent *sd, *tmp;
@@ -457,11 +457,11 @@
 	struct qstr name;
 	struct configfs_dirent *sd;
 	/* We trust the caller holds a reference to parent */
-	struct dentry *child, *parent = parent_group->item.dentry;
+	struct dentry *child, *parent = parent_group->cg_item.dentry;
 
-	if (!group->item.k_name)
-		group->item.k_name = group->item.name;
-	name.name = group->item.k_name;
+	if (!group->cg_item.k_name)
+		group->cg_item.k_name = group->cg_item.name;
+	name.name = group->cg_item.k_name;
 	name.len = strlen(name.name);
 	name.hash = full_name_hash(name.name, name.len);
 
@@ -470,8 +470,8 @@
 	if (child) {
 		d_add(child, NULL);
 
-		ret = configfs_attach_group(&parent_group->item,
-					    &group->item, child);
+		ret = configfs_attach_group(&parent_group->cg_item,
+					    &group->cg_item, child);
 		if (!ret) {
 			sd = child->d_fsdata;
 			sd->s_type |= CONFIGFS_USET_DEFAULT;
@@ -487,7 +487,7 @@
 static int populate_groups(struct config_group *group)
 {
 	struct config_group *new_group;
-	struct dentry *dentry = group->item.dentry;
+	struct dentry *dentry = group->cg_item.dentry;
 	int ret = 0;
 	int i;
 
@@ -545,7 +545,7 @@
 	 * traversals much nicer. */
 	item->parent = parent_item;
 	item->group = config_group_get(to_config_group(parent_item));
-	list_add_tail(&item->entry, &item->group->list);
+	list_add_tail(&item->entry, &item->group->cg_list);
 
 	config_item_get(item);
 }
@@ -562,8 +562,8 @@
 		}
 	}
 
-	group->subsys = NULL;
-	unlink_obj(&group->item);
+	group->cg_subsys = NULL;
+	unlink_obj(&group->cg_item);
 }
 
 static void link_group(struct config_group *parent_group, struct config_group *group)
@@ -572,15 +572,15 @@
 	struct config_group *new_group;
 	struct configfs_subsystem *subsys = NULL; /* gcc is a turd */
 
-	link_obj(&parent_group->item, &group->item);
+	link_obj(&parent_group->cg_item, &group->cg_item);
 
-	if (parent_group->subsys)
-		subsys = parent_group->subsys;
-	else if (configfs_is_root(&parent_group->item))
+	if (parent_group->cg_subsys)
+		subsys = parent_group->cg_subsys;
+	else if (configfs_is_root(&parent_group->cg_item))
 		subsys = to_configfs_subsystem(group);
 	else
 		BUG();
-	group->subsys = subsys;
+	group->cg_subsys = subsys;
 
 	if (group->default_groups) {
 		for (i = 0; group->default_groups[i]; i++) {
@@ -700,7 +700,7 @@
 
 	parent_item = configfs_get_config_item(dentry->d_parent);
 	uktype = parent_item->ktype;
-	subsys = to_config_group(parent_item)->subsys;
+	subsys = to_config_group(parent_item)->cg_subsys;
 	BUG_ON(!subsys);
 
 	if (!uktype || !uktype->group_ops ||
@@ -725,7 +725,7 @@
 						 name);
 		if (group) {
 			link_group(to_config_group(parent_item), group);
-			item = &group->item;
+			item = &group->cg_item;
 		}
 	} else {
 		item = uktype->group_ops->make_item(to_config_group(parent_item), name);
@@ -790,7 +790,7 @@
 		return -EPERM;
 
 	parent_item = configfs_get_config_item(dentry->d_parent);
-	subsys = to_config_group(parent_item)->subsys;
+	subsys = to_config_group(parent_item)->cg_subsys;
 	BUG_ON(!subsys);
 
 	if (!parent_item->ktype) {
@@ -1045,15 +1045,15 @@
 	if (err)
 		return err;
 
-	if (!group->item.k_name)
-		group->item.k_name = group->item.name;
+	if (!group->cg_item.k_name)
+		group->cg_item.k_name = group->cg_item.name;
 
 	sd = configfs_sb->s_root->d_fsdata;
 	link_group(to_config_group(sd->s_element), group);
 
 	down(&configfs_sb->s_root->d_inode->i_sem);
 
-	name.name = group->item.k_name;
+	name.name = group->cg_item.k_name;
 	name.len = strlen(name.name);
 	name.hash = full_name_hash(name.name, name.len);
 
@@ -1064,7 +1064,7 @@
 	
 	d_add(dentry, NULL);
 
-	err = configfs_attach_group(sd->s_element, &group->item,
+	err = configfs_attach_group(sd->s_element, &group->cg_item,
 				    dentry);
 	if (!err)
 		dentry = NULL;
@@ -1086,7 +1086,7 @@
 void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
 {
 	struct config_group *group = &subsys->su_group;
-	struct dentry *dentry = group->item.dentry;
+	struct dentry *dentry = group->cg_item.dentry;
 
 	if (dentry->d_parent != configfs_sb->s_root) {
 		printk(KERN_ERR "configfs: Tried to unregister non-subsystem!\n");
@@ -1098,7 +1098,7 @@
 	if (configfs_detach_prep(dentry)) {
 		printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
 	}
-	configfs_detach_group(&group->item);
+	configfs_detach_group(&group->cg_item);
 	dentry->d_inode->i_flags |= S_DEAD;
 	up(&dentry->d_inode->i_sem);
 

Modified: trunk/fs/configfs/item.c
===================================================================
--- trunk/fs/configfs/item.c	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/configfs/item.c	2005-03-30 23:31:35 UTC (rev 2088)
@@ -168,8 +168,8 @@
 
 void config_group_init(struct config_group *group)
 {
-	config_item_init(&group->item);
-	INIT_LIST_HEAD(&group->list);
+	config_item_init(&group->cg_item);
+	INIT_LIST_HEAD(&group->cg_list);
 }
 
 
@@ -178,7 +178,7 @@
  *	@group:	group we're looking in.
  *	@name:	item's name.
  *
- *	Lock group via @group->subsys, and iterate over @group->list,
+ *	Lock group via @group->cg_subsys, and iterate over @group->cg_list,
  *	looking for a matching config_item. If matching item is found
  *	take a reference and return the item.
  */
@@ -189,7 +189,7 @@
 	struct config_item * ret = NULL;
 
         /* XXX LOCKING! */
-	list_for_each(entry,&group->list) {
+	list_for_each(entry,&group->cg_list) {
 		struct config_item * item = to_item(entry);
 		if (config_item_name(item) &&
                     !strcmp(config_item_name(item), name)) {

Modified: trunk/fs/configfs/mount.c
===================================================================
--- trunk/fs/configfs/mount.c	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/configfs/mount.c	2005-03-30 23:31:35 UTC (rev 2088)
@@ -52,29 +52,29 @@
 };
 
 static struct config_group configfs_root_group = {
-	.item = {
+	.cg_item = {
 		.name	= "root",
-		.k_name	= configfs_root_group.item.name,
+		.k_name	= configfs_root_group.cg_item.name,
 	},
 };
 
 int configfs_is_root(struct config_item *item)
 {
-	return item == &configfs_root_group.item;
+	return item == &configfs_root_group.cg_item;
 }
 
 static struct configfs_dirent configfs_root = {
 	.s_sibling	= LIST_HEAD_INIT(configfs_root.s_sibling),
 	.s_children	= LIST_HEAD_INIT(configfs_root.s_children),
-	.s_element	= &configfs_root_group.item,
+	.s_element	= &configfs_root_group.cg_item,
 	.s_type		= CONFIGFS_ROOT,
 };
 
 void config_group_init_type_name(struct config_group *group, const char *name,
 			 struct config_item_type *ktype)
 {
-	config_item_set_name(&group->item, name);
-	group->item.ktype = ktype;
+	config_item_set_name(&group->cg_item, name);
+	group->cg_item.ktype = ktype;
 	config_group_init(group);
 }
 EXPORT_SYMBOL(config_group_init_type_name);
@@ -108,7 +108,7 @@
 		return -ENOMEM;
 	}
 	config_group_init(&configfs_root_group);
-	configfs_root_group.item.dentry = root;
+	configfs_root_group.cg_item.dentry = root;
 	root->d_fsdata = &configfs_root;
 	sb->s_root = root;
 	return 0;

Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-30 21:08:40 UTC (rev 2087)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-30 23:31:35 UTC (rev 2088)
@@ -552,7 +552,7 @@
 static void nm_node_group_drop_item(struct config_group *group, struct config_item *item)
 {
 	struct nm_node *node = to_nm_node(item);
-	struct nm_cluster *cluster = to_nm_cluster(group->item.parent);
+	struct nm_cluster *cluster = to_nm_cluster(group->cg_item.parent);
 
 	net_stop_node_sock(node);
 
@@ -680,7 +680,7 @@
 	nm_single_cluster = NULL;
 
 	for (i = 0; cluster->cl_group.default_groups[i]; i++) {
-		killme = &cluster->cl_group.default_groups[i]->item;
+		killme = &cluster->cl_group.default_groups[i]->cg_item;
 		cluster->cl_group.default_groups[i] = NULL;
 		config_item_put(killme);
 	}
@@ -701,7 +701,7 @@
 static struct nm_cluster_group nm_cluster_group = {
 	.cs_subsys = {
 		.su_group = {
-			.item = {
+			.cg_item = {
 				.name = "cluster",
 				.ktype = &nm_cluster_group_type,
 			},



More information about the Ocfs2-commits mailing list