[Ocfs2-commits] jlbec commits r2093 - in trunk/fs: configfs
ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Mar 30 18:41:34 CST 2005
Author: jlbec
Signed-off-by: manish
Date: 2005-03-30 18:41:32 -0600 (Wed, 30 Mar 2005)
New Revision: 2093
Modified:
trunk/fs/configfs/bobtest.c
trunk/fs/configfs/configfs.h
trunk/fs/configfs/dir.c
trunk/fs/configfs/file.c
trunk/fs/configfs/item.c
trunk/fs/configfs/symlink.c
trunk/fs/ocfs2/cluster/heartbeat.c
trunk/fs/ocfs2/cluster/nodemanager.c
Log:
o Our attributes were conspicuously missing THIS_MODULE.
o Add structure namespacing to config_item_type.
Signed-off-by: manish
Modified: trunk/fs/configfs/bobtest.c
===================================================================
--- trunk/fs/configfs/bobtest.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/bobtest.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -60,7 +60,7 @@
}
static struct robert_attribute robert_attr_print = {
- .attr = { .ca_name = "print", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "print", .ca_mode = S_IRUGO },
.show = robert_print_read,
};
@@ -95,9 +95,9 @@
};
static struct config_item_type uktype_robert = {
- .item_ops = &robert_item_ops,
- .attrs = robert_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &robert_item_ops,
+ .ct_attrs = robert_attrs,
+ .ct_owner = THIS_MODULE,
};
static struct robert robert = {
@@ -162,11 +162,11 @@
}
static struct bob_attribute bob_attr_showme = {
- .attr = { .ca_name = "showme", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
.show = bob_showme_read,
};
static struct bob_attribute bob_attr_storeme = {
- .attr = { .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
.show = bob_storeme_read,
.store = bob_storeme_write,
};
@@ -217,9 +217,9 @@
};
static struct config_item_type uktype_bob = {
- .item_ops = &bob_item_ops,
- .attrs = bob_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &bob_item_ops,
+ .ct_attrs = bob_attrs,
+ .ct_owner = THIS_MODULE,
};
@@ -261,7 +261,7 @@
}
static struct bobset_attribute bobset_attr_bobs = {
- .attr = { .ca_name = "bobs", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "bobs", .ca_mode = S_IRUGO },
.show = bobset_bobs_read
};
@@ -313,9 +313,9 @@
};
static struct config_item_type uktype_bobset = {
- .item_ops = &bobset_item_ops,
- .group_ops = &bobset_group_ops,
- .attrs = bobset_attrs,
+ .ct_item_ops = &bobset_item_ops,
+ .ct_group_ops = &bobset_group_ops,
+ .ct_attrs = bobset_attrs,
};
static struct bobset bobset = {
@@ -387,11 +387,11 @@
}
static struct jerry_attribute jerry_attr_showme = {
- .attr = { .ca_name = "showme", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
.show = jerry_showme_read,
};
static struct jerry_attribute jerry_attr_storeme = {
- .attr = { .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
.show = jerry_storeme_read,
.store = jerry_storeme_write,
};
@@ -453,9 +453,9 @@
};
static struct config_item_type uktype_jerry = {
- .item_ops = &jerry_item_ops,
- .attrs = jerry_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &jerry_item_ops,
+ .ct_attrs = jerry_attrs,
+ .ct_owner = THIS_MODULE,
};
struct tom {
@@ -511,11 +511,11 @@
}
static struct tom_attribute tom_attr_showme = {
- .attr = { .ca_name = "showme", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
.show = tom_showme_read,
};
static struct tom_attribute tom_attr_storeme = {
- .attr = { .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
.show = tom_storeme_read,
.store = tom_storeme_write,
};
@@ -570,9 +570,9 @@
};
static struct config_item_type uktype_tom = {
- .item_ops = &tom_item_ops,
- .attrs = tom_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &tom_item_ops,
+ .ct_attrs = tom_attrs,
+ .ct_owner = THIS_MODULE,
};
@@ -614,7 +614,7 @@
}
static struct tomset_attribute tomset_attr_toms = {
- .attr = { .ca_name = "toms", .ca_mode = S_IRUGO },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "toms", .ca_mode = S_IRUGO },
.show = tomset_toms_read
};
@@ -685,9 +685,9 @@
};
static struct config_item_type uktype_tomset = {
- .item_ops = &tomset_item_ops,
- .group_ops = &tomset_group_ops,
- .attrs = tomset_attrs,
+ .ct_item_ops = &tomset_item_ops,
+ .ct_group_ops = &tomset_group_ops,
+ .ct_attrs = tomset_attrs,
};
static struct tomset tomset = {
Modified: trunk/fs/configfs/configfs.h
===================================================================
--- trunk/fs/configfs/configfs.h 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/configfs.h 2005-03-31 00:41:32 UTC (rev 2093)
@@ -81,10 +81,10 @@
extern void config_item_put(struct config_item *);
struct config_item_type {
- struct module *owner;
- struct configfs_item_operations *item_ops;
- struct configfs_group_operations *group_ops;
- struct configfs_attribute **attrs;
+ struct module *ct_owner;
+ struct configfs_item_operations *ct_item_ops;
+ struct configfs_group_operations *ct_group_ops;
+ struct configfs_attribute **ct_attrs;
};
@@ -167,20 +167,22 @@
* for examples..
*/
+#if 0
#define __ATTR(_name,_mode,_show,_store) { \
- .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
+ .attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
}
#define __ATTR_RO(_name) { \
- .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \
+ .attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
.show = _name##_show, \
}
#define __ATTR_NULL { .attr = { .name = NULL } }
#define attr_name(_attr) (_attr).attr.name
+#endif
struct configfs_subsystem {
Modified: trunk/fs/configfs/dir.c
===================================================================
--- trunk/fs/configfs/dir.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/dir.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -385,8 +385,8 @@
if (!t)
return -EINVAL;
- if (t->attrs) {
- for (i = 0; (attr = t->attrs[i]) != NULL; i++) {
+ if (t->ct_attrs) {
+ for (i = 0; (attr = t->ct_attrs[i]) != NULL; i++) {
if ((error = configfs_create_file(item, attr)))
break;
}
@@ -671,9 +671,9 @@
uktype = parent_item->ktype;
BUG_ON(!uktype);
- if (uktype->group_ops && uktype->group_ops->drop_item)
- uktype->group_ops->drop_item(to_config_group(parent_item),
- item);
+ if (uktype->ct_group_ops && uktype->ct_group_ops->drop_item)
+ uktype->ct_group_ops->drop_item(to_config_group(parent_item),
+ item);
else
config_item_put(item);
}
@@ -703,9 +703,9 @@
subsys = to_config_group(parent_item)->cg_subsys;
BUG_ON(!subsys);
- if (!uktype || !uktype->group_ops ||
- (!uktype->group_ops->make_group &&
- !uktype->group_ops->make_item)) {
+ if (!uktype || !uktype->ct_group_ops ||
+ (!uktype->ct_group_ops->make_group &&
+ !uktype->ct_group_ops->make_item)) {
config_item_put(parent_item);
return -EPERM; /* What lack-of-mkdir returns */
}
@@ -720,15 +720,14 @@
down(&subsys->su_sem);
group = NULL;
item = NULL;
- if (uktype->group_ops->make_group) {
- group = uktype->group_ops->make_group(to_config_group(parent_item),
- name);
+ if (uktype->ct_group_ops->make_group) {
+ group = uktype->ct_group_ops->make_group(to_config_group(parent_item), name);
if (group) {
link_group(to_config_group(parent_item), group);
item = &group->cg_item;
}
} else {
- item = uktype->group_ops->make_item(to_config_group(parent_item), name);
+ item = uktype->ct_group_ops->make_item(to_config_group(parent_item), name);
if (item)
link_obj(parent_item, item);
}
@@ -743,7 +742,7 @@
ret = -EINVAL;
uktype = item->ktype;
if (uktype) {
- owner = uktype->owner;
+ owner = uktype->ct_owner;
if (try_module_get(owner)) {
if (group) {
ret = configfs_attach_group(parent_item,
@@ -811,7 +810,7 @@
config_item_put(parent_item);
if (item->ktype)
- owner = item->ktype->owner;
+ owner = item->ktype->ct_owner;
if (sd->s_type & CONFIGFS_USET_DIR) {
configfs_detach_group(item);
Modified: trunk/fs/configfs/file.c
===================================================================
--- trunk/fs/configfs/file.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/file.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -249,7 +249,7 @@
* itself, and use ops for it.
*/
if (item->ktype)
- ops = item->ktype->item_ops;
+ ops = item->ktype->ct_item_ops;
else
goto Eaccess;
Modified: trunk/fs/configfs/item.c
===================================================================
--- trunk/fs/configfs/item.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/item.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -154,8 +154,8 @@
if (item->k_name != item->name)
kfree(item->k_name);
item->k_name = NULL;
- if (t && t->item_ops && t->item_ops->release)
- t->item_ops->release(item);
+ if (t && t->ct_item_ops && t->ct_item_ops->release)
+ t->ct_item_ops->release(item);
if (s)
config_group_put(s);
if (parent)
Modified: trunk/fs/configfs/symlink.c
===================================================================
--- trunk/fs/configfs/symlink.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/configfs/symlink.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -129,15 +129,15 @@
parent_item = configfs_get_config_item(dentry->d_parent);
uktype = parent_item->ktype;
- if (!uktype || !uktype->item_ops ||
- !uktype->item_ops->allow_link)
+ if (!uktype || !uktype->ct_item_ops ||
+ !uktype->ct_item_ops->allow_link)
goto out_put;
ret = get_target(symname, &nd, &target_item);
if (ret)
goto out_put;
- ret = uktype->item_ops->allow_link(parent_item, target_item);
+ ret = uktype->ct_item_ops->allow_link(parent_item, target_item);
if (!ret)
ret = create_link(parent_item, target_item, dentry);
@@ -181,10 +181,10 @@
* list_del_init(&sl->sl_list), so that the order of
* drop_link(this, target) and drop_item(target) is preserved.
*/
- if (uktype && uktype->item_ops &&
- uktype->item_ops->drop_link)
- uktype->item_ops->drop_link(parent_item,
- sl->sl_target);
+ if (uktype && uktype->ct_item_ops &&
+ uktype->ct_item_ops->drop_link)
+ uktype->ct_item_ops->drop_link(parent_item,
+ sl->sl_target);
/* FIXME: Needs lock */
list_del_init(&sl->sl_list);
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -638,22 +638,22 @@
};
static struct hb_region_attribute hb_region_attr_block_bytes = {
- .attr = { .ca_name = "block_bytes", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "block_bytes", .ca_mode = S_IRUGO | S_IWUSR },
.show = hb_region_block_bytes_read,
.store = hb_region_block_bytes_write,
};
static struct hb_region_attribute hb_region_attr_start_block = {
- .attr = { .ca_name = "start_block", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "start_block", .ca_mode = S_IRUGO | S_IWUSR },
.show = hb_region_start_block_read,
.store = hb_region_start_block_write,
};
static struct hb_region_attribute hb_region_attr_blocks = {
- .attr = { .ca_name = "blocks", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "blocks", .ca_mode = S_IRUGO | S_IWUSR },
.show = hb_region_blocks_read,
.store = hb_region_blocks_write,
};
static struct hb_region_attribute hb_region_attr_dev = {
- .attr = { .ca_name = "dev", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "dev", .ca_mode = S_IRUGO | S_IWUSR },
.show = hb_region_dev_read,
.store = hb_region_dev_write,
};
@@ -701,9 +701,9 @@
};
static struct config_item_type hb_region_type = {
- .item_ops = &hb_region_item_ops,
- .attrs = hb_region_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &hb_region_item_ops,
+ .ct_attrs = hb_region_attrs,
+ .ct_owner = THIS_MODULE,
};
/* heartbeat set */
@@ -769,8 +769,8 @@
};
struct config_item_type hb_heartbeat_group_type = {
- .group_ops = &hb_heartbeat_group_group_ops,
- .owner = THIS_MODULE,
+ .ct_group_ops = &hb_heartbeat_group_group_ops,
+ .ct_owner = THIS_MODULE,
};
/* this is just here to avoid touching group in heartbeat.h which the
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-31 00:31:33 UTC (rev 2092)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-31 00:41:32 UTC (rev 2093)
@@ -400,22 +400,22 @@
};
static struct nm_node_attribute nm_node_attr_num = {
- .attr = { .ca_name = "num", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "num", .ca_mode = S_IRUGO | S_IWUSR },
.show = nm_node_num_read,
.store = nm_node_num_write,
};
static struct nm_node_attribute nm_node_attr_ipv4_port = {
- .attr = { .ca_name = "ipv4_port", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "ipv4_port", .ca_mode = S_IRUGO | S_IWUSR },
.show = nm_node_ipv4_port_read,
.store = nm_node_ipv4_port_write,
};
static struct nm_node_attribute nm_node_attr_ipv4_address = {
- .attr = { .ca_name = "ipv4_address", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "ipv4_address", .ca_mode = S_IRUGO | S_IWUSR },
.show = nm_node_ipv4_address_read,
.store = nm_node_ipv4_address_write,
};
static struct nm_node_attribute nm_node_attr_local = {
- .attr = { .ca_name = "local", .ca_mode = S_IRUGO | S_IWUSR },
+ .attr = { .ca_owner = THIS_MODULE, .ca_name = "local", .ca_mode = S_IRUGO | S_IWUSR },
.show = nm_node_local_read,
.store = nm_node_local_write,
};
@@ -486,9 +486,9 @@
};
static struct config_item_type nm_node_type = {
- .item_ops = &nm_node_item_ops,
- .attrs = nm_node_attrs,
- .owner = THIS_MODULE,
+ .ct_item_ops = &nm_node_item_ops,
+ .ct_attrs = nm_node_attrs,
+ .ct_owner = THIS_MODULE,
};
/* node set */
@@ -585,8 +585,8 @@
};
static struct config_item_type nm_node_group_type = {
- .group_ops = &nm_node_group_group_ops,
- .owner = THIS_MODULE,
+ .ct_group_ops = &nm_node_group_group_ops,
+ .ct_owner = THIS_MODULE,
};
/* cluster */
@@ -604,8 +604,8 @@
};
static struct config_item_type nm_cluster_type = {
- .item_ops = &nm_cluster_item_ops,
- .owner = THIS_MODULE,
+ .ct_item_ops = &nm_cluster_item_ops,
+ .ct_owner = THIS_MODULE,
};
/* cluster set */
@@ -692,8 +692,8 @@
};
static struct config_item_type nm_cluster_group_type = {
- .group_ops = &nm_cluster_group_group_ops,
- .owner = THIS_MODULE,
+ .ct_group_ops = &nm_cluster_group_group_ops,
+ .ct_owner = THIS_MODULE,
};
static struct nm_cluster_group nm_cluster_group = {
More information about the Ocfs2-commits
mailing list