[Ocfs2-commits] jlbec commits r2082 - in trunk/fs: configfs
ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Mar 30 12:54:05 CST 2005
Author: jlbec
Signed-off-by: manish
Date: 2005-03-30 12:54:04 -0600 (Wed, 30 Mar 2005)
New Revision: 2082
Modified:
trunk/fs/configfs/bobtest.c
trunk/fs/configfs/configfs.h
trunk/fs/configfs/configfs_internal.h
trunk/fs/configfs/dir.c
trunk/fs/configfs/file.c
trunk/fs/configfs/mount.c
trunk/fs/configfs/symlink.c
trunk/fs/configfs/uobject.c
trunk/fs/ocfs2/cluster/heartbeat.c
trunk/fs/ocfs2/cluster/nodemanager.c
trunk/fs/ocfs2/cluster/nodemanager.h
Log:
o Rename struct uobject to struct config_item.
Signed-off-by: manish
Modified: trunk/fs/configfs/bobtest.c
===================================================================
--- trunk/fs/configfs/bobtest.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/bobtest.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -43,10 +43,10 @@
ssize_t (*show)(struct robert *, char *);
};
-static inline struct robert *to_robert(struct uobject *uobj)
+static inline struct robert *to_robert(struct config_item *item)
{
- return uobj ?
- container_of(to_uset(uobj), struct robert, uset) :
+ return item ?
+ container_of(to_uset(item), struct robert, uset) :
NULL;
}
@@ -69,11 +69,11 @@
NULL,
};
-static ssize_t robert_attr_show(struct uobject *uobj,
+static ssize_t robert_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct robert *robert = to_robert(uobj);
+ struct robert *robert = to_robert(item);
struct robert_attribute *robert_attr =
container_of(attr, struct robert_attribute, attr);
ssize_t ret = 0;
@@ -83,26 +83,26 @@
return ret;
}
-static void robert_release(struct uobject *uobj)
+static void robert_release(struct config_item *item)
{
printk("We shall welease, Wobewt!\n");
- kfree(to_robert(uobj));
+ kfree(to_robert(item));
}
-static struct configfs_object_operations robert_object_ops = {
+static struct configfs_item_operations robert_item_ops = {
.release = robert_release,
.show_attribute = robert_attr_show,
};
-static struct uobj_type uktype_robert = {
- .object_ops = &robert_object_ops,
+static struct config_item_type uktype_robert = {
+ .item_ops = &robert_item_ops,
.attrs = robert_attrs,
.owner = THIS_MODULE,
};
static struct robert robert = {
.uset = {
- .uobj = {
+ .item = {
.name = "robert",
.ktype = &uktype_robert,
},
@@ -112,7 +112,7 @@
struct bob {
- struct uobject uobj;
+ struct config_item item;
int showme;
int storeme;
};
@@ -123,9 +123,9 @@
ssize_t (*store)(struct bob *, const char *, size_t);
};
-static inline struct bob *to_bob(struct uobject *uobj)
+static inline struct bob *to_bob(struct config_item *item)
{
- return uobj ? container_of(uobj, struct bob, uobj) : NULL;
+ return item ? container_of(item, struct bob, item) : NULL;
}
static ssize_t bob_showme_read(struct bob *bob, char *page)
@@ -176,11 +176,11 @@
NULL,
};
-static ssize_t bob_attr_show(struct uobject *uobj,
+static ssize_t bob_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct bob *bob = to_bob(uobj);
+ struct bob *bob = to_bob(item);
struct bob_attribute *bob_attr =
container_of(attr, struct bob_attribute, attr);
ssize_t ret = 0;
@@ -190,11 +190,11 @@
return ret;
}
-static ssize_t bob_attr_store(struct uobject *uobj,
+static ssize_t bob_attr_store(struct config_item *item,
struct configfs_attribute *attr,
const char *page, size_t count)
{
- struct bob *bob = to_bob(uobj);
+ struct bob *bob = to_bob(item);
struct bob_attribute *bob_attr =
container_of(attr, struct bob_attribute, attr);
ssize_t ret = -EINVAL;
@@ -204,20 +204,20 @@
return ret;
}
-static void bob_release(struct uobject *uobj)
+static void bob_release(struct config_item *item)
{
printk("Yeah, uh, we'll talk to Bob\n");
- kfree(to_bob(uobj));
+ kfree(to_bob(item));
}
-static struct configfs_object_operations bob_object_ops = {
+static struct configfs_item_operations bob_item_ops = {
.release = bob_release,
.show_attribute = bob_attr_show,
.store_attribute = bob_attr_store,
};
-static struct uobj_type uktype_bob = {
- .object_ops = &bob_object_ops,
+static struct config_item_type uktype_bob = {
+ .item_ops = &bob_item_ops,
.attrs = bob_attrs,
.owner = THIS_MODULE,
};
@@ -240,11 +240,11 @@
NULL;
}
-static ssize_t bobset_attr_show(struct uobject *uobj,
+static ssize_t bobset_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct bobset *bobset = to_bobset(to_uset(uobj));
+ struct bobset *bobset = to_bobset(to_uset(item));
struct bobset_attribute *bobset_attr =
container_of(attr, struct bobset_attribute, attr);
ssize_t ret = 0;
@@ -275,7 +275,7 @@
NULL,
};
-static struct uobject *make_bob(struct uset *uset, const char *name)
+static struct config_item *make_bob(struct uset *uset, const char *name)
{
struct bobset *bobset = to_bobset(uset);
struct bob *bob;
@@ -286,36 +286,36 @@
memset(bob, 0, sizeof(struct bob));
- uobject_set_name(&bob->uobj, name);
- bob->uobj.ktype = &uktype_bob;
- uobject_init(&bob->uobj);
+ config_item_set_name(&bob->item, name);
+ bob->item.ktype = &uktype_bob;
+ config_item_init(&bob->item);
bob->showme = 0;
bob->storeme = 0;
bobset->n_bobs++;
- return &bob->uobj;
+ return &bob->item;
}
-static void drop_bob(struct uset *uset, struct uobject *uobj)
+static void drop_bob(struct uset *uset, struct config_item *item)
{
struct bobset *bobset = to_bobset(uset);
bobset->n_bobs--;
- uobject_put(uobj);
+ config_item_put(item);
}
-static struct configfs_object_operations bobset_object_ops = {
+static struct configfs_item_operations bobset_item_ops = {
.show_attribute = bobset_attr_show,
};
static struct configfs_set_operations bobset_set_ops = {
- .make_object = make_bob,
- .drop_object = drop_bob,
+ .make_item = make_bob,
+ .drop_item = drop_bob,
};
-static struct uobj_type uktype_bobset = {
- .object_ops = &bobset_object_ops,
+static struct config_item_type uktype_bobset = {
+ .item_ops = &bobset_item_ops,
.set_ops = &bobset_set_ops,
.attrs = bobset_attrs,
};
@@ -323,7 +323,7 @@
static struct bobset bobset = {
.subsys = {
.su_set = {
- .uobj = {
+ .item = {
.name = "bobset",
.ktype = &uktype_bobset,
},
@@ -348,10 +348,10 @@
ssize_t (*store)(struct jerry *, const char *, size_t);
};
-static inline struct jerry *to_jerry(struct uobject *uobj)
+static inline struct jerry *to_jerry(struct config_item *item)
{
- return uobj ?
- container_of(to_uset(uobj), struct jerry, uset) :
+ return item ?
+ container_of(to_uset(item), struct jerry, uset) :
NULL;
}
@@ -403,11 +403,11 @@
NULL,
};
-static ssize_t jerry_attr_show(struct uobject *uobj,
+static ssize_t jerry_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct jerry *jerry = to_jerry(uobj);
+ struct jerry *jerry = to_jerry(item);
struct jerry_attribute *jerry_attr =
container_of(attr, struct jerry_attribute, attr);
ssize_t ret = 0;
@@ -417,11 +417,11 @@
return ret;
}
-static ssize_t jerry_attr_store(struct uobject *uobj,
+static ssize_t jerry_attr_store(struct config_item *item,
struct configfs_attribute *attr,
const char *page, size_t count)
{
- struct jerry *jerry = to_jerry(uobj);
+ struct jerry *jerry = to_jerry(item);
struct jerry_attribute *jerry_attr =
container_of(attr, struct jerry_attribute, attr);
ssize_t ret = -EINVAL;
@@ -431,13 +431,13 @@
return ret;
}
-static void jerry_release(struct uobject *uobj)
+static void jerry_release(struct config_item *item)
{
printk("Show me the money!\n");
- kfree(to_jerry(uobj));
+ kfree(to_jerry(item));
}
-static int jerry_allow_link(struct uobject *src, struct uobject *target)
+static int jerry_allow_link(struct config_item *src, struct config_item *target)
{
int ret = 0;
@@ -447,15 +447,15 @@
return ret;
}
-static struct configfs_object_operations jerry_object_ops = {
+static struct configfs_item_operations jerry_item_ops = {
.release = jerry_release,
.show_attribute = jerry_attr_show,
.store_attribute = jerry_attr_store,
.allow_link = jerry_allow_link,
};
-static struct uobj_type uktype_jerry = {
- .object_ops = &jerry_object_ops,
+static struct config_item_type uktype_jerry = {
+ .item_ops = &jerry_item_ops,
.attrs = jerry_attrs,
.owner = THIS_MODULE,
};
@@ -472,10 +472,10 @@
ssize_t (*store)(struct tom *, const char *, size_t);
};
-static inline struct tom *to_tom(struct uobject *uobj)
+static inline struct tom *to_tom(struct config_item *item)
{
- return uobj ?
- container_of(to_uset(uobj), struct tom, uset) :
+ return item ?
+ container_of(to_uset(item), struct tom, uset) :
NULL;
}
@@ -527,11 +527,11 @@
NULL,
};
-static ssize_t tom_attr_show(struct uobject *uobj,
+static ssize_t tom_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct tom *tom = to_tom(uobj);
+ struct tom *tom = to_tom(item);
struct tom_attribute *tom_attr =
container_of(attr, struct tom_attribute, attr);
ssize_t ret = 0;
@@ -541,11 +541,11 @@
return ret;
}
-static ssize_t tom_attr_store(struct uobject *uobj,
+static ssize_t tom_attr_store(struct config_item *item,
struct configfs_attribute *attr,
const char *page, size_t count)
{
- struct tom *tom = to_tom(uobj);
+ struct tom *tom = to_tom(item);
struct tom_attribute *tom_attr =
container_of(attr, struct tom_attribute, attr);
ssize_t ret = -EINVAL;
@@ -556,23 +556,23 @@
}
-static void tom_release(struct uobject *uobj)
+static void tom_release(struct config_item *item)
{
- struct tom *tom = to_tom(uobj);
+ struct tom *tom = to_tom(item);
printk("Oooh, that's gonna leave a mark!\n");
kfree(tom->uset.default_sets);
kfree(tom);
}
-static struct configfs_object_operations tom_object_ops = {
+static struct configfs_item_operations tom_item_ops = {
.release = tom_release,
.show_attribute = tom_attr_show,
.store_attribute = tom_attr_store,
};
-static struct uobj_type uktype_tom = {
- .object_ops = &tom_object_ops,
+static struct config_item_type uktype_tom = {
+ .item_ops = &tom_item_ops,
.attrs = tom_attrs,
.owner = THIS_MODULE,
};
@@ -595,11 +595,11 @@
NULL;
}
-static ssize_t tomset_attr_show(struct uobject *uobj,
+static ssize_t tomset_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct tomset *tomset = to_tomset(to_uset(uobj));
+ struct tomset *tomset = to_tomset(to_uset(item));
struct tomset_attribute *tomset_attr =
container_of(attr, struct tomset_attribute, attr);
ssize_t ret = 0;
@@ -652,16 +652,16 @@
memset(jerry, 0, sizeof(struct jerry));
- uobject_set_name(&tom->uset.uobj, name);
- tom->uset.uobj.ktype = &uktype_tom;
+ config_item_set_name(&tom->uset.item, name);
+ tom->uset.item.ktype = &uktype_tom;
uset_init(&tom->uset);
tom->showme = 0;
tom->storeme = 0;
tomset->n_toms++;
- uobject_set_name(&jerry->uset.uobj, "jer");
- jerry->uset.uobj.ktype = &uktype_jerry;
+ config_item_set_name(&jerry->uset.item, "jer");
+ jerry->uset.item.ktype = &uktype_jerry;
uset_init(&jerry->uset);
tom->uset.default_sets[0] = &jerry->uset;
@@ -670,28 +670,28 @@
return &tom->uset;
}
-static void drop_tom(struct uset *uset, struct uobject *uobj)
+static void drop_tom(struct uset *uset, struct config_item *item)
{
struct tomset *tomset = to_tomset(uset);
- struct tom *tom = to_tom(uobj);
+ struct tom *tom = to_tom(item);
- uobject_put(&tom->uset.default_sets[0]->uobj);
+ config_item_put(&tom->uset.default_sets[0]->item);
tomset->n_toms--;
- uobject_put(uobj);
+ config_item_put(item);
}
-static struct configfs_object_operations tomset_object_ops = {
+static struct configfs_item_operations tomset_item_ops = {
.show_attribute = tomset_attr_show,
};
static struct configfs_set_operations tomset_set_ops = {
.make_set = make_tom,
- .drop_object = drop_tom,
+ .drop_item = drop_tom,
};
-static struct uobj_type uktype_tomset = {
- .object_ops = &tomset_object_ops,
+static struct config_item_type uktype_tomset = {
+ .item_ops = &tomset_item_ops,
.set_ops = &tomset_set_ops,
.attrs = tomset_attrs,
};
@@ -699,7 +699,7 @@
static struct tomset tomset = {
.subsys = {
.su_set = {
- .uobj = {
+ .item = {
.name = "tomset",
.ktype = &uktype_tomset,
},
Modified: trunk/fs/configfs/configfs.h
===================================================================
--- trunk/fs/configfs/configfs.h 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/configfs.h 2005-03-30 18:54:04 UTC (rev 2082)
@@ -29,7 +29,7 @@
*
* Please read Documentation/filesystems/configfs.txt before using the
* configfs interface, ESPECIALLY the parts about reference counts and
- * object destructors.
+ * item destructors.
*/
#ifndef _CONFIGFS_H_
@@ -48,50 +48,50 @@
struct module;
-struct configfs_object_operations;
+struct configfs_item_operations;
struct configfs_set_operations;
struct configfs_attribute;
struct configfs_subsystem;
-struct uobject {
+struct config_item {
char *k_name;
char name[UOBJ_NAME_LEN];
struct kref kref;
struct list_head entry;
- struct uobject *parent;
+ struct config_item *parent;
struct uset *uset;
- struct uobj_type *ktype;
+ struct config_item_type *ktype;
struct dentry *dentry;
};
-extern int uobject_set_name(struct uobject *, const char *, ...);
+extern int config_item_set_name(struct config_item *, const char *, ...);
-static inline char *uobject_name(struct uobject * uobj)
+static inline char *config_item_name(struct config_item * item)
{
- return uobj->k_name;
+ return item->k_name;
}
-extern void uobject_init(struct uobject *);
-extern void uobject_cleanup(struct uobject *);
+extern void config_item_init(struct config_item *);
+extern void config_item_cleanup(struct config_item *);
-extern struct uobject * uobject_get(struct uobject *);
-extern void uobject_put(struct uobject *);
+extern struct config_item * config_item_get(struct config_item *);
+extern void config_item_put(struct config_item *);
-struct uobj_type {
+struct config_item_type {
struct module *owner;
- struct configfs_object_operations *object_ops;
+ struct configfs_item_operations *item_ops;
struct configfs_set_operations *set_ops;
struct configfs_attribute **attrs;
};
/**
- * uset - a set of uobjects of a specific type, belonging
+ * uset - a set of config_items of a specific type, belonging
* to a specific subsystem.
*/
struct uset {
- struct uobject uobj;
+ struct config_item item;
struct list_head list;
struct configfs_subsystem *subsys;
struct uset **default_sets;
@@ -100,25 +100,25 @@
extern void uset_init(struct uset *set);
extern void uset_init_type_name(struct uset *uset, const char *name,
- struct uobj_type *ktype);
+ struct config_item_type *ktype);
-static inline struct uset *to_uset(struct uobject *uobj)
+static inline struct uset *to_uset(struct config_item *item)
{
- return uobj ? container_of(uobj,struct uset,uobj) : NULL;
+ return item ? container_of(item,struct uset,item) : NULL;
}
static inline struct uset *uset_get(struct uset *set)
{
- return set ? to_uset(uobject_get(&set->uobj)) : NULL;
+ return set ? to_uset(config_item_get(&set->item)) : NULL;
}
static inline void uset_put(struct uset *set)
{
- uobject_put(&set->uobj);
+ config_item_put(&set->item);
}
-extern struct uobject *uset_find_obj(struct uset *, const char *);
+extern struct config_item *uset_find_obj(struct uset *, const char *);
struct configfs_attribute {
@@ -131,29 +131,29 @@
/*
* If allow_link() exists, the object can symlink(2) out to other
* objects. If the object is a uset, it may support mkdir(2). Uset
- * objects supply one of make_set() and make_object(). If the
+ * objects supply one of make_set() and make_item(). If the
* object supports make_set(), one can create uset children. If it
- * supports make_object(), one can create uobject children. If it has
+ * supports make_item(), one can create config_item children. If it has
* default_sets on uset->default_sets, it has automatically created
* uset children. default_sets may coexist alongsize make_set() or
- * make_object(), but if the uset wishes to have only default_sets
+ * make_item(), but if the uset wishes to have only default_sets
* children (disallowing mkdir(2)), it need not provide either function.
* If the uset has commit(), it supports pending and commited (active)
* objects.
*/
-struct configfs_object_operations {
- void (*release)(struct uobject *);
- ssize_t (*show_attribute)(struct uobject *, struct configfs_attribute *,char *);
- ssize_t (*store_attribute)(struct uobject *,struct configfs_attribute *,const char *, size_t);
- int (*allow_link)(struct uobject *src, struct uobject *target);
- int (*drop_link)(struct uobject *src, struct uobject *target);
+struct configfs_item_operations {
+ void (*release)(struct config_item *);
+ ssize_t (*show_attribute)(struct config_item *, struct configfs_attribute *,char *);
+ ssize_t (*store_attribute)(struct config_item *,struct configfs_attribute *,const char *, size_t);
+ int (*allow_link)(struct config_item *src, struct config_item *target);
+ int (*drop_link)(struct config_item *src, struct config_item *target);
};
struct configfs_set_operations {
- struct uobject *(*make_object)(struct uset *uset, const char *name);
+ struct config_item *(*make_item)(struct uset *uset, const char *name);
struct uset *(*make_set)(struct uset *uset, const char *name);
- int (*commit_object)(struct uobject *uobj);
- void (*drop_object)(struct uset *uset, struct uobject *uobj);
+ int (*commit_item)(struct config_item *item);
+ void (*drop_item)(struct uset *uset, struct config_item *item);
};
Modified: trunk/fs/configfs/configfs_internal.h
===================================================================
--- trunk/fs/configfs/configfs_internal.h 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/configfs_internal.h 2005-03-30 18:54:04 UTC (rev 2082)
@@ -53,12 +53,12 @@
extern struct vfsmount * configfs_mount;
-extern int configfs_is_root(struct uobject *uobj);
+extern int configfs_is_root(struct config_item *item);
extern struct inode * configfs_new_inode(mode_t mode);
extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *));
-extern int configfs_create_file(struct uobject *, const struct configfs_attribute *);
+extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
extern int configfs_make_dirent(struct configfs_dirent *,
struct dentry *, void *, umode_t, int);
extern struct dentry * configfs_get_dentry(struct dentry *, const char *);
@@ -86,17 +86,17 @@
struct configfs_symlink {
struct list_head sl_list;
- struct uobject *sl_target;
+ struct config_item *sl_target;
};
extern int configfs_create_link(struct configfs_symlink *sl,
struct dentry *parent,
struct dentry *dentry);
-static inline struct uobject * to_uobj(struct dentry * dentry)
+static inline struct config_item * to_item(struct dentry * dentry)
{
struct configfs_dirent * sd = dentry->d_fsdata;
- return ((struct uobject *) sd->s_element);
+ return ((struct config_item *) sd->s_element);
}
static inline struct configfs_attribute * to_attr(struct dentry * dentry)
@@ -105,22 +105,22 @@
return ((struct configfs_attribute *) sd->s_element);
}
-static inline struct uobject *configfs_get_uobject(struct dentry *dentry)
+static inline struct config_item *configfs_get_config_item(struct dentry *dentry)
{
- struct uobject * uobj = NULL;
+ struct config_item * item = NULL;
spin_lock(&dcache_lock);
if (!d_unhashed(dentry)) {
struct configfs_dirent * sd = dentry->d_fsdata;
if (sd->s_type & CONFIGFS_UOBJ_LINK) {
struct configfs_symlink * sl = sd->s_element;
- uobj = uobject_get(sl->sl_target);
+ item = config_item_get(sl->sl_target);
} else
- uobj = uobject_get(sd->s_element);
+ item = config_item_get(sd->s_element);
}
spin_unlock(&dcache_lock);
- return uobj;
+ return item;
}
static inline void release_configfs_dirent(struct configfs_dirent * sd)
Modified: trunk/fs/configfs/dir.c
===================================================================
--- trunk/fs/configfs/dir.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/dir.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -132,7 +132,7 @@
return 0;
}
-static int create_dir(struct uobject * k, struct dentry * p,
+static int create_dir(struct config_item * k, struct dentry * p,
struct dentry * d)
{
int error;
@@ -152,28 +152,28 @@
/**
- * configfs_create_dir - create a directory for an object.
- * @parent: parent parent object.
- * @uobj: object we're creating directory for.
+ * configfs_create_dir - create a directory for an config_item.
+ * @item: config_itemwe're creating directory for.
+ * @dentry: config_item's dentry.
*/
-static int configfs_create_dir(struct uobject * uobj, struct dentry *dentry)
+static int configfs_create_dir(struct config_item * item, struct dentry *dentry)
{
struct dentry * parent;
int error = 0;
- BUG_ON(!uobj);
+ BUG_ON(!item);
- if (uobj->parent)
- parent = uobj->parent->dentry;
+ if (item->parent)
+ parent = item->parent->dentry;
else if (configfs_mount && configfs_mount->mnt_sb)
parent = configfs_mount->mnt_sb->s_root;
else
return -EFAULT;
- error = create_dir(uobj,parent,dentry);
+ error = create_dir(item,parent,dentry);
if (!error)
- uobj->dentry = dentry;
+ item->dentry = dentry;
return error;
}
@@ -212,17 +212,17 @@
}
/**
- * configfs_remove_dir - remove an object's directory.
- * @uobj: object.
+ * configfs_remove_dir - remove an config_item's directory.
+ * @item: config_item we're removing.
*
- * The only thing special about this is that we remove any files in
- * the directory before we remove the directory, and we've inlined
- * what used to be configfs_rmdir() below, instead of calling separately.
+ * The only thing special about this is that we remove any files in
+ * the directory before we remove the directory, and we've inlined
+ * what used to be configfs_rmdir() below, instead of calling separately.
*/
-static void configfs_remove_dir(struct uobject * uobj)
+static void configfs_remove_dir(struct config_item * item)
{
- struct dentry * dentry = dget(uobj->dentry);
+ struct dentry * dentry = dget(item->dentry);
if (!dentry)
return;
@@ -349,9 +349,9 @@
}
}
-static void detach_attrs(struct uobject * uobj)
+static void detach_attrs(struct config_item * item)
{
- struct dentry * dentry = dget(uobj->dentry);
+ struct dentry * dentry = dget(item->dentry);
struct configfs_dirent * parent_sd;
struct configfs_dirent * sd, * tmp;
@@ -376,9 +376,9 @@
dput(dentry);
}
-static int populate_attrs(struct uobject *uobj)
+static int populate_attrs(struct config_item *item)
{
- struct uobj_type *t = uobj->ktype;
+ struct config_item_type *t = item->ktype;
struct configfs_attribute *attr;
int error = 0;
int i;
@@ -387,25 +387,25 @@
return -EINVAL;
if (t->attrs) {
for (i = 0; (attr = t->attrs[i]) != NULL; i++) {
- if ((error = configfs_create_file(uobj, attr)))
+ if ((error = configfs_create_file(item, attr)))
break;
}
}
if (error)
- detach_attrs(uobj);
+ detach_attrs(item);
return error;
}
-static int configfs_attach_set(struct uobject *parent_uobj,
- struct uobject *uobj,
+static int configfs_attach_set(struct config_item *parent_item,
+ struct config_item *item,
struct dentry *dentry);
-static void configfs_detach_set(struct uobject *uobj);
+static void configfs_detach_set(struct config_item *item);
static void detach_sets(struct uset *uset)
{
- struct dentry * dentry = dget(uset->uobj.dentry);
+ struct dentry * dentry = dget(uset->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_uset->uobj.dentry;
+ struct dentry *child, *parent = parent_uset->item.dentry;
- if (!uset->uobj.k_name)
- uset->uobj.k_name = uset->uobj.name;
- name.name = uset->uobj.k_name;
+ if (!uset->item.k_name)
+ uset->item.k_name = uset->item.name;
+ name.name = uset->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_set(&parent_uset->uobj,
- &uset->uobj, child);
+ ret = configfs_attach_set(&parent_uset->item,
+ &uset->item, child);
if (!ret) {
sd = child->d_fsdata;
sd->s_type |= CONFIGFS_USET_DEFAULT;
@@ -487,7 +487,7 @@
static int populate_sets(struct uset *uset)
{
struct uset *new_set;
- struct dentry *dentry = uset->uobj.dentry;
+ struct dentry *dentry = uset->item.dentry;
int ret = 0;
int i;
@@ -523,31 +523,31 @@
* subsys->su_sem is held.
*/
-static void unlink_obj(struct uobject *uobj)
+static void unlink_obj(struct config_item *item)
{
struct uset *set;
- set = uobj->uset;
+ set = item->uset;
if (set) {
- list_del_init(&uobj->entry);
+ list_del_init(&item->entry);
- uobj->uset = NULL;
- uobj->parent = NULL;
- uobject_put(uobj);
+ item->uset = NULL;
+ item->parent = NULL;
+ config_item_put(item);
uset_put(set);
}
}
-static void link_obj(struct uobject *parent_uobj, struct uobject *uobj)
+static void link_obj(struct config_item *parent_item, struct config_item *item)
{
/* Parent seems redundant with set, but it makes certain
* traversals much nicer. */
- uobj->parent = parent_uobj;
- uobj->uset = uset_get(to_uset(parent_uobj));
- list_add_tail(&uobj->entry, &uobj->uset->list);
+ item->parent = parent_item;
+ item->uset = uset_get(to_uset(parent_item));
+ list_add_tail(&item->entry, &item->uset->list);
- uobject_get(uobj);
+ config_item_get(item);
}
static void unlink_set(struct uset *uset)
@@ -563,7 +563,7 @@
}
uset->subsys = NULL;
- unlink_obj(&uset->uobj);
+ unlink_obj(&uset->item);
}
static void link_set(struct uset *parent_uset, struct uset *uset)
@@ -572,11 +572,11 @@
struct uset *new_set;
struct configfs_subsystem *subsys;
- link_obj(&parent_uset->uobj, &uset->uobj);
+ link_obj(&parent_uset->item, &uset->item);
if (parent_uset->subsys)
subsys = parent_uset->subsys;
- else if (configfs_is_root(&parent_uset->uobj))
+ else if (configfs_is_root(&parent_uset->item))
subsys = to_configfs_subsystem(uset);
else
BUG();
@@ -591,31 +591,31 @@
}
/*
- * The goal is that configfs_attach_object() (and
+ * The goal is that configfs_attach_item() (and
* configfs_attach_set()) can be called from either the VFS or this
- * module. That is, they assume that the objects have been created,
+ * module. That is, they assume that the items have been created,
* the dentry allocated, and the dcache is all ready to go.
*
* If they fail, they must clean up after themselves as if they
* had never been called. The caller (VFS or local function) will
* handle cleaning up the dcache bits.
*
- * configfs_detach_set() and configfs_detach_object() behave similarly on the
- * way out. They assume that the proper semaphores are held, they
- * clean up the configfs objects, and they expect their callers will
+ * configfs_detach_set() and configfs_detach_item() behave similarly on
+ * the way out. They assume that the proper semaphores are held, they
+ * clean up the configfs items, and they expect their callers will
* handle the dcache bits.
*/
-static int configfs_attach_object(struct uobject *parent_uobj,
- struct uobject *uobj,
- struct dentry *dentry)
+static int configfs_attach_item(struct config_item *parent_item,
+ struct config_item *item,
+ struct dentry *dentry)
{
int ret;
- ret = configfs_create_dir(uobj, dentry);
+ ret = configfs_create_dir(item, dentry);
if (!ret) {
- ret = populate_attrs(uobj);
+ ret = populate_attrs(item);
if (ret) {
- configfs_remove_dir(uobj);
+ configfs_remove_dir(item);
d_delete(dentry);
}
}
@@ -623,27 +623,27 @@
return ret;
}
-static void configfs_detach_object(struct uobject *uobj)
+static void configfs_detach_item(struct config_item *item)
{
- detach_attrs(uobj);
- configfs_remove_dir(uobj);
+ detach_attrs(item);
+ configfs_remove_dir(item);
}
-static int configfs_attach_set(struct uobject *parent_uobj,
- struct uobject *uobj,
+static int configfs_attach_set(struct config_item *parent_item,
+ struct config_item *item,
struct dentry *dentry)
{
int ret;
struct configfs_dirent *sd;
- ret = configfs_attach_object(parent_uobj, uobj, dentry);
+ ret = configfs_attach_item(parent_item, item, dentry);
if (!ret) {
sd = dentry->d_fsdata;
sd->s_type |= CONFIGFS_USET_DIR;
- ret = populate_sets(to_uset(uobj));
+ ret = populate_sets(to_uset(item));
if (ret) {
- configfs_detach_object(uobj);
+ configfs_detach_item(item);
d_delete(dentry);
}
}
@@ -651,31 +651,31 @@
return ret;
}
-static void configfs_detach_set(struct uobject *uobj)
+static void configfs_detach_set(struct config_item *item)
{
- detach_sets(to_uset(uobj));
- configfs_detach_object(uobj);
+ detach_sets(to_uset(item));
+ configfs_detach_item(item);
}
/*
- * Drop the initial reference from make_object()/make_set()
- * This function assumes that reference is held on uobj
- * and that uobj holds a valid reference to the parent. Also, it
+ * Drop the initial reference from make_item()/make_set()
+ * This function assumes that reference is held on item
+ * and that item holds a valid reference to the parent. Also, it
* assumes the caller has validated uktype.
*/
-static void client_drop_object(struct uobject *parent_uobj,
- struct uobject *uobj)
+static void client_drop_item(struct config_item *parent_item,
+ struct config_item *item)
{
- struct uobj_type *uktype;
+ struct config_item_type *uktype;
- uktype = parent_uobj->ktype;
+ uktype = parent_item->ktype;
BUG_ON(!uktype);
- if (uktype->set_ops && uktype->set_ops->drop_object)
- uktype->set_ops->drop_object(to_uset(parent_uobj),
- uobj);
+ if (uktype->set_ops && uktype->set_ops->drop_item)
+ uktype->set_ops->drop_item(to_uset(parent_item),
+ item);
else
- uobject_put(uobj);
+ config_item_put(item);
}
@@ -683,11 +683,11 @@
{
int ret;
struct uset *uset;
- struct uobject *uobj;
- struct uobject *parent_uobj;
+ struct config_item *item;
+ struct config_item *parent_item;
struct configfs_subsystem *subsys;
struct configfs_dirent *sd;
- struct uobj_type *uktype;
+ struct config_item_type *uktype;
struct module *owner;
char *name;
@@ -698,61 +698,61 @@
if (!(sd->s_type & CONFIGFS_USET_DIR))
return -EPERM;
- parent_uobj = configfs_get_uobject(dentry->d_parent);
- uktype = parent_uobj->ktype;
- subsys = to_uset(parent_uobj)->subsys;
+ parent_item = configfs_get_config_item(dentry->d_parent);
+ uktype = parent_item->ktype;
+ subsys = to_uset(parent_item)->subsys;
BUG_ON(!subsys);
if (!uktype || !uktype->set_ops ||
(!uktype->set_ops->make_set &&
- !uktype->set_ops->make_object)) {
- uobject_put(parent_uobj);
+ !uktype->set_ops->make_item)) {
+ config_item_put(parent_item);
return -EPERM; /* What lack-of-mkdir returns */
}
name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL);
if (!name) {
- uobject_put(parent_uobj);
+ config_item_put(parent_item);
return -ENOMEM;
}
snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name);
down(&subsys->su_sem);
uset = NULL;
- uobj = NULL;
+ item = NULL;
if (uktype->set_ops->make_set) {
- uset = uktype->set_ops->make_set(to_uset(parent_uobj),
+ uset = uktype->set_ops->make_set(to_uset(parent_item),
name);
if (uset) {
- link_set(to_uset(parent_uobj), uset);
- uobj = &uset->uobj;
+ link_set(to_uset(parent_item), uset);
+ item = &uset->item;
}
} else {
- uobj = uktype->set_ops->make_object(to_uset(parent_uobj), name);
- if (uobj)
- link_obj(parent_uobj, uobj);
+ item = uktype->set_ops->make_item(to_uset(parent_item), name);
+ if (item)
+ link_obj(parent_item, item);
}
up(&subsys->su_sem);
kfree(name);
- if (!uobj) {
- uobject_put(parent_uobj);
+ if (!item) {
+ config_item_put(parent_item);
return -ENOMEM;
}
ret = -EINVAL;
- uktype = uobj->ktype;
+ uktype = item->ktype;
if (uktype) {
owner = uktype->owner;
if (try_module_get(owner)) {
if (uset) {
- ret = configfs_attach_set(parent_uobj,
- uobj,
+ ret = configfs_attach_set(parent_item,
+ item,
dentry);
} else {
- ret = configfs_attach_object(parent_uobj,
- uobj,
- dentry);
+ ret = configfs_attach_item(parent_item,
+ item,
+ dentry);
}
if (ret) {
@@ -760,11 +760,11 @@
if (uset)
unlink_set(uset);
else
- unlink_obj(uobj);
- client_drop_object(parent_uobj, uobj);
+ unlink_obj(item);
+ client_drop_item(parent_item, item);
up(&subsys->su_sem);
- uobject_put(parent_uobj);
+ config_item_put(parent_item);
module_put(owner);
}
}
@@ -775,8 +775,8 @@
static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
{
- struct uobject *parent_uobj;
- struct uobject *uobj;
+ struct config_item *parent_item;
+ struct config_item *item;
struct configfs_subsystem *subsys;
struct configfs_dirent *sd;
struct module *owner = NULL;
@@ -789,47 +789,47 @@
if (sd->s_type & CONFIGFS_USET_DEFAULT)
return -EPERM;
- parent_uobj = configfs_get_uobject(dentry->d_parent);
- subsys = to_uset(parent_uobj)->subsys;
+ parent_item = configfs_get_config_item(dentry->d_parent);
+ subsys = to_uset(parent_item)->subsys;
BUG_ON(!subsys);
- if (!parent_uobj->ktype) {
- uobject_put(parent_uobj);
+ if (!parent_item->ktype) {
+ config_item_put(parent_item);
return -EINVAL;
}
ret = configfs_detach_prep(dentry);
if (ret) {
configfs_detach_rollback(dentry);
- uobject_put(parent_uobj);
+ config_item_put(parent_item);
return ret;
}
- uobj = configfs_get_uobject(dentry);
+ item = configfs_get_config_item(dentry);
- /* Drop reference from above, uobj already holds one. */
- uobject_put(parent_uobj);
+ /* Drop reference from above, item already holds one. */
+ config_item_put(parent_item);
- if (uobj->ktype)
- owner = uobj->ktype->owner;
+ if (item->ktype)
+ owner = item->ktype->owner;
if (sd->s_type & CONFIGFS_USET_DIR) {
- configfs_detach_set(uobj);
+ configfs_detach_set(item);
down(&subsys->su_sem);
- unlink_set(to_uset(uobj));
+ unlink_set(to_uset(item));
} else {
- configfs_detach_object(uobj);
+ configfs_detach_item(item);
down(&subsys->su_sem);
- unlink_obj(uobj);
+ unlink_obj(item);
}
- client_drop_object(parent_uobj, uobj);
+ client_drop_item(parent_item, item);
up(&subsys->su_sem);
/* Drop our reference from above */
- uobject_put(uobj);
+ config_item_put(item);
module_put(owner);
@@ -856,29 +856,29 @@
};
#if 0
-int configfs_rename_dir(struct uobject * uobj, const char *new_name)
+int configfs_rename_dir(struct config_item * item, const char *new_name)
{
int error = 0;
struct dentry * new_dentry, * parent;
- if (!strcmp(uobject_name(uobj), new_name))
+ if (!strcmp(config_item_name(item), new_name))
return -EINVAL;
- if (!uobj->parent)
+ if (!item->parent)
return -EINVAL;
down_write(&configfs_rename_sem);
- parent = uobj->parent->dentry;
+ parent = item->parent->dentry;
down(&parent->d_inode->i_sem);
new_dentry = configfs_get_dentry(parent, new_name);
if (!IS_ERR(new_dentry)) {
if (!new_dentry->d_inode) {
- error = uobject_set_name(uobj, "%s", new_name);
+ error = config_item_set_name(item, "%s", new_name);
if (!error) {
d_add(new_dentry, NULL);
- d_move(uobj->dentry, new_dentry);
+ d_move(item->dentry, new_dentry);
}
else
d_delete(new_dentry);
@@ -1045,15 +1045,15 @@
if (err)
return err;
- if (!set->uobj.k_name)
- set->uobj.k_name = set->uobj.name;
+ if (!set->item.k_name)
+ set->item.k_name = set->item.name;
sd = configfs_sb->s_root->d_fsdata;
link_set(to_uset(sd->s_element), set);
down(&configfs_sb->s_root->d_inode->i_sem);
- name.name = set->uobj.k_name;
+ name.name = set->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_set(sd->s_element, &set->uobj, dentry);
+ err = configfs_attach_set(sd->s_element, &set->item, dentry);
if (!err)
dentry = NULL;
else
@@ -1085,7 +1085,7 @@
void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
{
struct uset *set = &subsys->su_set;
- struct dentry *dentry = set->uobj.dentry;
+ struct dentry *dentry = set->item.dentry;
if (dentry->d_parent != configfs_sb->s_root) {
printk(KERN_ERR "configfs: Tried to unregister non-subsystem!\n");
@@ -1097,7 +1097,7 @@
if (configfs_detach_prep(dentry)) {
printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
}
- configfs_detach_set(&set->uobj);
+ configfs_detach_set(&set->item);
dentry->d_inode->i_flags |= S_DEAD;
up(&dentry->d_inode->i_sem);
Modified: trunk/fs/configfs/file.c
===================================================================
--- trunk/fs/configfs/file.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/file.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -39,27 +39,27 @@
size_t count;
loff_t pos;
char * page;
- struct configfs_object_operations * ops;
+ struct configfs_item_operations * ops;
struct semaphore sem;
int needs_read_fill;
};
/**
- * fill_read_buffer - allocate and fill buffer from object.
+ * fill_read_buffer - allocate and fill buffer from item.
* @dentry: dentry pointer.
* @buffer: data buffer for file.
*
* Allocate @buffer->page, if it hasn't been already, then call the
- * uobject's show() method to fill the buffer with this attribute's
+ * config_item's show() method to fill the buffer with this attribute's
* data.
* This is called only once, on the file's first read.
*/
static int fill_read_buffer(struct dentry * dentry, struct configfs_buffer * buffer)
{
struct configfs_attribute * attr = to_attr(dentry);
- struct uobject * uobj = to_uobj(dentry->d_parent);
- struct configfs_object_operations * ops = buffer->ops;
+ struct config_item * item = to_item(dentry->d_parent);
+ struct configfs_item_operations * ops = buffer->ops;
int ret = 0;
ssize_t count;
@@ -68,7 +68,7 @@
if (!buffer->page)
return -ENOMEM;
- count = ops->show_attribute(uobj,attr,buffer->page);
+ count = ops->show_attribute(item,attr,buffer->page);
buffer->needs_read_fill = 0;
BUG_ON(count > (ssize_t)PAGE_SIZE);
if (count >= 0)
@@ -116,13 +116,13 @@
* @ppos: starting offset in file.
*
* Userspace wants to read an attribute file. The attribute descriptor
- * is in the file's ->d_fsdata. The target object is in the directory's
+ * is in the file's ->d_fsdata. The target item is in the directory's
* ->d_fsdata.
*
* We call fill_read_buffer() to allocate and fill the buffer from the
- * object's show() method exactly once (if the read is happening from
+ * item's show() method exactly once (if the read is happening from
* the beginning of the file). That should fill the entire buffer with
- * all the data the object has to offer for that attribute.
+ * all the data the item has to offer for that attribute.
* We then call flush_read_buffer() to copy the buffer to userspace
* in the increments specified.
*/
@@ -176,11 +176,11 @@
/**
- * flush_write_buffer - push buffer to uobject.
+ * flush_write_buffer - push buffer to config_item.
* @file: file pointer.
* @buffer: data buffer for file.
*
- * Get the correct pointers for the uobject and the attribute we're
+ * Get the correct pointers for the config_item and the attribute we're
* dealing with, then call the store() method for the attribute,
* passing the buffer that we acquired in fill_write_buffer().
*/
@@ -189,10 +189,10 @@
flush_write_buffer(struct dentry * dentry, struct configfs_buffer * buffer, size_t count)
{
struct configfs_attribute * attr = to_attr(dentry);
- struct uobject * uobj = to_uobj(dentry->d_parent);
- struct configfs_object_operations * ops = buffer->ops;
+ struct config_item * item = to_item(dentry->d_parent);
+ struct configfs_item_operations * ops = buffer->ops;
- return ops->store_attribute(uobj,attr,buffer->page,count);
+ return ops->store_attribute(item,attr,buffer->page,count);
}
@@ -205,7 +205,7 @@
*
* Similar to configfs_read_file(), though working in the opposite direction.
* We allocate and fill the data from the user in fill_write_buffer(),
- * then push it to the uobject in flush_write_buffer().
+ * then push it to the config_item in flush_write_buffer().
* There is no easy way for us to know if userspace is only doing a partial
* write, so we don't support them. We expect the entire buffer to come
* on the first write.
@@ -230,13 +230,13 @@
static int check_perm(struct inode * inode, struct file * file)
{
- struct uobject *uobj = configfs_get_uobject(file->f_dentry->d_parent);
+ struct config_item *item = configfs_get_config_item(file->f_dentry->d_parent);
struct configfs_attribute * attr = to_attr(file->f_dentry);
struct configfs_buffer * buffer;
- struct configfs_object_operations * ops = NULL;
+ struct configfs_item_operations * ops = NULL;
int error = 0;
- if (!uobj || !attr)
+ if (!item || !attr)
goto Einval;
/* Grab the module reference for this attribute if we have one */
@@ -245,11 +245,11 @@
goto Done;
}
- /* if the uobject has no ktype, then we assume that it is a subsystem
+ /* if the config_item has no ktype, then we assume that it is a subsystem
* itself, and use ops for it.
*/
- if (uobj->ktype)
- ops = uobj->ktype->object_ops;
+ if (item->ktype)
+ ops = item->ktype->item_ops;
else
goto Eaccess;
@@ -294,8 +294,8 @@
error = -EACCES;
module_put(attr->owner);
Done:
- if (error && uobj)
- uobject_put(uobj);
+ if (error && item)
+ config_item_put(item);
return error;
}
@@ -306,13 +306,13 @@
static int configfs_release(struct inode * inode, struct file * filp)
{
- struct uobject * uobj = to_uobj(filp->f_dentry->d_parent);
+ struct config_item * item = to_item(filp->f_dentry->d_parent);
struct configfs_attribute * attr = to_attr(filp->f_dentry);
struct module * owner = attr->owner;
struct configfs_buffer * buffer = filp->private_data;
- if (uobj)
- uobject_put(uobj);
+ if (item)
+ config_item_put(item);
/* After this point, attr should not be accessed. */
module_put(owner);
@@ -348,16 +348,16 @@
/**
- * configfs_create_file - create an attribute file for an object.
- * @uobj: object we're creating for.
+ * configfs_create_file - create an attribute file for an item.
+ * @item: item we're creating for.
* @attr: atrribute descriptor.
*/
-int configfs_create_file(struct uobject * uobj, const struct configfs_attribute * attr)
+int configfs_create_file(struct config_item * item, const struct configfs_attribute * attr)
{
- BUG_ON(!uobj || !uobj->dentry || !attr);
+ BUG_ON(!item || !item->dentry || !attr);
- return configfs_add_file(uobj->dentry, attr, CONFIGFS_UOBJ_ATTR);
+ return configfs_add_file(item->dentry, attr, CONFIGFS_UOBJ_ATTR);
}
Modified: trunk/fs/configfs/mount.c
===================================================================
--- trunk/fs/configfs/mount.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/mount.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -52,29 +52,29 @@
};
static struct uset configfs_root_set = {
- .uobj = {
+ .item = {
.name = "root",
- .k_name = configfs_root_set.uobj.name,
+ .k_name = configfs_root_set.item.name,
},
};
-int configfs_is_root(struct uobject *uobj)
+int configfs_is_root(struct config_item *item)
{
- return uobj == &configfs_root_set.uobj;
+ return item == &configfs_root_set.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_set.uobj,
+ .s_element = &configfs_root_set.item,
.s_type = CONFIGFS_ROOT,
};
void uset_init_type_name(struct uset *uset, const char *name,
- struct uobj_type *ktype)
+ struct config_item_type *ktype)
{
- uobject_set_name(&uset->uobj, name);
- uset->uobj.ktype = ktype;
+ config_item_set_name(&uset->item, name);
+ uset->item.ktype = ktype;
uset_init(uset);
}
EXPORT_SYMBOL(uset_init_type_name);
@@ -108,7 +108,7 @@
return -ENOMEM;
}
uset_init(&configfs_root_set);
- configfs_root_set.uobj.dentry = root;
+ configfs_root_set.item.dentry = root;
root->d_fsdata = &configfs_root;
sb->s_root = root;
return 0;
Modified: trunk/fs/configfs/symlink.c
===================================================================
--- trunk/fs/configfs/symlink.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/symlink.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -32,59 +32,59 @@
#include "configfs.h"
#include "configfs_internal.h"
-static int object_depth(struct uobject * uobj)
+static int item_depth(struct config_item * item)
{
- struct uobject * p = uobj;
+ struct config_item * p = item;
int depth = 0;
do { depth++; } while ((p = p->parent) && !configfs_is_root(p));
return depth;
}
-static int object_path_length(struct uobject * uobj)
+static int item_path_length(struct config_item * item)
{
- struct uobject * p = uobj;
+ struct config_item * p = item;
int length = 1;
do {
- length += strlen(uobject_name(p)) + 1;
+ length += strlen(config_item_name(p)) + 1;
p = p->parent;
} while (p && !configfs_is_root(p));
return length;
}
-static void fill_object_path(struct uobject * uobj, char * buffer, int length)
+static void fill_item_path(struct config_item * item, char * buffer, int length)
{
- struct uobject * p;
+ struct config_item * p;
--length;
- for (p = uobj; p && !configfs_is_root(p); p = p->parent) {
- int cur = strlen(uobject_name(p));
+ for (p = item; p && !configfs_is_root(p); p = p->parent) {
+ int cur = strlen(config_item_name(p));
/* back up enough to print this bus id with '/' */
length -= cur;
- strncpy(buffer + length,uobject_name(p),cur);
+ strncpy(buffer + length,config_item_name(p),cur);
*(buffer + --length) = '/';
}
}
-static int create_link(struct uobject *parent_uobj,
- struct uobject *uobj,
+static int create_link(struct config_item *parent_item,
+ struct config_item *item,
struct dentry *dentry)
{
- struct configfs_dirent *target_sd = uobj->dentry->d_fsdata;
+ struct configfs_dirent *target_sd = item->dentry->d_fsdata;
struct configfs_symlink *sl;
int ret;
ret = -ENOMEM;
sl = kmalloc(sizeof(struct configfs_symlink), GFP_KERNEL);
if (sl) {
- sl->sl_target = uobject_get(uobj);
+ sl->sl_target = config_item_get(item);
/* FIXME: needs a lock, I'd bet */
list_add(&sl->sl_list, &target_sd->s_links);
- ret = configfs_create_link(sl, parent_uobj->dentry,
+ ret = configfs_create_link(sl, parent_item->dentry,
dentry);
if (ret) {
list_del_init(&sl->sl_list);
- uobject_put(uobj);
+ config_item_put(item);
kfree(sl);
}
}
@@ -94,14 +94,14 @@
static int get_target(const char *symname, struct nameidata *nd,
- struct uobject **target)
+ struct config_item **target)
{
int ret;
ret = path_lookup(symname, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, nd);
if (!ret) {
if (nd->dentry->d_sb == configfs_sb) {
- *target = configfs_get_uobject(nd->dentry);
+ *target = configfs_get_config_item(nd->dentry);
if (!*target) {
ret = -ENOENT;
path_release(nd);
@@ -118,34 +118,34 @@
{
int ret;
struct nameidata nd;
- struct uobject *parent_uobj;
- struct uobject *target_uobj;
- struct uobj_type *uktype;
+ struct config_item *parent_item;
+ struct config_item *target_item;
+ struct config_item_type *uktype;
ret = -EPERM; /* What lack-of-symlink returns */
if (dentry->d_parent == configfs_sb->s_root)
goto out;
- parent_uobj = configfs_get_uobject(dentry->d_parent);
- uktype = parent_uobj->ktype;
+ parent_item = configfs_get_config_item(dentry->d_parent);
+ uktype = parent_item->ktype;
- if (!uktype || !uktype->object_ops ||
- !uktype->object_ops->allow_link)
+ if (!uktype || !uktype->item_ops ||
+ !uktype->item_ops->allow_link)
goto out_put;
- ret = get_target(symname, &nd, &target_uobj);
+ ret = get_target(symname, &nd, &target_item);
if (ret)
goto out_put;
- ret = uktype->object_ops->allow_link(parent_uobj, target_uobj);
+ ret = uktype->item_ops->allow_link(parent_item, target_item);
if (!ret)
- ret = create_link(parent_uobj, target_uobj, dentry);
+ ret = create_link(parent_item, target_item, dentry);
- uobject_put(target_uobj);
+ config_item_put(target_item);
path_release(&nd);
out_put:
- uobject_put(parent_uobj);
+ config_item_put(parent_item);
out:
return ret;
@@ -155,8 +155,8 @@
{
struct configfs_dirent *sd = dentry->d_fsdata;
struct configfs_symlink *sl;
- struct uobject *parent_uobj;
- struct uobj_type *uktype;
+ struct config_item *parent_item;
+ struct config_item_type *uktype;
int ret;
ret = -EPERM; /* What lack-of-symlink returns */
@@ -168,8 +168,8 @@
sl = sd->s_element;
- parent_uobj = configfs_get_uobject(dentry->d_parent);
- uktype = parent_uobj->ktype;
+ parent_item = configfs_get_config_item(dentry->d_parent);
+ uktype = parent_item->ktype;
list_del_init(&sd->s_sibling);
configfs_drop_dentry(sd, dentry->d_parent);
@@ -179,21 +179,21 @@
/*
* drop_link() must be called before
* list_del_init(&sl->sl_list), so that the order of
- * drop_link(this, target) and drop_object(target) is preserved.
+ * drop_link(this, target) and drop_item(target) is preserved.
*/
- if (uktype && uktype->object_ops &&
- uktype->object_ops->drop_link)
- uktype->object_ops->drop_link(parent_uobj,
+ if (uktype && uktype->item_ops &&
+ uktype->item_ops->drop_link)
+ uktype->item_ops->drop_link(parent_item,
sl->sl_target);
/* FIXME: Needs lock */
list_del_init(&sl->sl_list);
/* Put reference from create_link() */
- uobject_put(sl->sl_target);
+ config_item_put(sl->sl_target);
kfree(sl);
- uobject_put(parent_uobj);
+ config_item_put(parent_item);
ret = 0;
@@ -201,14 +201,14 @@
return ret;
}
-static int configfs_get_target_path(struct uobject * uobj, struct uobject * target,
+static int configfs_get_target_path(struct config_item * item, struct config_item * target,
char *path)
{
char * s;
int depth, size;
- depth = object_depth(uobj);
- size = object_path_length(target) + depth * 3 - 1;
+ depth = item_depth(item);
+ size = item_path_length(target) + depth * 3 - 1;
if (size > PATH_MAX)
return -ENAMETOOLONG;
@@ -217,7 +217,7 @@
for (s = path; depth--; s += 3)
strcpy(s,"../");
- fill_object_path(target, path, size);
+ fill_item_path(target, path, size);
pr_debug("%s: path = '%s'\n", __FUNCTION__, path);
return 0;
@@ -225,25 +225,25 @@
static int configfs_getlink(struct dentry *dentry, char * path)
{
- struct uobject *uobj, *target_uobj;
+ struct config_item *item, *target_item;
int error = 0;
- uobj = configfs_get_uobject(dentry->d_parent);
- if (!uobj)
+ item = configfs_get_config_item(dentry->d_parent);
+ if (!item)
return -EINVAL;
- target_uobj = configfs_get_uobject(dentry);
- if (!target_uobj) {
- uobject_put(uobj);
+ target_item = configfs_get_config_item(dentry);
+ if (!target_item) {
+ config_item_put(item);
return -EINVAL;
}
down_read(&configfs_rename_sem);
- error = configfs_get_target_path(uobj, target_uobj, path);
+ error = configfs_get_target_path(item, target_item, path);
up_read(&configfs_rename_sem);
- uobject_put(uobj);
- uobject_put(target_uobj);
+ config_item_put(item);
+ config_item_put(target_item);
return error;
}
Modified: trunk/fs/configfs/uobject.c
===================================================================
--- trunk/fs/configfs/uobject.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/configfs/uobject.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -1,15 +1,15 @@
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
- * uobject.c - library routines for handling generic kernel objects
+ * config_item.c - library routines for handling generic kernel items
*
* Copyright (c) 2002-2003 Patrick Mochel <mochel at osdl.org>
*
* This file is released under the GPLv2.
*
*
- * Please see the file Documentation/uobject.txt for critical information
- * about using the uobject interface.
+ * Please see the file Documentation/config_item.txt for critical information
+ * about using the config_item interface.
*
* 2005.01.24
* Stripped down for 2.4 compat in configfs.
@@ -24,35 +24,35 @@
#include "configfs.h"
-static inline struct uobject * to_uobj(struct list_head * entry)
+static inline struct config_item * to_item(struct list_head * entry)
{
- return container_of(entry,struct uobject,entry);
+ return container_of(entry,struct config_item,entry);
}
/* Evil kernel */
-static void uobject_release(struct kref *kref);
+static void config_item_release(struct kref *kref);
/**
- * uobject_init - initialize object.
- * @uobj: object in question.
+ * config_item_init - initialize item.
+ * @item: item in question.
*/
-void uobject_init(struct uobject * uobj)
+void config_item_init(struct config_item * item)
{
- kref_init(&uobj->kref, uobject_release);
- INIT_LIST_HEAD(&uobj->entry);
+ kref_init(&item->kref, config_item_release);
+ INIT_LIST_HEAD(&item->entry);
}
/**
- * uobject_set_name - Set the name of an object
- * @uobj: object.
+ * config_item_set_name - Set the name of an item
+ * @item: item.
* @name: name.
*
* If strlen(name) >= UOBJ_NAME_LEN, then use a dynamically allocated
- * string that @uobj->k_name points to. Otherwise, use the static
- * @uobj->name array.
+ * string that @item->k_name points to. Otherwise, use the static
+ * @item->name array.
*/
-int uobject_set_name(struct uobject * uobj, const char * fmt, ...)
+int config_item_set_name(struct config_item * item, const char * fmt, ...)
{
int error = 0;
int limit = UOBJ_NAME_LEN;
@@ -64,10 +64,10 @@
* First, try the static array
*/
va_start(args,fmt);
- need = vsnprintf(uobj->name,limit,fmt,args);
+ need = vsnprintf(item->name,limit,fmt,args);
va_end(args);
if (need < limit)
- name = uobj->name;
+ name = item->name;
else {
/*
* Need more space? Allocate it and try again
@@ -91,62 +91,62 @@
}
/* Free the old name, if necessary. */
- if (uobj->k_name && uobj->k_name != uobj->name)
- kfree(uobj->k_name);
+ if (item->k_name && item->k_name != item->name)
+ kfree(item->k_name);
/* Now, set the new name */
- uobj->k_name = name;
+ item->k_name = name;
Done:
return error;
}
-EXPORT_SYMBOL(uobject_set_name);
+EXPORT_SYMBOL(config_item_set_name);
-struct uobject * uobject_get(struct uobject * uobj)
+struct config_item * config_item_get(struct config_item * item)
{
- if (uobj)
- kref_get(&uobj->kref);
- return uobj;
+ if (item)
+ kref_get(&item->kref);
+ return item;
}
/**
- * uobject_cleanup - free uobject resources.
- * @uobj: object.
+ * config_item_cleanup - free config_item resources.
+ * @item: item.
*/
-void uobject_cleanup(struct uobject * uobj)
+void config_item_cleanup(struct config_item * item)
{
- struct uobj_type * t = uobj->ktype;
- struct uset * s = uobj->uset;
- struct uobject * parent = uobj->parent;
+ struct config_item_type * t = item->ktype;
+ struct uset * s = item->uset;
+ struct config_item * parent = item->parent;
- pr_debug("uobject %s: cleaning up\n",uobject_name(uobj));
- if (uobj->k_name != uobj->name)
- kfree(uobj->k_name);
- uobj->k_name = NULL;
- if (t && t->object_ops && t->object_ops->release)
- t->object_ops->release(uobj);
+ pr_debug("config_item %s: cleaning up\n",config_item_name(item));
+ 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 (s)
uset_put(s);
if (parent)
- uobject_put(parent);
+ config_item_put(parent);
}
-static void uobject_release(struct kref *kref)
+static void config_item_release(struct kref *kref)
{
- uobject_cleanup(container_of(kref, struct uobject, kref));
+ config_item_cleanup(container_of(kref, struct config_item, kref));
}
/**
- * uobject_put - decrement refcount for object.
- * @uobj: object.
+ * config_item_put - decrement refcount for item.
+ * @item: item.
*
- * Decrement the refcount, and if 0, call uobject_cleanup().
+ * Decrement the refcount, and if 0, call config_item_cleanup().
*/
-void uobject_put(struct uobject * uobj)
+void config_item_put(struct config_item * item)
{
- if (uobj)
- kref_put(&uobj->kref, uobject_release);
+ if (item)
+ kref_put(&item->kref, config_item_release);
}
@@ -157,32 +157,32 @@
void uset_init(struct uset *set)
{
- uobject_init(&set->uobj);
+ config_item_init(&set->item);
INIT_LIST_HEAD(&set->list);
}
/**
- * uset_find_obj - search for object in uset.
+ * uset_find_obj - search for item in uset.
* @uset: uset we're looking in.
- * @name: object's name.
+ * @name: item's name.
*
* Lock uset via @uset->subsys, and iterate over @uset->list,
- * looking for a matching uobject. If matching object is found
- * take a reference and return the object.
+ * looking for a matching config_item. If matching item is found
+ * take a reference and return the item.
*/
-struct uobject * uset_find_obj(struct uset * uset, const char * name)
+struct config_item * uset_find_obj(struct uset * uset, const char * name)
{
struct list_head * entry;
- struct uobject * ret = NULL;
+ struct config_item * ret = NULL;
/* XXX LOCKING! */
list_for_each(entry,&uset->list) {
- struct uobject * uobj = to_uobj(entry);
- if (uobject_name(uobj) &&
- !strcmp(uobject_name(uobj), name)) {
- ret = uobject_get(uobj);
+ struct config_item * item = to_item(entry);
+ if (config_item_name(item) &&
+ !strcmp(config_item_name(item), name)) {
+ ret = config_item_get(item);
break;
}
}
@@ -190,8 +190,8 @@
}
-EXPORT_SYMBOL(uobject_init);
+EXPORT_SYMBOL(config_item_init);
EXPORT_SYMBOL(uset_init);
-EXPORT_SYMBOL(uobject_get);
-EXPORT_SYMBOL(uobject_put);
+EXPORT_SYMBOL(config_item_get);
+EXPORT_SYMBOL(config_item_put);
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -117,7 +117,7 @@
/* each thread owns a region.. when we're asked to tear down the region
* we ask the thread to stop, who cleans up the region */
struct hb_region {
- struct uobject hr_uobj;
+ struct config_item hr_item;
/* protected by the hr_callback_sem */
struct list_head hr_active_item;
struct task_struct *hr_task;
@@ -443,17 +443,17 @@
* the cluster set in nodemanager.c.
*/
-static struct hb_region *to_hb_region(struct uobject *uobj)
+static struct hb_region *to_hb_region(struct config_item *item)
{
- return uobj ? container_of(uobj, struct hb_region, hr_uobj) : NULL;
+ return item ? container_of(item, struct hb_region, hr_item) : NULL;
}
-/* drop_object only drops its ref after killing the thread, nothing should
+/* drop_item only drops its ref after killing the thread, nothing should
* be using the region anymore. this has to clean up any state that
* attributes might have built up. */
-static void hb_region_release(struct uobject *uobj)
+static void hb_region_release(struct config_item *item)
{
- struct hb_region *reg = to_hb_region(uobj);
+ struct hb_region *reg = to_hb_region(item);
struct hb_disk_slot *slot;
int i;
@@ -603,7 +603,7 @@
atomic_set(®->hr_steady_iterations, 2);
reg->hr_task = kthread_run(hb_thread, reg, "hb-%s",
- reg->hr_uobj.k_name);
+ reg->hr_item.k_name);
if (IS_ERR(reg->hr_task)) {
reg->hr_task = NULL;
goto out;
@@ -666,11 +666,11 @@
NULL,
};
-static ssize_t hb_region_show(struct uobject *uobj,
+static ssize_t hb_region_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct hb_region *reg = to_hb_region(uobj);
+ struct hb_region *reg = to_hb_region(item);
struct hb_region_attribute *hb_region_attr =
container_of(attr, struct hb_region_attribute, attr);
ssize_t ret = 0;
@@ -680,11 +680,11 @@
return ret;
}
-static ssize_t hb_region_store(struct uobject *uobj,
+static ssize_t hb_region_store(struct config_item *item,
struct configfs_attribute *attr,
const char *page, size_t count)
{
- struct hb_region *reg = to_hb_region(uobj);
+ struct hb_region *reg = to_hb_region(item);
struct hb_region_attribute *hb_region_attr =
container_of(attr, struct hb_region_attribute, attr);
ssize_t ret = -EINVAL;
@@ -694,14 +694,14 @@
return ret;
}
-static struct configfs_object_operations hb_region_object_ops = {
+static struct configfs_item_operations hb_region_item_ops = {
.release = hb_region_release,
.show_attribute = hb_region_show,
.store_attribute = hb_region_store,
};
-static struct uobj_type hb_region_type = {
- .object_ops = &hb_region_object_ops,
+static struct config_item_type hb_region_type = {
+ .item_ops = &hb_region_item_ops,
.attrs = hb_region_attrs,
.owner = THIS_MODULE,
};
@@ -720,11 +720,11 @@
: NULL;
}
-static struct uobject *hb_heartbeat_set_make_object(struct uset *uset,
- const char *name)
+static struct config_item *hb_heartbeat_set_make_item(struct uset *uset,
+ const char *name)
{
struct hb_region *reg = NULL;
- struct uobject *ret = NULL;
+ struct config_item *ret = NULL;
reg = kcalloc(1, sizeof(struct hb_region), GFP_KERNEL);
if (reg == NULL)
@@ -734,11 +734,11 @@
rwlock_init(®->hr_slot_list_lock);
INIT_LIST_HEAD(®->hr_live_list);
- uobject_set_name(®->hr_uobj, name);
- reg->hr_uobj.ktype = &hb_region_type;
- uobject_init(®->hr_uobj);
+ config_item_set_name(®->hr_item, name);
+ reg->hr_item.ktype = &hb_region_type;
+ config_item_init(®->hr_item);
- ret = ®->hr_uobj;
+ ret = ®->hr_item;
out:
if (ret == NULL)
kfree(reg);
@@ -746,10 +746,10 @@
return ret;
}
-static void hb_heartbeat_set_drop_object(struct uset *uset,
- struct uobject *uobj)
+static void hb_heartbeat_set_drop_item(struct uset *uset,
+ struct config_item *item)
{
- struct hb_region *reg = to_hb_region(uobj);
+ struct hb_region *reg = to_hb_region(item);
down_read(&hb_callback_sem);
if (!list_empty(®->hr_active_item))
@@ -762,15 +762,15 @@
reg->hr_task = NULL;
}
- uobject_put(uobj);
+ config_item_put(item);
}
static struct configfs_set_operations hb_heartbeat_set_set_ops = {
- .make_object = hb_heartbeat_set_make_object,
- .drop_object = hb_heartbeat_set_drop_object,
+ .make_item = hb_heartbeat_set_make_item,
+ .drop_item = hb_heartbeat_set_drop_item,
};
-struct uobj_type hb_heartbeat_set_type = {
+struct config_item_type hb_heartbeat_set_type = {
.set_ops = &hb_heartbeat_set_set_ops,
.owner = THIS_MODULE,
};
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-30 18:54:04 UTC (rev 2082)
@@ -103,7 +103,7 @@
read_lock(&nm_single_cluster->cl_nodes_lock);
node = nm_single_cluster->cl_nodes[node_num];
if (node)
- uobject_get(&node->nd_uobj);
+ config_item_get(&node->nd_item);
read_unlock(&nm_single_cluster->cl_nodes_lock);
out:
return node;
@@ -169,7 +169,7 @@
read_lock(&cluster->cl_nodes_lock);
node = nm_node_ip_tree_lookup(cluster, addr, NULL, NULL);
if (node)
- uobject_get(&node->nd_uobj);
+ config_item_get(&node->nd_item);
read_unlock(&cluster->cl_nodes_lock);
out:
@@ -179,7 +179,7 @@
void nm_node_put(struct nm_node *node)
{
- uobject_put(&node->nd_uobj);
+ config_item_put(&node->nd_item);
}
EXPORT_SYMBOL(nm_node_put);
@@ -196,22 +196,22 @@
/* node configfs bits */
-static struct nm_cluster *to_nm_cluster(struct uobject *uobj)
+static struct nm_cluster *to_nm_cluster(struct config_item *item)
{
- return uobj ?
- container_of(to_uset(uobj), struct nm_cluster,
+ return item ?
+ container_of(to_uset(item), struct nm_cluster,
cl_uset)
: NULL;
}
-static struct nm_node *to_nm_node(struct uobject *uobj)
+static struct nm_node *to_nm_node(struct config_item *item)
{
- return uobj ? container_of(uobj, struct nm_node, nd_uobj) : NULL;
+ return item ? container_of(item, struct nm_node, nd_item) : NULL;
}
-static void nm_node_release(struct uobject *uobj)
+static void nm_node_release(struct config_item *item)
{
- struct nm_node *node = to_nm_node(uobj);
+ struct nm_node *node = to_nm_node(item);
kfree(node);
}
@@ -224,7 +224,7 @@
{
/* through the first node_set .parent
* mycluster/nodes/mynode == nm_cluster->nm_node_set->nm_node */
- return to_nm_cluster(node->nd_uobj.parent->parent);
+ return to_nm_cluster(node->nd_item.parent->parent);
}
enum {
@@ -438,11 +438,11 @@
return 0;
}
-static ssize_t nm_node_show(struct uobject *uobj,
+static ssize_t nm_node_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
{
- struct nm_node *node = to_nm_node(uobj);
+ struct nm_node *node = to_nm_node(item);
struct nm_node_attribute *nm_node_attr =
container_of(attr, struct nm_node_attribute, attr);
ssize_t ret = 0;
@@ -452,11 +452,11 @@
return ret;
}
-static ssize_t nm_node_store(struct uobject *uobj,
+static ssize_t nm_node_store(struct config_item *item,
struct configfs_attribute *attr,
const char *page, size_t count)
{
- struct nm_node *node = to_nm_node(uobj);
+ struct nm_node *node = to_nm_node(item);
struct nm_node_attribute *nm_node_attr =
container_of(attr, struct nm_node_attribute, attr);
ssize_t ret;
@@ -479,14 +479,14 @@
return ret;
}
-static struct configfs_object_operations nm_node_object_ops = {
+static struct configfs_item_operations nm_node_item_ops = {
.release = nm_node_release,
.show_attribute = nm_node_show,
.store_attribute = nm_node_store,
};
-static struct uobj_type nm_node_type = {
- .object_ops = &nm_node_object_ops,
+static struct config_item_type nm_node_type = {
+ .item_ops = &nm_node_item_ops,
.attrs = nm_node_attrs,
.owner = THIS_MODULE,
};
@@ -507,11 +507,11 @@
}
#endif
-static struct uobject *nm_node_set_make_object(struct uset *uset,
+static struct config_item *nm_node_set_make_item(struct uset *uset,
const char *name)
{
struct nm_node *node = NULL;
- struct uobject *ret = NULL;
+ struct config_item *ret = NULL;
net_inode_private *nip;
if (strlen(name) > NM_MAX_NAME_LEN)
@@ -521,7 +521,7 @@
if (node == NULL)
goto out; /* ENOMEM */
- strcpy(node->nd_name, name); /* use uobj.name instead? */
+ strcpy(node->nd_name, name); /* use item.name instead? */
/* this should be somewhere else */
nip = &node->nd_net_inode_private;
@@ -536,11 +536,11 @@
goto out; /* ENOMEM */
}
- uobject_set_name(&node->nd_uobj, name);
- node->nd_uobj.ktype = &nm_node_type;
- uobject_init(&node->nd_uobj);
+ config_item_set_name(&node->nd_item, name);
+ node->nd_item.ktype = &nm_node_type;
+ config_item_init(&node->nd_item);
- ret = &node->nd_uobj;
+ ret = &node->nd_item;
out:
if (ret == NULL)
@@ -549,10 +549,10 @@
return ret;
}
-static void nm_node_set_drop_object(struct uset *uset, struct uobject *uobj)
+static void nm_node_set_drop_item(struct uset *uset, struct config_item *item)
{
- struct nm_node *node = to_nm_node(uobj);
- struct nm_cluster *cluster = to_nm_cluster(uset->uobj.parent);
+ struct nm_node *node = to_nm_node(item);
+ struct nm_cluster *cluster = to_nm_cluster(uset->item.parent);
net_stop_node_sock(node);
@@ -578,35 +578,35 @@
}
write_unlock(&cluster->cl_nodes_lock);
- uobject_put(uobj);
+ config_item_put(item);
}
static struct configfs_set_operations nm_node_set_set_ops = {
- .make_object = nm_node_set_make_object,
- .drop_object = nm_node_set_drop_object,
+ .make_item = nm_node_set_make_item,
+ .drop_item = nm_node_set_drop_item,
};
-static struct uobj_type nm_node_set_type = {
+static struct config_item_type nm_node_set_type = {
.set_ops = &nm_node_set_set_ops,
.owner = THIS_MODULE,
};
/* cluster */
-static void nm_cluster_release(struct uobject *uobj)
+static void nm_cluster_release(struct config_item *item)
{
- struct nm_cluster *cluster = to_nm_cluster(uobj);
+ struct nm_cluster *cluster = to_nm_cluster(item);
kfree(cluster->cl_uset.default_sets);
kfree(cluster);
}
-static struct configfs_object_operations nm_cluster_object_ops = {
+static struct configfs_item_operations nm_cluster_item_ops = {
.release = nm_cluster_release,
};
-static struct uobj_type nm_cluster_type = {
- .object_ops = &nm_cluster_object_ops,
+static struct config_item_type nm_cluster_type = {
+ .item_ops = &nm_cluster_item_ops,
.owner = THIS_MODULE,
};
@@ -670,30 +670,30 @@
return ret;
}
-static void nm_cluster_set_drop_object(struct uset *uset, struct uobject *uobj)
+static void nm_cluster_set_drop_item(struct uset *uset, struct config_item *item)
{
- struct nm_cluster *cluster = to_nm_cluster(uobj);
+ struct nm_cluster *cluster = to_nm_cluster(item);
int i;
- struct uobject *killme;
+ struct config_item *killme;
BUG_ON(nm_single_cluster != cluster);
nm_single_cluster = NULL;
for (i = 0; cluster->cl_uset.default_sets[i]; i++) {
- killme = &cluster->cl_uset.default_sets[i]->uobj;
+ killme = &cluster->cl_uset.default_sets[i]->item;
cluster->cl_uset.default_sets[i] = NULL;
- uobject_put(killme);
+ config_item_put(killme);
}
- uobject_put(uobj);
+ config_item_put(item);
}
static struct configfs_set_operations nm_cluster_set_set_ops = {
.make_set = nm_cluster_set_make_set,
- .drop_object = nm_cluster_set_drop_object,
+ .drop_item = nm_cluster_set_drop_item,
};
-static struct uobj_type nm_cluster_set_type = {
+static struct config_item_type nm_cluster_set_type = {
.set_ops = &nm_cluster_set_set_ops,
.owner = THIS_MODULE,
};
@@ -701,7 +701,7 @@
static struct nm_cluster_set nm_cluster_set = {
.cs_subsys = {
.su_set = {
- .uobj = {
+ .item = {
.name = "cluster",
.ktype = &nm_cluster_set_type,
},
Modified: trunk/fs/ocfs2/cluster/nodemanager.h
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.h 2005-03-30 18:19:38 UTC (rev 2081)
+++ trunk/fs/ocfs2/cluster/nodemanager.h 2005-03-30 18:54:04 UTC (rev 2082)
@@ -74,7 +74,7 @@
} net_inode_private;
struct nm_node {
- struct uobject nd_uobj;
+ struct config_item nd_item;
char nd_name[NM_MAX_NAME_LEN+1]; /* replace? */
__u8 nd_num;
/* only one address per node, as attributes, for now. both
More information about the Ocfs2-commits
mailing list