[Ocfs2-commits] jlbec commits r2071 - in trunk/fs: configfs
ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Mar 29 16:09:28 CST 2005
Author: jlbec
Signed-off-by: manish
Date: 2005-03-29 16:09:26 -0600 (Tue, 29 Mar 2005)
New Revision: 2071
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/inode.c
trunk/fs/configfs/mount.c
trunk/fs/configfs/symlink.c
trunk/fs/configfs/uobject.c
trunk/fs/configfs/uobject.h
trunk/fs/ocfs2/cluster/heartbeat.c
trunk/fs/ocfs2/cluster/nodemanager.c
Log:
More usysfs->configfs
o Big sed job on the usysfs_ -> configfs_ names.
Signed-off-by: manish
Modified: trunk/fs/configfs/bobtest.c
===================================================================
--- trunk/fs/configfs/bobtest.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/bobtest.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -40,7 +40,7 @@
};
struct robert_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct robert *, char *);
};
@@ -65,13 +65,13 @@
.show = robert_print_read,
};
-static struct usysfs_attribute *robert_attrs[] = {
+static struct configfs_attribute *robert_attrs[] = {
&robert_attr_print.attr,
NULL,
};
static ssize_t robert_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct robert *robert = to_robert(uobj);
@@ -90,7 +90,7 @@
kfree(to_robert(uobj));
}
-static struct usysfs_object_operations robert_object_ops = {
+static struct configfs_object_operations robert_object_ops = {
.release = robert_release,
.show_attribute = robert_attr_show,
};
@@ -119,7 +119,7 @@
};
struct bob_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct bob *, char *);
ssize_t (*store)(struct bob *, const char *, size_t);
};
@@ -171,14 +171,14 @@
.show = bob_storeme_read,
.store = bob_storeme_write,
};
-static struct usysfs_attribute *bob_attrs[] = {
+static struct configfs_attribute *bob_attrs[] = {
&bob_attr_showme.attr,
&bob_attr_storeme.attr,
NULL,
};
static ssize_t bob_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct bob *bob = to_bob(uobj);
@@ -192,7 +192,7 @@
}
static ssize_t bob_attr_store(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
const char *page, size_t count)
{
struct bob *bob = to_bob(uobj);
@@ -211,7 +211,7 @@
kfree(to_bob(uobj));
}
-static struct usysfs_object_operations bob_object_ops = {
+static struct configfs_object_operations bob_object_ops = {
.release = bob_release,
.show_attribute = bob_attr_show,
.store_attribute = bob_attr_store,
@@ -225,24 +225,24 @@
struct bobset {
- struct usysfs_subsystem subsys;
+ struct configfs_subsystem subsys;
int n_bobs;
};
struct bobset_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct bobset *, char *);
};
static inline struct bobset *to_bobset(struct uset *uset)
{
return uset ?
- container_of(to_usysfs_subsystem(uset), struct bobset, subsys) :
+ container_of(to_configfs_subsystem(uset), struct bobset, subsys) :
NULL;
}
static ssize_t bobset_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct bobset *bobset = to_bobset(to_uset(uobj));
@@ -266,7 +266,7 @@
.show = bobset_bobs_read
};
-static struct usysfs_attribute *bobset_attrs[] = {
+static struct configfs_attribute *bobset_attrs[] = {
&bobset_attr_bobs.attr,
NULL,
};
@@ -306,11 +306,11 @@
uobject_put(uobj);
}
-static struct usysfs_object_operations bobset_object_ops = {
+static struct configfs_object_operations bobset_object_ops = {
.show_attribute = bobset_attr_show,
};
-static struct usysfs_set_operations bobset_set_ops = {
+static struct configfs_set_operations bobset_set_ops = {
.make_object = make_bob,
.drop_object = drop_bob,
};
@@ -344,7 +344,7 @@
};
struct jerry_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct jerry *, char *);
ssize_t (*store)(struct jerry *, const char *, size_t);
};
@@ -398,14 +398,14 @@
.show = jerry_storeme_read,
.store = jerry_storeme_write,
};
-static struct usysfs_attribute *jerry_attrs[] = {
+static struct configfs_attribute *jerry_attrs[] = {
&jerry_attr_showme.attr,
&jerry_attr_storeme.attr,
NULL,
};
static ssize_t jerry_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct jerry *jerry = to_jerry(uobj);
@@ -419,7 +419,7 @@
}
static ssize_t jerry_attr_store(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
const char *page, size_t count)
{
struct jerry *jerry = to_jerry(uobj);
@@ -448,7 +448,7 @@
return ret;
}
-static struct usysfs_object_operations jerry_object_ops = {
+static struct configfs_object_operations jerry_object_ops = {
.release = jerry_release,
.show_attribute = jerry_attr_show,
.store_attribute = jerry_attr_store,
@@ -468,7 +468,7 @@
};
struct tom_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct tom *, char *);
ssize_t (*store)(struct tom *, const char *, size_t);
};
@@ -522,14 +522,14 @@
.show = tom_storeme_read,
.store = tom_storeme_write,
};
-static struct usysfs_attribute *tom_attrs[] = {
+static struct configfs_attribute *tom_attrs[] = {
&tom_attr_showme.attr,
&tom_attr_storeme.attr,
NULL,
};
static ssize_t tom_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct tom *tom = to_tom(uobj);
@@ -543,7 +543,7 @@
}
static ssize_t tom_attr_store(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
const char *page, size_t count)
{
struct tom *tom = to_tom(uobj);
@@ -566,7 +566,7 @@
kfree(tom);
}
-static struct usysfs_object_operations tom_object_ops = {
+static struct configfs_object_operations tom_object_ops = {
.release = tom_release,
.show_attribute = tom_attr_show,
.store_attribute = tom_attr_store,
@@ -580,24 +580,24 @@
struct tomset {
- struct usysfs_subsystem subsys;
+ struct configfs_subsystem subsys;
int n_toms;
};
struct tomset_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct tomset *, char *);
};
static inline struct tomset *to_tomset(struct uset *uset)
{
return uset ?
- container_of(to_usysfs_subsystem(uset), struct tomset, subsys) :
+ container_of(to_configfs_subsystem(uset), struct tomset, subsys) :
NULL;
}
static ssize_t tomset_attr_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct tomset *tomset = to_tomset(to_uset(uobj));
@@ -621,7 +621,7 @@
.show = tomset_toms_read
};
-static struct usysfs_attribute *tomset_attrs[] = {
+static struct configfs_attribute *tomset_attrs[] = {
&tomset_attr_toms.attr,
NULL,
};
@@ -682,11 +682,11 @@
uobject_put(uobj);
}
-static struct usysfs_object_operations tomset_object_ops = {
+static struct configfs_object_operations tomset_object_ops = {
.show_attribute = tomset_attr_show,
};
-static struct usysfs_set_operations tomset_set_ops = {
+static struct configfs_set_operations tomset_set_ops = {
.make_set = make_tom,
.drop_object = drop_tom,
};
@@ -718,9 +718,9 @@
uset_init(&robert.uset);
uset_init(&tomset.subsys.su_set);
init_MUTEX(&tomset.subsys.su_sem);
- ret = usysfs_register_subsystem(&bobset.subsys);
+ ret = configfs_register_subsystem(&bobset.subsys);
if (!ret)
- ret = usysfs_register_subsystem(&tomset.subsys);
+ ret = configfs_register_subsystem(&tomset.subsys);
if (ret)
printk(KERN_ERR "bobtest: Registration returned %d\n", ret);
@@ -729,8 +729,8 @@
static void __exit bobtest_exit(void)
{
- usysfs_unregister_subsystem(&tomset.subsys);
- usysfs_unregister_subsystem(&bobset.subsys);
+ configfs_unregister_subsystem(&tomset.subsys);
+ configfs_unregister_subsystem(&bobset.subsys);
}
module_init(bobtest_init);
Modified: trunk/fs/configfs/configfs.h
===================================================================
--- trunk/fs/configfs/configfs.h 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/configfs.h 2005-03-29 22:09:26 UTC (rev 2071)
@@ -1,7 +1,7 @@
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
- * usysfs.h - definitions for the device driver filesystem
+ * configfs.h - definitions for the device driver filesystem
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -21,13 +21,13 @@
* Based on sysfs:
* sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
*
- * usysfs Copyright (C) 2005 Oracle. All rights reserved.
+ * configfs Copyright (C) 2005 Oracle. All rights reserved.
*
- * Please see Documentation/filesystems/usysfs.txt for more information.
+ * Please see Documentation/filesystems/configfs.txt for more information.
*/
-#ifndef _USYSFS_H_
-#define _USYSFS_H_
+#ifndef _CONFIGFS_H_
+#define _CONFIGFS_H_
#include <asm/atomic.h>
#include <asm/semaphore.h>
@@ -36,7 +36,7 @@
struct module;
-struct usysfs_attribute {
+struct configfs_attribute {
char * name;
struct module * owner;
mode_t mode;
@@ -56,15 +56,15 @@
* If the uset has commit(), it supports pending and commited (active)
* objects.
*/
-struct usysfs_object_operations {
+struct configfs_object_operations {
void (*release)(struct uobject *);
- ssize_t (*show_attribute)(struct uobject *, struct usysfs_attribute *,char *);
- ssize_t (*store_attribute)(struct uobject *,struct usysfs_attribute *,const char *, size_t);
+ 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 usysfs_set_operations {
+struct configfs_set_operations {
struct uobject *(*make_object)(struct uset *uset, const char *name);
struct uset *(*make_set)(struct uset *uset, const char *name);
int (*commit)(struct uobject *uobj);
@@ -94,19 +94,19 @@
#define attr_name(_attr) (_attr).attr.name
-struct usysfs_subsystem {
+struct configfs_subsystem {
struct uset su_set;
struct semaphore su_sem;
};
-static inline struct usysfs_subsystem *to_usysfs_subsystem(struct uset *uset)
+static inline struct configfs_subsystem *to_configfs_subsystem(struct uset *uset)
{
return uset ?
- container_of(uset, struct usysfs_subsystem, su_set) :
+ container_of(uset, struct configfs_subsystem, su_set) :
NULL;
}
-int usysfs_register_subsystem(struct usysfs_subsystem *subsys);
-void usysfs_unregister_subsystem(struct usysfs_subsystem *subsys);
+int configfs_register_subsystem(struct configfs_subsystem *subsys);
+void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
-#endif /* _USYSFS_H_ */
+#endif /* _CONFIGFS_H_ */
Modified: trunk/fs/configfs/configfs_internal.h
===================================================================
--- trunk/fs/configfs/configfs_internal.h 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/configfs_internal.h 2005-03-29 22:09:26 UTC (rev 2071)
@@ -1,7 +1,7 @@
/* -*- mode: c; c-basic-offset:8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
- * usysfs_internal.h - Internal stuff for usysfs
+ * configfs_internal.h - Internal stuff for configfs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -21,7 +21,7 @@
* Based on sysfs:
* sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
*
- * usysfs Copyright (C) 2005 Oracle. All rights reserved.
+ * configfs Copyright (C) 2005 Oracle. All rights reserved.
*/
#include <linux/version.h>
@@ -31,7 +31,7 @@
#include <linux/slab.h>
#include <linux/list.h>
-struct usysfs_dirent {
+struct configfs_dirent {
atomic_t s_count;
struct list_head s_sibling;
struct list_head s_children;
@@ -42,77 +42,77 @@
struct dentry * s_dentry;
};
-#define USYSFS_ROOT 0x0001
-#define USYSFS_DIR 0x0002
-#define USYSFS_UOBJ_ATTR 0x0004
-#define USYSFS_UOBJ_LINK 0x0020
-#define USYSFS_USET_DIR 0x0040
-#define USYSFS_USET_DEFAULT 0x0080
-#define USYSFS_NOT_PINNED (USYSFS_UOBJ_ATTR)
+#define CONFIGFS_ROOT 0x0001
+#define CONFIGFS_DIR 0x0002
+#define CONFIGFS_UOBJ_ATTR 0x0004
+#define CONFIGFS_UOBJ_LINK 0x0020
+#define CONFIGFS_USET_DIR 0x0040
+#define CONFIGFS_USET_DEFAULT 0x0080
+#define CONFIGFS_NOT_PINNED (CONFIGFS_UOBJ_ATTR)
-extern struct vfsmount * usysfs_mount;
+extern struct vfsmount * configfs_mount;
-extern int usysfs_is_root(struct uobject *uobj);
+extern int configfs_is_root(struct uobject *uobj);
-extern struct inode * usysfs_new_inode(mode_t mode);
-extern int usysfs_create(struct dentry *, int mode, int (*init)(struct inode *));
+extern struct inode * configfs_new_inode(mode_t mode);
+extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *));
-extern int usysfs_create_file(struct uobject *, const struct usysfs_attribute *);
-extern int usysfs_make_dirent(struct usysfs_dirent *, struct dentry *, void *,
- umode_t, int);
-extern struct dentry * usysfs_get_dentry(struct dentry *, const char *);
+extern int configfs_create_file(struct uobject *, 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 *);
-extern int usysfs_add_file(struct dentry *, const struct usysfs_attribute *, int);
-extern void usysfs_hash_and_remove(struct dentry * dir, const char * name);
+extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
+extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
-extern const unsigned char * usysfs_get_name(struct usysfs_dirent *sd);
-extern void usysfs_drop_dentry(struct usysfs_dirent *sd, struct dentry *parent);
+extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
+extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
-extern int usysfs_pin_fs(void);
-extern void usysfs_release_fs(void);
+extern int configfs_pin_fs(void);
+extern void configfs_release_fs(void);
-extern struct rw_semaphore usysfs_rename_sem;
-extern struct super_block * usysfs_sb;
-extern struct file_operations usysfs_dir_operations;
-extern struct file_operations usysfs_file_operations;
+extern struct rw_semaphore configfs_rename_sem;
+extern struct super_block * configfs_sb;
+extern struct file_operations configfs_dir_operations;
+extern struct file_operations configfs_file_operations;
extern struct file_operations bin_fops;
-extern struct inode_operations usysfs_dir_inode_operations;
-extern struct inode_operations usysfs_symlink_inode_operations;
+extern struct inode_operations configfs_dir_inode_operations;
+extern struct inode_operations configfs_symlink_inode_operations;
-extern int usysfs_symlink(struct inode *dir, struct dentry *dentry,
- const char *symname);
-extern int usysfs_unlink(struct inode *dir, struct dentry *dentry);
+extern int configfs_symlink(struct inode *dir, struct dentry *dentry,
+ const char *symname);
+extern int configfs_unlink(struct inode *dir, struct dentry *dentry);
-struct usysfs_symlink {
+struct configfs_symlink {
struct list_head sl_list;
struct uobject *sl_target;
};
-extern int usysfs_create_link(struct usysfs_symlink *sl,
- struct dentry *parent,
- struct dentry *dentry);
+extern int configfs_create_link(struct configfs_symlink *sl,
+ struct dentry *parent,
+ struct dentry *dentry);
static inline struct uobject * to_uobj(struct dentry * dentry)
{
- struct usysfs_dirent * sd = dentry->d_fsdata;
+ struct configfs_dirent * sd = dentry->d_fsdata;
return ((struct uobject *) sd->s_element);
}
-static inline struct usysfs_attribute * to_attr(struct dentry * dentry)
+static inline struct configfs_attribute * to_attr(struct dentry * dentry)
{
- struct usysfs_dirent * sd = dentry->d_fsdata;
- return ((struct usysfs_attribute *) sd->s_element);
+ struct configfs_dirent * sd = dentry->d_fsdata;
+ return ((struct configfs_attribute *) sd->s_element);
}
-static inline struct uobject *usysfs_get_uobject(struct dentry *dentry)
+static inline struct uobject *configfs_get_uobject(struct dentry *dentry)
{
struct uobject * uobj = NULL;
spin_lock(&dcache_lock);
if (!d_unhashed(dentry)) {
- struct usysfs_dirent * sd = dentry->d_fsdata;
- if (sd->s_type & USYSFS_UOBJ_LINK) {
- struct usysfs_symlink * sl = sd->s_element;
+ 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);
} else
uobj = uobject_get(sd->s_element);
@@ -122,13 +122,13 @@
return uobj;
}
-static inline void release_usysfs_dirent(struct usysfs_dirent * sd)
+static inline void release_configfs_dirent(struct configfs_dirent * sd)
{
- if (!(sd->s_type & USYSFS_ROOT))
+ if (!(sd->s_type & CONFIGFS_ROOT))
kfree(sd);
}
-static inline struct usysfs_dirent * usysfs_get(struct usysfs_dirent * sd)
+static inline struct configfs_dirent * configfs_get(struct configfs_dirent * sd)
{
if (sd) {
WARN_ON(!atomic_read(&sd->s_count));
@@ -137,10 +137,10 @@
return sd;
}
-static inline void usysfs_put(struct usysfs_dirent * sd)
+static inline void configfs_put(struct configfs_dirent * sd)
{
WARN_ON(!atomic_read(&sd->s_count));
if (atomic_dec_and_test(&sd->s_count))
- release_usysfs_dirent(sd);
+ release_configfs_dirent(sd);
}
Modified: trunk/fs/configfs/dir.c
===================================================================
--- trunk/fs/configfs/dir.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/dir.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -37,17 +37,17 @@
#include "configfs.h"
#include "configfs_internal.h"
-DECLARE_RWSEM(usysfs_rename_sem);
-static spinlock_t usysfs_linkage_lock = SPIN_LOCK_UNLOCKED;
+DECLARE_RWSEM(configfs_rename_sem);
+static spinlock_t configfs_linkage_lock = SPIN_LOCK_UNLOCKED;
-static void usysfs_d_iput(struct dentry * dentry, struct inode * inode)
+static void configfs_d_iput(struct dentry * dentry, struct inode * inode)
{
- struct usysfs_dirent * sd = dentry->d_fsdata;
+ struct configfs_dirent * sd = dentry->d_fsdata;
if (sd) {
BUG_ON(sd->s_dentry != dentry);
sd->s_dentry = NULL;
- usysfs_put(sd);
+ configfs_put(sd);
}
iput(inode);
}
@@ -56,24 +56,24 @@
* We _must_ delete our dentries on last dput, as the chain-to-parent
* behavior is required to clear the parents of default_sets.
*/
-static int usysfs_d_delete(struct dentry *dentry)
+static int configfs_d_delete(struct dentry *dentry)
{
return 1;
}
-static struct dentry_operations usysfs_dentry_ops = {
- .d_iput = usysfs_d_iput,
+static struct dentry_operations configfs_dentry_ops = {
+ .d_iput = configfs_d_iput,
/* simple_delete_dentry() isn't exported */
- .d_delete = usysfs_d_delete,
+ .d_delete = configfs_d_delete,
};
/*
- * Allocates a new usysfs_dirent and links it to the parent usysfs_dirent
+ * Allocates a new configfs_dirent and links it to the parent configfs_dirent
*/
-static struct usysfs_dirent * usysfs_new_dirent(struct usysfs_dirent * parent_sd,
+static struct configfs_dirent * configfs_new_dirent(struct configfs_dirent * parent_sd,
void * element)
{
- struct usysfs_dirent * sd;
+ struct configfs_dirent * sd;
sd = kmalloc(sizeof(*sd), GFP_KERNEL);
if (!sd)
@@ -89,12 +89,12 @@
return sd;
}
-int usysfs_make_dirent(struct usysfs_dirent * parent_sd, struct dentry * dentry,
+int configfs_make_dirent(struct configfs_dirent * parent_sd, struct dentry * dentry,
void * element, umode_t mode, int type)
{
- struct usysfs_dirent * sd;
+ struct configfs_dirent * sd;
- sd = usysfs_new_dirent(parent_sd, element);
+ sd = configfs_new_dirent(parent_sd, element);
if (!sd)
return -ENOMEM;
@@ -102,8 +102,8 @@
sd->s_type = type;
sd->s_dentry = dentry;
if (dentry) {
- dentry->d_fsdata = usysfs_get(sd);
- dentry->d_op = &usysfs_dentry_ops;
+ dentry->d_fsdata = configfs_get(sd);
+ dentry->d_op = &configfs_dentry_ops;
}
return 0;
@@ -111,8 +111,8 @@
static int init_dir(struct inode * inode)
{
- inode->i_op = &usysfs_dir_inode_operations;
- inode->i_fop = &usysfs_dir_operations;
+ inode->i_op = &configfs_dir_inode_operations;
+ inode->i_fop = &configfs_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
@@ -122,13 +122,13 @@
static int init_file(struct inode * inode)
{
inode->i_size = PAGE_SIZE;
- inode->i_fop = &usysfs_file_operations;
+ inode->i_fop = &configfs_file_operations;
return 0;
}
static int init_symlink(struct inode * inode)
{
- inode->i_op = &usysfs_symlink_inode_operations;
+ inode->i_op = &configfs_symlink_inode_operations;
return 0;
}
@@ -138,13 +138,13 @@
int error;
umode_t mode = S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO;
- error = usysfs_create(d, mode, init_dir);
+ error = configfs_create(d, mode, init_dir);
if (!error) {
- error = usysfs_make_dirent(p->d_fsdata, d, k, mode,
- USYSFS_DIR);
+ error = configfs_make_dirent(p->d_fsdata, d, k, mode,
+ CONFIGFS_DIR);
if (!error) {
p->d_inode->i_nlink++;
- (d)->d_op = &usysfs_dentry_ops;
+ (d)->d_op = &configfs_dentry_ops;
}
}
return error;
@@ -152,12 +152,12 @@
/**
- * usysfs_create_dir - create a directory for an object.
+ * configfs_create_dir - create a directory for an object.
* @parent: parent parent object.
* @uobj: object we're creating directory for.
*/
-static int usysfs_create_dir(struct uobject * uobj, struct dentry *dentry)
+static int configfs_create_dir(struct uobject * uobj, struct dentry *dentry)
{
struct dentry * parent;
int error = 0;
@@ -166,8 +166,8 @@
if (uobj->parent)
parent = uobj->parent->dentry;
- else if (usysfs_mount && usysfs_mount->mnt_sb)
- parent = usysfs_mount->mnt_sb->s_root;
+ else if (configfs_mount && configfs_mount->mnt_sb)
+ parent = configfs_mount->mnt_sb->s_root;
else
return -EFAULT;
@@ -177,18 +177,18 @@
return error;
}
-int usysfs_create_link(struct usysfs_symlink *sl, struct dentry *parent,
+int configfs_create_link(struct configfs_symlink *sl, struct dentry *parent,
struct dentry *dentry)
{
int err = 0;
umode_t mode = S_IFLNK | S_IRWXUGO;
- err = usysfs_create(dentry, mode, init_symlink);
+ err = configfs_create(dentry, mode, init_symlink);
if (!err) {
- err = usysfs_make_dirent(parent->d_fsdata, dentry, sl,
- mode, USYSFS_UOBJ_LINK);
+ err = configfs_make_dirent(parent->d_fsdata, dentry, sl,
+ mode, CONFIGFS_UOBJ_LINK);
if (!err)
- dentry->d_op = &usysfs_dentry_ops;
+ dentry->d_op = &configfs_dentry_ops;
}
return err;
}
@@ -196,11 +196,11 @@
static void remove_dir(struct dentry * d)
{
struct dentry * parent = dget(d->d_parent);
- struct usysfs_dirent * sd;
+ struct configfs_dirent * sd;
sd = d->d_fsdata;
list_del_init(&sd->s_sibling);
- usysfs_put(sd);
+ configfs_put(sd);
if (d->d_inode)
simple_rmdir(parent->d_inode,d);
@@ -211,15 +211,15 @@
}
/**
- * usysfs_remove_dir - remove an object's directory.
+ * configfs_remove_dir - remove an object's directory.
* @uobj: object.
*
* 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 usysfs_rmdir() below, instead of calling separately.
+ * what used to be configfs_rmdir() below, instead of calling separately.
*/
-static void usysfs_remove_dir(struct uobject * uobj)
+static void configfs_remove_dir(struct uobject * uobj)
{
struct dentry * dentry = dget(uobj->dentry);
@@ -234,43 +234,43 @@
}
-/* attaches attribute's usysfs_dirent to the dentry corresponding to the
+/* attaches attribute's configfs_dirent to the dentry corresponding to the
* attribute file
*/
-static int usysfs_attach_attr(struct usysfs_dirent * sd, struct dentry * dentry)
+static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * dentry)
{
- struct usysfs_attribute * attr = sd->s_element;
+ struct configfs_attribute * attr = sd->s_element;
int error;
- error = usysfs_create(dentry, (attr->mode & S_IALLUGO) | S_IFREG, init_file);
+ error = configfs_create(dentry, (attr->mode & S_IALLUGO) | S_IFREG, init_file);
if (error)
return error;
- dentry->d_op = &usysfs_dentry_ops;
- dentry->d_fsdata = usysfs_get(sd);
+ dentry->d_op = &configfs_dentry_ops;
+ dentry->d_fsdata = configfs_get(sd);
sd->s_dentry = dentry;
d_rehash(dentry);
return 0;
}
-static struct dentry * usysfs_lookup(struct inode *dir, struct dentry *dentry,
+static struct dentry * configfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
{
- struct usysfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
- struct usysfs_dirent * sd;
+ struct configfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
+ struct configfs_dirent * sd;
int found = 0;
int err = 0;
list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
- if (sd->s_type & USYSFS_NOT_PINNED) {
- const unsigned char * name = usysfs_get_name(sd);
+ if (sd->s_type & CONFIGFS_NOT_PINNED) {
+ const unsigned char * name = configfs_get_name(sd);
if (strcmp(name, dentry->d_name.name))
continue;
found = 1;
- err = usysfs_attach_attr(sd, dentry);
+ err = configfs_attach_attr(sd, dentry);
break;
}
}
@@ -287,13 +287,13 @@
}
/*
- * Only subdirectories count here. Files (USYSFS_NOT_PINNED) are
+ * Only subdirectories count here. Files (CONFIGFS_NOT_PINNED) are
* attributes and are removed by rmdir().
*/
-static int usysfs_empty_dir(struct dentry *dentry)
+static int configfs_empty_dir(struct dentry *dentry)
{
- struct usysfs_dirent *parent_sd = dentry->d_fsdata;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *parent_sd = dentry->d_fsdata;
+ struct configfs_dirent *sd;
int ret;
ret = -EBUSY;
@@ -302,11 +302,11 @@
ret = 0;
list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
- if (sd->s_type & USYSFS_NOT_PINNED)
+ if (sd->s_type & CONFIGFS_NOT_PINNED)
continue;
/* Eww, recursion */
- if (sd->s_type & USYSFS_USET_DEFAULT) {
- ret = usysfs_empty_dir(sd->s_dentry);
+ if (sd->s_type & CONFIGFS_USET_DEFAULT) {
+ ret = configfs_empty_dir(sd->s_dentry);
if (!ret)
continue;
} else
@@ -322,22 +322,22 @@
static void drop_attrs(struct uobject * uobj)
{
struct dentry * dentry = dget(uobj->dentry);
- struct usysfs_dirent * parent_sd;
- struct usysfs_dirent * sd, * tmp;
+ struct configfs_dirent * parent_sd;
+ struct configfs_dirent * sd, * tmp;
if (!dentry)
return;
- pr_debug("usysfs %s: dropping attrs for dir\n",
+ pr_debug("configfs %s: dropping attrs for dir\n",
dentry->d_name.name);
parent_sd = dentry->d_fsdata;
list_for_each_entry_safe(sd, tmp, &parent_sd->s_children, s_sibling) {
- if (!sd->s_element || !(sd->s_type & USYSFS_NOT_PINNED))
+ if (!sd->s_element || !(sd->s_type & CONFIGFS_NOT_PINNED))
continue;
list_del_init(&sd->s_sibling);
- usysfs_drop_dentry(sd, dentry);
- usysfs_put(sd);
+ configfs_drop_dentry(sd, dentry);
+ configfs_put(sd);
}
/**
@@ -349,7 +349,7 @@
static int populate_attrs(struct uobject *uobj)
{
struct uobj_type *t = uobj->ktype;
- struct usysfs_attribute *attr;
+ struct configfs_attribute *attr;
int error = 0;
int i;
@@ -357,7 +357,7 @@
return -EINVAL;
if (t->attrs) {
for (i = 0; (attr = t->attrs[i]) != NULL; i++) {
- if ((error = usysfs_create_file(uobj, attr)))
+ if ((error = configfs_create_file(uobj, attr)))
break;
}
}
@@ -368,17 +368,17 @@
return error;
}
-static int usysfs_instantiate_set(struct uobject *parent_uobj,
- struct uobject *uobj,
- struct dentry *dentry);
-static void usysfs_drop_set(struct uobject *uobj);
+static int configfs_instantiate_set(struct uobject *parent_uobj,
+ struct uobject *uobj,
+ struct dentry *dentry);
+static void configfs_drop_set(struct uobject *uobj);
static void drop_sets(struct uset *uset)
{
struct dentry * dentry = dget(uset->uobj.dentry);
struct dentry *child;
- struct usysfs_dirent *parent_sd;
- struct usysfs_dirent *sd, *tmp;
+ struct configfs_dirent *parent_sd;
+ struct configfs_dirent *sd, *tmp;
if (!dentry)
return;
@@ -386,14 +386,14 @@
parent_sd = dentry->d_fsdata;
list_for_each_entry_safe(sd, tmp, &parent_sd->s_children, s_sibling) {
if (!sd->s_element ||
- !(sd->s_type & USYSFS_USET_DEFAULT))
+ !(sd->s_type & CONFIGFS_USET_DEFAULT))
continue;
child = sd->s_dentry;
/* And now we're faking rmdir. Viro must hate me */
down(&child->d_inode->i_sem);
- usysfs_drop_set(sd->s_element);
+ configfs_drop_set(sd->s_element);
child->d_inode->i_flags |= S_DEAD;
up(&child->d_inode->i_sem);
@@ -420,7 +420,7 @@
{
int ret;
struct qstr name;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *sd;
/* We trust the caller holds a reference to parent */
struct dentry *child, *parent = parent_uset->uobj.dentry;
@@ -435,11 +435,11 @@
if (child) {
d_add(child, NULL);
- ret = usysfs_instantiate_set(&parent_uset->uobj,
- &uset->uobj, child);
+ ret = configfs_instantiate_set(&parent_uset->uobj,
+ &uset->uobj, child);
if (!ret) {
sd = child->d_fsdata;
- sd->s_type |= USYSFS_USET_DEFAULT;
+ sd->s_type |= CONFIGFS_USET_DEFAULT;
} else {
d_delete(child);
dput(child);
@@ -495,9 +495,9 @@
set = uobj->uset;
if (set) {
- spin_lock(&usysfs_linkage_lock);
+ spin_lock(&configfs_linkage_lock);
list_del_init(&uobj->entry);
- spin_unlock(&usysfs_linkage_lock);
+ spin_unlock(&configfs_linkage_lock);
uobj->uset = NULL;
uobj->parent = NULL;
@@ -511,17 +511,17 @@
{
uobj->uset = uset_get(to_uset(parent_uobj));
- spin_lock(&usysfs_linkage_lock);
+ spin_lock(&configfs_linkage_lock);
list_add_tail(&uobj->entry, &uobj->uset->list);
- spin_unlock(&usysfs_linkage_lock);
+ spin_unlock(&configfs_linkage_lock);
uobj->parent = parent_uobj;
uobject_get(uobj);
}
/*
- * The goal is that usysfs_instantiate_object() (and
- * usysfs_instantiate_set()) can be called from either the VFS or this
+ * The goal is that configfs_instantiate_object() (and
+ * configfs_instantiate_set()) can be called from either the VFS or this
* module. That is, they assume that the objects have been created,
* the dentry allocated, and the dcache is all ready to go.
*
@@ -529,23 +529,23 @@
* had never been called. The caller (VFS or local function) will
* handle cleaning up the dcache bits.
*
- * usysfs_drop_set() and usysfs_drop_object() behave similarly on the
+ * configfs_drop_set() and configfs_drop_object() behave similarly on the
* way out. They assume that the proper semaphores are held, they
- * clean up the usysfs objects, and they expect their callers will
+ * clean up the configfs objects, and they expect their callers will
* handle the dcache bits.
*/
-static int usysfs_instantiate_object(struct uobject *parent_uobj,
- struct uobject *uobj,
- struct dentry *dentry)
+static int configfs_instantiate_object(struct uobject *parent_uobj,
+ struct uobject *uobj,
+ struct dentry *dentry)
{
int ret;
link_obj(parent_uobj, uobj);
- ret = usysfs_create_dir(uobj, dentry);
+ ret = configfs_create_dir(uobj, dentry);
if (!ret) {
ret = populate_attrs(uobj);
if (ret) {
- usysfs_remove_dir(uobj);
+ configfs_remove_dir(uobj);
unlink_obj(uobj);
d_delete(dentry);
}
@@ -554,28 +554,28 @@
return ret;
}
-static void usysfs_drop_object(struct uobject *uobj)
+static void configfs_drop_object(struct uobject *uobj)
{
drop_attrs(uobj);
- usysfs_remove_dir(uobj);
+ configfs_remove_dir(uobj);
unlink_obj(uobj);
}
-static int usysfs_instantiate_set(struct uobject *parent_uobj,
- struct uobject *uobj,
- struct dentry *dentry)
+static int configfs_instantiate_set(struct uobject *parent_uobj,
+ struct uobject *uobj,
+ struct dentry *dentry)
{
int ret;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *sd;
- ret = usysfs_instantiate_object(parent_uobj, uobj, dentry);
+ ret = configfs_instantiate_object(parent_uobj, uobj, dentry);
if (!ret) {
sd = dentry->d_fsdata;
- sd->s_type |= USYSFS_USET_DIR;
+ sd->s_type |= CONFIGFS_USET_DIR;
ret = populate_sets(to_uset(uobj));
if (ret) {
- usysfs_drop_object(uobj);
+ configfs_drop_object(uobj);
d_delete(dentry);
}
}
@@ -583,10 +583,10 @@
return ret;
}
-static void usysfs_drop_set(struct uobject *uobj)
+static void configfs_drop_set(struct uobject *uobj)
{
drop_sets(to_uset(uobj));
- usysfs_drop_object(uobj);
+ configfs_drop_object(uobj);
}
/*
@@ -611,25 +611,25 @@
}
-static int usysfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
int ret;
struct uset *uset;
struct uobject *uobj;
struct uobject *parent_uobj;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *sd;
struct uobj_type *uktype;
struct module *owner;
char *name;
- if (dentry->d_parent == usysfs_sb->s_root)
+ if (dentry->d_parent == configfs_sb->s_root)
return -EPERM;
sd = dentry->d_parent->d_fsdata;
- if (!(sd->s_type & USYSFS_USET_DIR))
+ if (!(sd->s_type & CONFIGFS_USET_DIR))
return -EPERM;
- parent_uobj = usysfs_get_uobject(dentry->d_parent);
+ parent_uobj = configfs_get_uobject(dentry->d_parent);
uktype = parent_uobj->ktype;
if (!uktype || !uktype->set_ops ||
@@ -664,12 +664,13 @@
owner = uktype->owner;
if (try_module_get(owner)) {
if (uset)
- ret = usysfs_instantiate_set(parent_uobj,
- uobj,
- dentry);
+ ret = configfs_instantiate_set(parent_uobj,
+ uobj,
+ dentry);
else
- ret = usysfs_instantiate_object(parent_uobj,
- uobj, dentry);
+ ret = configfs_instantiate_object(parent_uobj,
+ uobj,
+ dentry);
if (ret) {
client_drop_object(parent_uobj, uobj);
uobject_put(parent_uobj);
@@ -681,35 +682,35 @@
return ret;
}
-static int usysfs_rmdir(struct inode *dir, struct dentry *dentry)
+static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
{
struct uobject *parent_uobj;
struct uobject *uobj;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *sd;
struct module *owner = NULL;
int ret;
- if (dentry->d_parent == usysfs_sb->s_root)
+ if (dentry->d_parent == configfs_sb->s_root)
return -EPERM;
sd = dentry->d_fsdata;
- if (sd->s_type & USYSFS_USET_DEFAULT)
+ if (sd->s_type & CONFIGFS_USET_DEFAULT)
return -EPERM;
- parent_uobj = usysfs_get_uobject(dentry->d_parent);
+ parent_uobj = configfs_get_uobject(dentry->d_parent);
if (!parent_uobj->ktype) {
uobject_put(parent_uobj);
return -EINVAL;
}
- ret = usysfs_empty_dir(dentry);
+ ret = configfs_empty_dir(dentry);
if (ret) {
uobject_put(parent_uobj);
return ret;
}
- uobj = usysfs_get_uobject(dentry);
+ uobj = configfs_get_uobject(dentry);
/* Drop reference from above, uobj already holds one. */
uobject_put(parent_uobj);
@@ -717,10 +718,10 @@
if (uobj->ktype)
owner = uobj->ktype->owner;
- if (sd->s_type & USYSFS_USET_DIR)
- usysfs_drop_set(uobj);
+ if (sd->s_type & CONFIGFS_USET_DIR)
+ configfs_drop_set(uobj);
else
- usysfs_drop_object(uobj);
+ configfs_drop_object(uobj);
client_drop_object(parent_uobj, uobj);
@@ -733,25 +734,25 @@
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-static inline struct dentry *usysfs_lookup_compat(struct inode *dir, struct dentry *dentry)
+static inline struct dentry *configfs_lookup_compat(struct inode *dir, struct dentry *dentry)
{
- return usysfs_lookup(dir, dentry, NULL);
+ return configfs_lookup(dir, dentry, NULL);
}
#endif
-struct inode_operations usysfs_dir_inode_operations = {
- .mkdir = usysfs_mkdir,
- .rmdir = usysfs_rmdir,
- .symlink = usysfs_symlink,
- .unlink = usysfs_unlink,
+struct inode_operations configfs_dir_inode_operations = {
+ .mkdir = configfs_mkdir,
+ .rmdir = configfs_rmdir,
+ .symlink = configfs_symlink,
+ .unlink = configfs_unlink,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- .lookup = usysfs_lookup,
+ .lookup = configfs_lookup,
#else
- .lookup = usysfs_lookup_compat,
+ .lookup = configfs_lookup_compat,
#endif
};
-int usysfs_rename_dir(struct uobject * uobj, const char *new_name)
+int configfs_rename_dir(struct uobject * uobj, const char *new_name)
{
int error = 0;
struct dentry * new_dentry, * parent;
@@ -762,12 +763,12 @@
if (!uobj->parent)
return -EINVAL;
- down_write(&usysfs_rename_sem);
+ down_write(&configfs_rename_sem);
parent = uobj->parent->dentry;
down(&parent->d_inode->i_sem);
- new_dentry = usysfs_get_dentry(parent, new_name);
+ 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);
@@ -782,49 +783,49 @@
dput(new_dentry);
}
up(&parent->d_inode->i_sem);
- up_write(&usysfs_rename_sem);
+ up_write(&configfs_rename_sem);
return error;
}
-static int usysfs_dir_open(struct inode *inode, struct file *file)
+static int configfs_dir_open(struct inode *inode, struct file *file)
{
struct dentry * dentry = file->f_dentry;
- struct usysfs_dirent * parent_sd = dentry->d_fsdata;
+ struct configfs_dirent * parent_sd = dentry->d_fsdata;
down(&dentry->d_inode->i_sem);
- file->private_data = usysfs_new_dirent(parent_sd, NULL);
+ file->private_data = configfs_new_dirent(parent_sd, NULL);
up(&dentry->d_inode->i_sem);
return file->private_data ? 0 : -ENOMEM;
}
-static int usysfs_dir_close(struct inode *inode, struct file *file)
+static int configfs_dir_close(struct inode *inode, struct file *file)
{
struct dentry * dentry = file->f_dentry;
- struct usysfs_dirent * cursor = file->private_data;
+ struct configfs_dirent * cursor = file->private_data;
down(&dentry->d_inode->i_sem);
list_del_init(&cursor->s_sibling);
up(&dentry->d_inode->i_sem);
- release_usysfs_dirent(cursor);
+ release_configfs_dirent(cursor);
return 0;
}
/* Relationship between s_mode and the DT_xxx types */
-static inline unsigned char dt_type(struct usysfs_dirent *sd)
+static inline unsigned char dt_type(struct configfs_dirent *sd)
{
return (sd->s_mode >> 12) & 15;
}
-static int usysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
+static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
struct dentry *dentry = filp->f_dentry;
- struct usysfs_dirent * parent_sd = dentry->d_fsdata;
- struct usysfs_dirent *cursor = filp->private_data;
+ struct configfs_dirent * parent_sd = dentry->d_fsdata;
+ struct configfs_dirent *cursor = filp->private_data;
struct list_head *p, *q = &cursor->s_sibling;
ino_t ino;
int i = filp->f_pos;
@@ -850,21 +851,21 @@
list_add(q, &parent_sd->s_children);
}
for (p=q->next; p!= &parent_sd->s_children; p=p->next) {
- struct usysfs_dirent *next;
+ struct configfs_dirent *next;
const char * name;
int len;
- next = list_entry(p, struct usysfs_dirent,
+ next = list_entry(p, struct configfs_dirent,
s_sibling);
if (!next->s_element)
continue;
- name = usysfs_get_name(next);
+ name = configfs_get_name(next);
len = strlen(name);
if (next->s_dentry)
ino = next->s_dentry->d_inode->i_ino;
else
- ino = iunique(usysfs_sb, 2);
+ ino = iunique(configfs_sb, 2);
if (filldir(dirent, name, len, filp->f_pos, ino,
dt_type(next)) < 0)
@@ -879,7 +880,7 @@
return 0;
}
-static loff_t usysfs_dir_lseek(struct file * file, loff_t offset, int origin)
+static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin)
{
struct dentry * dentry = file->f_dentry;
@@ -897,16 +898,16 @@
if (offset != file->f_pos) {
file->f_pos = offset;
if (file->f_pos >= 2) {
- struct usysfs_dirent *sd = dentry->d_fsdata;
- struct usysfs_dirent *cursor = file->private_data;
+ struct configfs_dirent *sd = dentry->d_fsdata;
+ struct configfs_dirent *cursor = file->private_data;
struct list_head *p;
loff_t n = file->f_pos - 2;
list_del(&cursor->s_sibling);
p = sd->s_children.next;
while (n && p != &sd->s_children) {
- struct usysfs_dirent *next;
- next = list_entry(p, struct usysfs_dirent,
+ struct configfs_dirent *next;
+ next = list_entry(p, struct configfs_dirent,
s_sibling);
if (next->s_element)
n--;
@@ -919,86 +920,87 @@
return offset;
}
-struct file_operations usysfs_dir_operations = {
- .open = usysfs_dir_open,
- .release = usysfs_dir_close,
- .llseek = usysfs_dir_lseek,
+struct file_operations configfs_dir_operations = {
+ .open = configfs_dir_open,
+ .release = configfs_dir_close,
+ .llseek = configfs_dir_lseek,
.read = generic_read_dir,
- .readdir = usysfs_readdir,
+ .readdir = configfs_readdir,
};
-int usysfs_register_subsystem(struct usysfs_subsystem *subsys)
+int configfs_register_subsystem(struct configfs_subsystem *subsys)
{
int err;
struct uset *set = &subsys->su_set;
struct qstr name;
struct dentry *dentry;
- struct usysfs_dirent *sd;
+ struct configfs_dirent *sd;
- err = usysfs_pin_fs();
+ err = configfs_pin_fs();
if (err)
return err;
if (!set->uobj.k_name)
set->uobj.k_name = set->uobj.name;
- down(&usysfs_sb->s_root->d_inode->i_sem);
+ down(&configfs_sb->s_root->d_inode->i_sem);
name.name = set->uobj.k_name;
name.len = strlen(name.name);
name.hash = full_name_hash(name.name, name.len);
err = -ENOMEM;
- dentry = d_alloc(usysfs_sb->s_root, &name);
+ dentry = d_alloc(configfs_sb->s_root, &name);
if (!dentry)
goto out_release;
d_add(dentry, NULL);
- sd = usysfs_sb->s_root->d_fsdata;
- err = usysfs_instantiate_set(sd->s_element, &set->uobj, dentry);
+ sd = configfs_sb->s_root->d_fsdata;
+ err = configfs_instantiate_set(sd->s_element, &set->uobj,
+ dentry);
if (!err)
dentry = NULL;
else
d_delete(dentry);
- up(&usysfs_sb->s_root->d_inode->i_sem);
+ up(&configfs_sb->s_root->d_inode->i_sem);
if (dentry) {
dput(dentry);
out_release:
- usysfs_release_fs();
+ configfs_release_fs();
}
return err;
}
-void usysfs_unregister_subsystem(struct usysfs_subsystem *subsys)
+void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
{
struct uset *set = &subsys->su_set;
struct dentry *dentry = set->uobj.dentry;
- if (dentry->d_parent != usysfs_sb->s_root) {
- printk(KERN_ERR "usysfs: Tried to unregister non-subsystem!\n");
+ if (dentry->d_parent != configfs_sb->s_root) {
+ printk(KERN_ERR "configfs: Tried to unregister non-subsystem!\n");
return;
}
- down(&usysfs_sb->s_root->d_inode->i_sem);
+ down(&configfs_sb->s_root->d_inode->i_sem);
down(&dentry->d_inode->i_sem);
- if (usysfs_empty_dir(dentry)) {
- printk(KERN_ERR "usysfs: Tried to unregister non-empty subsystem!\n");
+ if (configfs_empty_dir(dentry)) {
+ printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
}
- usysfs_drop_set(&set->uobj);
+ configfs_drop_set(&set->uobj);
dentry->d_inode->i_flags |= S_DEAD;
up(&dentry->d_inode->i_sem);
d_delete(dentry);
- up(&usysfs_sb->s_root->d_inode->i_sem);
+ up(&configfs_sb->s_root->d_inode->i_sem);
dput(dentry);
- usysfs_release_fs();
+ configfs_release_fs();
}
-EXPORT_SYMBOL(usysfs_register_subsystem);
-EXPORT_SYMBOL(usysfs_unregister_subsystem);
+EXPORT_SYMBOL(configfs_register_subsystem);
+EXPORT_SYMBOL(configfs_unregister_subsystem);
Modified: trunk/fs/configfs/file.c
===================================================================
--- trunk/fs/configfs/file.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/file.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -36,11 +36,11 @@
#include "configfs_internal.h"
-struct usysfs_buffer {
+struct configfs_buffer {
size_t count;
loff_t pos;
char * page;
- struct usysfs_object_operations * ops;
+ struct configfs_object_operations * ops;
struct semaphore sem;
int needs_read_fill;
};
@@ -56,11 +56,11 @@
* data.
* This is called only once, on the file's first read.
*/
-static int fill_read_buffer(struct dentry * dentry, struct usysfs_buffer * buffer)
+static int fill_read_buffer(struct dentry * dentry, struct configfs_buffer * buffer)
{
- struct usysfs_attribute * attr = to_attr(dentry);
+ struct configfs_attribute * attr = to_attr(dentry);
struct uobject * uobj = to_uobj(dentry->d_parent);
- struct usysfs_object_operations * ops = buffer->ops;
+ struct configfs_object_operations * ops = buffer->ops;
int ret = 0;
ssize_t count;
@@ -92,7 +92,7 @@
* the amount they specify each time.
* This may be called continuously until the buffer is empty.
*/
-static int flush_read_buffer(struct usysfs_buffer * buffer, char __user * buf,
+static int flush_read_buffer(struct configfs_buffer * buffer, char __user * buf,
size_t count, loff_t * ppos)
{
int error;
@@ -110,7 +110,7 @@
}
/**
- * usysfs_read_file - read an attribute.
+ * configfs_read_file - read an attribute.
* @file: file pointer.
* @buf: buffer to fill.
* @count: number of bytes to read.
@@ -129,9 +129,9 @@
*/
static ssize_t
-usysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
+configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
- struct usysfs_buffer * buffer = file->private_data;
+ struct configfs_buffer * buffer = file->private_data;
ssize_t retval = 0;
down(&buffer->sem);
@@ -159,7 +159,7 @@
*/
static int
-fill_write_buffer(struct usysfs_buffer * buffer, const char __user * buf, size_t count)
+fill_write_buffer(struct configfs_buffer * buffer, const char __user * buf, size_t count)
{
int error;
@@ -187,24 +187,24 @@
*/
static int
-flush_write_buffer(struct dentry * dentry, struct usysfs_buffer * buffer, size_t count)
+flush_write_buffer(struct dentry * dentry, struct configfs_buffer * buffer, size_t count)
{
- struct usysfs_attribute * attr = to_attr(dentry);
+ struct configfs_attribute * attr = to_attr(dentry);
struct uobject * uobj = to_uobj(dentry->d_parent);
- struct usysfs_object_operations * ops = buffer->ops;
+ struct configfs_object_operations * ops = buffer->ops;
return ops->store_attribute(uobj,attr,buffer->page,count);
}
/**
- * usysfs_write_file - write an attribute.
+ * configfs_write_file - write an attribute.
* @file: file pointer
* @buf: data to write
* @count: number of bytes
* @ppos: starting offset
*
- * Similar to usysfs_read_file(), though working in the opposite direction.
+ * 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().
* There is no easy way for us to know if userspace is only doing a partial
@@ -215,9 +215,9 @@
*/
static ssize_t
-usysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+configfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- struct usysfs_buffer * buffer = file->private_data;
+ struct configfs_buffer * buffer = file->private_data;
down(&buffer->sem);
count = fill_write_buffer(buffer,buf,count);
@@ -231,10 +231,10 @@
static int check_perm(struct inode * inode, struct file * file)
{
- struct uobject *uobj = usysfs_get_uobject(file->f_dentry->d_parent);
- struct usysfs_attribute * attr = to_attr(file->f_dentry);
- struct usysfs_buffer * buffer;
- struct usysfs_object_operations * ops = NULL;
+ struct uobject *uobj = configfs_get_uobject(file->f_dentry->d_parent);
+ struct configfs_attribute * attr = to_attr(file->f_dentry);
+ struct configfs_buffer * buffer;
+ struct configfs_object_operations * ops = NULL;
int error = 0;
if (!uobj || !attr)
@@ -277,9 +277,9 @@
/* No error? Great, allocate a buffer for the file, and store it
* it in file->private_data for easy access.
*/
- buffer = kmalloc(sizeof(struct usysfs_buffer),GFP_KERNEL);
+ buffer = kmalloc(sizeof(struct configfs_buffer),GFP_KERNEL);
if (buffer) {
- memset(buffer,0,sizeof(struct usysfs_buffer));
+ memset(buffer,0,sizeof(struct configfs_buffer));
init_MUTEX(&buffer->sem);
buffer->needs_read_fill = 1;
buffer->ops = ops;
@@ -300,17 +300,17 @@
return error;
}
-static int usysfs_open_file(struct inode * inode, struct file * filp)
+static int configfs_open_file(struct inode * inode, struct file * filp)
{
return check_perm(inode,filp);
}
-static int usysfs_release(struct inode * inode, struct file * filp)
+static int configfs_release(struct inode * inode, struct file * filp)
{
struct uobject * uobj = to_uobj(filp->f_dentry->d_parent);
- struct usysfs_attribute * attr = to_attr(filp->f_dentry);
+ struct configfs_attribute * attr = to_attr(filp->f_dentry);
struct module * owner = attr->owner;
- struct usysfs_buffer * buffer = filp->private_data;
+ struct configfs_buffer * buffer = filp->private_data;
if (uobj)
uobject_put(uobj);
@@ -325,23 +325,23 @@
return 0;
}
-struct file_operations usysfs_file_operations = {
- .read = usysfs_read_file,
- .write = usysfs_write_file,
+struct file_operations configfs_file_operations = {
+ .read = configfs_read_file,
+ .write = configfs_write_file,
.llseek = generic_file_llseek,
- .open = usysfs_open_file,
- .release = usysfs_release,
+ .open = configfs_open_file,
+ .release = configfs_release,
};
-int usysfs_add_file(struct dentry * dir, const struct usysfs_attribute * attr, int type)
+int configfs_add_file(struct dentry * dir, const struct configfs_attribute * attr, int type)
{
- struct usysfs_dirent * parent_sd = dir->d_fsdata;
+ struct configfs_dirent * parent_sd = dir->d_fsdata;
umode_t mode = (attr->mode & S_IALLUGO) | S_IFREG;
int error = 0;
down(&dir->d_inode->i_sem);
- error = usysfs_make_dirent(parent_sd, NULL, (void *) attr, mode, type);
+ error = configfs_make_dirent(parent_sd, NULL, (void *) attr, mode, type);
up(&dir->d_inode->i_sem);
return error;
@@ -349,16 +349,16 @@
/**
- * usysfs_create_file - create an attribute file for an object.
+ * configfs_create_file - create an attribute file for an object.
* @uobj: object we're creating for.
* @attr: atrribute descriptor.
*/
-int usysfs_create_file(struct uobject * uobj, const struct usysfs_attribute * attr)
+int configfs_create_file(struct uobject * uobj, const struct configfs_attribute * attr)
{
BUG_ON(!uobj || !uobj->dentry || !attr);
- return usysfs_add_file(uobj->dentry, attr, USYSFS_UOBJ_ATTR);
+ return configfs_add_file(uobj->dentry, attr, CONFIGFS_UOBJ_ATTR);
}
Modified: trunk/fs/configfs/inode.c
===================================================================
--- trunk/fs/configfs/inode.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/inode.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -23,7 +23,7 @@
*
* configfs Copyright (C) 2005 Oracle. All rights reserved.
*
- * Please see Documentation/filesystems/usysfs.txt for more information.
+ * Please see Documentation/filesystems/configfs.txt for more information.
*/
#undef DEBUG
@@ -36,22 +36,22 @@
#include "configfs.h"
#include "configfs_internal.h"
-extern struct super_block * usysfs_sb;
+extern struct super_block * configfs_sb;
-static struct address_space_operations usysfs_aops = {
+static struct address_space_operations configfs_aops = {
.readpage = simple_readpage,
.prepare_write = simple_prepare_write,
.commit_write = simple_commit_write
};
-static struct backing_dev_info usysfs_backing_dev_info = {
+static struct backing_dev_info configfs_backing_dev_info = {
.ra_pages = 0, /* No readahead */
.memory_backed = 1, /* Does not contribute to dirty memory */
};
-struct inode * usysfs_new_inode(mode_t mode)
+struct inode * configfs_new_inode(mode_t mode)
{
- struct inode * inode = new_inode(usysfs_sb);
+ struct inode * inode = new_inode(configfs_sb);
if (inode) {
inode->i_mode = mode;
inode->i_uid = 0;
@@ -59,21 +59,21 @@
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
- inode->i_mapping->a_ops = &usysfs_aops;
+ inode->i_mapping->a_ops = &configfs_aops;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- inode->i_mapping->backing_dev_info = &usysfs_backing_dev_info;
+ inode->i_mapping->backing_dev_info = &configfs_backing_dev_info;
#endif
}
return inode;
}
-int usysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
+int configfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
{
int error = 0;
struct inode * inode = NULL;
if (dentry) {
if (!dentry->d_inode) {
- if ((inode = usysfs_new_inode(mode))) {
+ if ((inode = configfs_new_inode(mode))) {
if (dentry->d_parent && dentry->d_parent->d_inode) {
struct inode *p_inode = dentry->d_parent->d_inode;
p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
@@ -101,7 +101,7 @@
return error;
}
-struct dentry * usysfs_get_dentry(struct dentry * parent, const char * name)
+struct dentry * configfs_get_dentry(struct dentry * parent, const char * name)
{
struct qstr qstr;
@@ -112,9 +112,9 @@
}
/*
- * Get the name for corresponding element represented by the given usysfs_dirent
+ * Get the name for corresponding element represented by the given configfs_dirent
*/
-const unsigned char * usysfs_get_name(struct usysfs_dirent *sd)
+const unsigned char * configfs_get_name(struct configfs_dirent *sd)
{
struct attribute * attr;
@@ -122,10 +122,10 @@
BUG();
/* These always have a dentry, so use that */
- if (sd->s_type & (USYSFS_DIR | USYSFS_UOBJ_LINK))
+ if (sd->s_type & (CONFIGFS_DIR | CONFIGFS_UOBJ_LINK))
return sd->s_dentry->d_name.name;
- if (sd->s_type & USYSFS_UOBJ_ATTR) {
+ if (sd->s_type & CONFIGFS_UOBJ_ATTR) {
attr = sd->s_element;
return attr->name;
}
@@ -134,10 +134,10 @@
/*
- * Unhashes the dentry corresponding to given usysfs_dirent
+ * Unhashes the dentry corresponding to given configfs_dirent
* Called with parent inode's i_sem held.
*/
-void usysfs_drop_dentry(struct usysfs_dirent * sd, struct dentry * parent)
+void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
{
struct dentry * dentry = sd->s_dentry;
@@ -153,19 +153,19 @@
}
}
-void usysfs_hash_and_remove(struct dentry * dir, const char * name)
+void configfs_hash_and_remove(struct dentry * dir, const char * name)
{
- struct usysfs_dirent * sd;
- struct usysfs_dirent * parent_sd = dir->d_fsdata;
+ struct configfs_dirent * sd;
+ struct configfs_dirent * parent_sd = dir->d_fsdata;
down(&dir->d_inode->i_sem);
list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
if (!sd->s_element)
continue;
- if (!strcmp(usysfs_get_name(sd), name)) {
+ if (!strcmp(configfs_get_name(sd), name)) {
list_del_init(&sd->s_sibling);
- usysfs_drop_dentry(sd, dir);
- usysfs_put(sd);
+ configfs_drop_dentry(sd, dir);
+ configfs_put(sd);
break;
}
}
Modified: trunk/fs/configfs/mount.c
===================================================================
--- trunk/fs/configfs/mount.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/mount.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -37,13 +37,13 @@
#include "configfs_internal.h"
/* Random magic number */
-#define UUSYSFS_MAGIC 0x62656570
+#define UCONFIGFS_MAGIC 0x62656570
-struct vfsmount * usysfs_mount = NULL;
-struct super_block * usysfs_sb = NULL;
-static int usysfs_mnt_count = 0;
+struct vfsmount * configfs_mount = NULL;
+struct super_block * configfs_sb = NULL;
+static int configfs_mnt_count = 0;
-static struct super_operations usysfs_ops = {
+static struct super_operations configfs_ops = {
.statfs = simple_statfs,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.drop_inode = generic_delete_inode,
@@ -52,23 +52,23 @@
#endif
};
-static struct uset usysfs_root_set = {
+static struct uset configfs_root_set = {
.uobj = {
.name = "root",
- .k_name = usysfs_root_set.uobj.name,
+ .k_name = configfs_root_set.uobj.name,
},
};
-int usysfs_is_root(struct uobject *uobj)
+int configfs_is_root(struct uobject *uobj)
{
- return uobj == &usysfs_root_set.uobj;
+ return uobj == &configfs_root_set.uobj;
}
-static struct usysfs_dirent usysfs_root = {
- .s_sibling = LIST_HEAD_INIT(usysfs_root.s_sibling),
- .s_children = LIST_HEAD_INIT(usysfs_root.s_children),
- .s_element = &usysfs_root_set.uobj,
- .s_type = USYSFS_ROOT,
+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_type = CONFIGFS_ROOT,
};
void uset_init_type_name(struct uset *uset, const char *name,
@@ -80,25 +80,25 @@
}
EXPORT_SYMBOL(uset_init_type_name);
-static int usysfs_fill_super(struct super_block *sb, void *data, int silent)
+static int configfs_fill_super(struct super_block *sb, void *data, int silent)
{
struct inode *inode;
struct dentry *root;
sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
- sb->s_magic = UUSYSFS_MAGIC;
- sb->s_op = &usysfs_ops;
- usysfs_sb = sb;
+ sb->s_magic = UCONFIGFS_MAGIC;
+ sb->s_op = &configfs_ops;
+ configfs_sb = sb;
- inode = usysfs_new_inode(S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO);
+ inode = configfs_new_inode(S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO);
if (inode) {
- inode->i_op = &usysfs_dir_inode_operations;
- inode->i_fop = &usysfs_dir_operations;
+ inode->i_op = &configfs_dir_inode_operations;
+ inode->i_fop = &configfs_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
} else {
- pr_debug("usysfs: could not get root inode\n");
+ pr_debug("configfs: could not get root inode\n");
return -ENOMEM;
}
@@ -108,65 +108,65 @@
iput(inode);
return -ENOMEM;
}
- uset_init(&usysfs_root_set);
- usysfs_root_set.uobj.dentry = root;
- root->d_fsdata = &usysfs_root;
+ uset_init(&configfs_root_set);
+ configfs_root_set.uobj.dentry = root;
+ root->d_fsdata = &configfs_root;
sb->s_root = root;
return 0;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-static struct super_block *usysfs_get_sb(struct file_system_type *fs_type,
+static struct super_block *configfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
- return get_sb_single(fs_type, flags, data, usysfs_fill_super);
+ return get_sb_single(fs_type, flags, data, configfs_fill_super);
}
-static struct file_system_type usysfs_fs_type = {
+static struct file_system_type configfs_fs_type = {
.owner = THIS_MODULE,
.name = "configfs",
- .get_sb = usysfs_get_sb,
+ .get_sb = configfs_get_sb,
.kill_sb = kill_litter_super,
};
#else
-static struct super_block *usysfs_read_super(struct super_block *sb, void *data, int silent)
+static struct super_block *configfs_read_super(struct super_block *sb, void *data, int silent)
{
- return (usysfs_fill_super(sb, data, silent) < 0) ? NULL : sb;
+ return (configfs_fill_super(sb, data, silent) < 0) ? NULL : sb;
}
-static DECLARE_FSTYPE(usysfs_fs_type, "configfs", usysfs_read_super, FS_SINGLE);
+static DECLARE_FSTYPE(configfs_fs_type, "configfs", configfs_read_super, FS_SINGLE);
#endif
-int usysfs_pin_fs(void)
+int configfs_pin_fs(void)
{
- return simple_pin_fs("configfs", &usysfs_mount,
- &usysfs_mnt_count);
+ return simple_pin_fs("configfs", &configfs_mount,
+ &configfs_mnt_count);
}
-void usysfs_release_fs(void)
+void configfs_release_fs(void)
{
- simple_release_fs(&usysfs_mount, &usysfs_mnt_count);
+ simple_release_fs(&configfs_mount, &configfs_mnt_count);
}
-static int __init usysfs_init(void)
+static int __init configfs_init(void)
{
int err;
- err = register_filesystem(&usysfs_fs_type);
+ err = register_filesystem(&configfs_fs_type);
if (err) {
- printk(KERN_ERR "usysfs: Unable to register filesystem!\n");
+ printk(KERN_ERR "configfs: Unable to register filesystem!\n");
}
return err;
}
-static void __exit usysfs_exit(void)
+static void __exit configfs_exit(void)
{
- unregister_filesystem(&usysfs_fs_type);
+ unregister_filesystem(&configfs_fs_type);
}
-module_init(usysfs_init);
-module_exit(usysfs_exit);
+module_init(configfs_init);
+module_exit(configfs_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Oracle");
MODULE_VERSION("0.0.1");
Modified: trunk/fs/configfs/symlink.c
===================================================================
--- trunk/fs/configfs/symlink.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/symlink.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -37,7 +37,7 @@
{
struct uobject * p = uobj;
int depth = 0;
- do { depth++; } while ((p = p->parent) && !usysfs_is_root(p));
+ do { depth++; } while ((p = p->parent) && !configfs_is_root(p));
return depth;
}
@@ -48,7 +48,7 @@
do {
length += strlen(uobject_name(p)) + 1;
p = p->parent;
- } while (p && !usysfs_is_root(p));
+ } while (p && !configfs_is_root(p));
return length;
}
@@ -57,7 +57,7 @@
struct uobject * p;
--length;
- for (p = uobj; p && !usysfs_is_root(p); p = p->parent) {
+ for (p = uobj; p && !configfs_is_root(p); p = p->parent) {
int cur = strlen(uobject_name(p));
/* back up enough to print this bus id with '/' */
@@ -71,17 +71,17 @@
struct uobject *uobj,
struct dentry *dentry)
{
- struct usysfs_dirent *target_sd = uobj->dentry->d_fsdata;
- struct usysfs_symlink *sl;
+ struct configfs_dirent *target_sd = uobj->dentry->d_fsdata;
+ struct configfs_symlink *sl;
int ret;
ret = -ENOMEM;
- sl = kmalloc(sizeof(struct usysfs_symlink), GFP_KERNEL);
+ sl = kmalloc(sizeof(struct configfs_symlink), GFP_KERNEL);
if (sl) {
sl->sl_target = uobject_get(uobj);
/* FIXME: needs a lock, I'd bet */
list_add(&sl->sl_list, &target_sd->s_links);
- ret = usysfs_create_link(sl, parent_uobj->dentry,
+ ret = configfs_create_link(sl, parent_uobj->dentry,
dentry);
if (ret) {
list_del_init(&sl->sl_list);
@@ -101,8 +101,8 @@
ret = path_lookup(symname, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, nd);
if (!ret) {
- if (nd->dentry->d_sb == usysfs_sb) {
- *target = usysfs_get_uobject(nd->dentry);
+ if (nd->dentry->d_sb == configfs_sb) {
+ *target = configfs_get_uobject(nd->dentry);
if (!*target) {
ret = -ENOENT;
path_release(nd);
@@ -115,7 +115,7 @@
}
-int usysfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
+int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
{
int ret;
struct nameidata nd;
@@ -124,10 +124,10 @@
struct uobj_type *uktype;
ret = -EPERM; /* What lack-of-symlink returns */
- if (dentry->d_parent == usysfs_sb->s_root)
+ if (dentry->d_parent == configfs_sb->s_root)
goto out;
- parent_uobj = usysfs_get_uobject(dentry->d_parent);
+ parent_uobj = configfs_get_uobject(dentry->d_parent);
uktype = parent_uobj->ktype;
if (!uktype || !uktype->object_ops ||
@@ -152,30 +152,30 @@
return ret;
}
-int usysfs_unlink(struct inode *dir, struct dentry *dentry)
+int configfs_unlink(struct inode *dir, struct dentry *dentry)
{
- struct usysfs_dirent *sd = dentry->d_fsdata;
- struct usysfs_symlink *sl;
+ struct configfs_dirent *sd = dentry->d_fsdata;
+ struct configfs_symlink *sl;
struct uobject *parent_uobj;
struct uobj_type *uktype;
int ret;
ret = -EPERM; /* What lack-of-symlink returns */
- if (!(sd->s_type & USYSFS_UOBJ_LINK))
+ if (!(sd->s_type & CONFIGFS_UOBJ_LINK))
goto out;
- if (dentry->d_parent == usysfs_sb->s_root)
+ if (dentry->d_parent == configfs_sb->s_root)
BUG();
sl = sd->s_element;
- parent_uobj = usysfs_get_uobject(dentry->d_parent);
+ parent_uobj = configfs_get_uobject(dentry->d_parent);
uktype = parent_uobj->ktype;
list_del_init(&sd->s_sibling);
- usysfs_drop_dentry(sd, dentry->d_parent);
+ configfs_drop_dentry(sd, dentry->d_parent);
dput(dentry);
- usysfs_put(sd);
+ configfs_put(sd);
/*
* drop_link() must be called before
@@ -202,7 +202,7 @@
return ret;
}
-static int usysfs_get_target_path(struct uobject * uobj, struct uobject * target,
+static int configfs_get_target_path(struct uobject * uobj, struct uobject * target,
char *path)
{
char * s;
@@ -224,24 +224,24 @@
return 0;
}
-static int usysfs_getlink(struct dentry *dentry, char * path)
+static int configfs_getlink(struct dentry *dentry, char * path)
{
struct uobject *uobj, *target_uobj;
int error = 0;
- uobj = usysfs_get_uobject(dentry->d_parent);
+ uobj = configfs_get_uobject(dentry->d_parent);
if (!uobj)
return -EINVAL;
- target_uobj = usysfs_get_uobject(dentry);
+ target_uobj = configfs_get_uobject(dentry);
if (!target_uobj) {
uobject_put(uobj);
return -EINVAL;
}
- down_read(&usysfs_rename_sem);
- error = usysfs_get_target_path(uobj, target_uobj, path);
- up_read(&usysfs_rename_sem);
+ down_read(&configfs_rename_sem);
+ error = configfs_get_target_path(uobj, target_uobj, path);
+ up_read(&configfs_rename_sem);
uobject_put(uobj);
uobject_put(target_uobj);
@@ -250,7 +250,7 @@
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
-int usysfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
+int configfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
int error = 0;
unsigned long page = get_zeroed_page(GFP_KERNEL);
@@ -258,7 +258,7 @@
if (!page)
return -ENOMEM;
- error = usysfs_getlink(dentry, (char *) page);
+ error = configfs_getlink(dentry, (char *) page);
if (!error)
error = vfs_readlink(dentry, buffer, buflen, (char *) page);
@@ -267,7 +267,7 @@
return error;
}
-int usysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+int configfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int error = 0;
unsigned long page = get_zeroed_page(GFP_KERNEL);
@@ -275,7 +275,7 @@
if (!page)
return -ENOMEM;
- error = usysfs_getlink(dentry, (char *) page);
+ error = configfs_getlink(dentry, (char *) page);
if (!error)
error = vfs_follow_link(nd, (char *) page);
@@ -284,17 +284,17 @@
return error;
}
#else
-static int usysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+static int configfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int error = -ENOMEM;
unsigned long page = get_zeroed_page(GFP_KERNEL);
if (page)
- error = usysfs_getlink(dentry, (char *) page);
+ error = configfs_getlink(dentry, (char *) page);
nd_set_link(nd, error ? ERR_PTR(error) : (char *)page);
return 0;
}
-static void usysfs_put_link(struct dentry *dentry, struct nameidata *nd)
+static void configfs_put_link(struct dentry *dentry, struct nameidata *nd)
{
char *page = nd_get_link(nd);
if (!IS_ERR(page))
@@ -302,13 +302,13 @@
}
#endif
-struct inode_operations usysfs_symlink_inode_operations = {
- .follow_link = usysfs_follow_link,
+struct inode_operations configfs_symlink_inode_operations = {
+ .follow_link = configfs_follow_link,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
- .readlink = usysfs_readlink,
+ .readlink = configfs_readlink,
#else
.readlink = generic_readlink,
- .put_link = usysfs_put_link,
+ .put_link = configfs_put_link,
#endif
};
Modified: trunk/fs/configfs/uobject.c
===================================================================
--- trunk/fs/configfs/uobject.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/uobject.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -12,7 +12,7 @@
* about using the uobject interface.
*
* 2005.01.24
- * Stripped down for 2.4 compat in usysfs.
+ * Stripped down for 2.4 compat in configfs.
* Joel Becker <joel.becker at oracle.com>
*/
Modified: trunk/fs/configfs/uobject.h
===================================================================
--- trunk/fs/configfs/uobject.h 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/configfs/uobject.h 2005-03-29 22:09:26 UTC (rev 2071)
@@ -24,8 +24,8 @@
*
* Copyright (C) 2005 Oracle. All rights reserved.
*
- * Please read Documentation/usysfs.txt before using the uobject and
- * usysfs interface, ESPECIALLY the parts about reference counts and
+ * Please read Documentation/configfs.txt before using the uobject and
+ * configfs interface, ESPECIALLY the parts about reference counts and
* object destructors.
*/
@@ -40,10 +40,10 @@
#define UOBJ_NAME_LEN 20
-struct usysfs_object_operations;
-struct usysfs_set_operations;
-struct usysfs_attribute;
-struct usysfs_subsystem;
+struct configfs_object_operations;
+struct configfs_set_operations;
+struct configfs_attribute;
+struct configfs_subsystem;
struct uobject {
char *k_name;
@@ -71,9 +71,9 @@
struct uobj_type {
struct module *owner;
- struct usysfs_object_operations *object_ops;
- struct usysfs_set_operations *set_ops;
- struct usysfs_attribute **attrs;
+ struct configfs_object_operations *object_ops;
+ struct configfs_set_operations *set_ops;
+ struct configfs_attribute **attrs;
};
@@ -85,7 +85,7 @@
struct uset {
struct uobject uobj;
struct list_head list;
- struct usysfs_subsystem *subsys;
+ struct configfs_subsystem *subsys;
struct uset **default_sets;
};
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -439,7 +439,7 @@
EXPORT_SYMBOL(hb_fill_node_map);
/*
- * heartbeat usysfs bits. The heartbeat set is a default set under
+ * heartbeat configfs bits. The heartbeat set is a default set under
* the cluster set in nodemanager.c.
*/
@@ -632,7 +632,7 @@
return ret;
}
struct hb_region_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct hb_region *, char *);
ssize_t (*store)(struct hb_region *, const char *, size_t);
};
@@ -658,7 +658,7 @@
.store = hb_region_dev_write,
};
-static struct usysfs_attribute *hb_region_attrs[] = {
+static struct configfs_attribute *hb_region_attrs[] = {
&hb_region_attr_block_bytes.attr,
&hb_region_attr_start_block.attr,
&hb_region_attr_blocks.attr,
@@ -667,7 +667,7 @@
};
static ssize_t hb_region_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct hb_region *reg = to_hb_region(uobj);
@@ -681,7 +681,7 @@
}
static ssize_t hb_region_store(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
const char *page, size_t count)
{
struct hb_region *reg = to_hb_region(uobj);
@@ -694,7 +694,7 @@
return ret;
}
-static struct usysfs_object_operations hb_region_object_ops = {
+static struct configfs_object_operations hb_region_object_ops = {
.release = hb_region_release,
.show_attribute = hb_region_show,
.store_attribute = hb_region_store,
@@ -765,7 +765,7 @@
uobject_put(uobj);
}
-static struct usysfs_set_operations hb_heartbeat_set_set_ops = {
+static struct configfs_set_operations hb_heartbeat_set_set_ops = {
.make_object = hb_heartbeat_set_make_object,
.drop_object = hb_heartbeat_set_drop_object,
};
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-29 21:49:10 UTC (rev 2070)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-03-29 22:09:26 UTC (rev 2071)
@@ -196,7 +196,7 @@
}
EXPORT_SYMBOL(nm_this_node);
-/* node usysfs bits */
+/* node configfs bits */
static struct nm_cluster *to_nm_cluster(struct uobject *uobj)
{
@@ -377,7 +377,7 @@
}
struct nm_node_attribute {
- struct usysfs_attribute attr;
+ struct configfs_attribute attr;
ssize_t (*show)(struct nm_node *, char *);
ssize_t (*store)(struct nm_node *, const char *, size_t);
};
@@ -402,7 +402,7 @@
.show = nm_node_local_read,
.store = nm_node_local_write,
};
-static struct usysfs_attribute *nm_node_attrs[] = {
+static struct configfs_attribute *nm_node_attrs[] = {
&nm_node_attr_num.attr,
&nm_node_attr_ipv4_port.attr,
&nm_node_attr_ipv4_address.attr,
@@ -411,7 +411,7 @@
};
static ssize_t nm_node_show(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
char *page)
{
struct nm_node *node = to_nm_node(uobj);
@@ -425,7 +425,7 @@
}
static ssize_t nm_node_store(struct uobject *uobj,
- struct usysfs_attribute *attr,
+ struct configfs_attribute *attr,
const char *page, size_t count)
{
struct nm_node *node = to_nm_node(uobj);
@@ -438,7 +438,7 @@
return ret;
}
-static struct usysfs_object_operations nm_node_object_ops = {
+static struct configfs_object_operations nm_node_object_ops = {
.release = nm_node_release,
.show_attribute = nm_node_show,
.store_attribute = nm_node_store,
@@ -550,7 +550,7 @@
uobject_put(uobj);
}
-static struct usysfs_set_operations nm_node_set_set_ops = {
+static struct configfs_set_operations nm_node_set_set_ops = {
.make_object = nm_node_set_make_object,
.drop_object = nm_node_set_drop_object,
};
@@ -572,7 +572,7 @@
kfree(cluster);
}
-static struct usysfs_object_operations nm_cluster_object_ops = {
+static struct configfs_object_operations nm_cluster_object_ops = {
.release = nm_cluster_release,
};
@@ -584,7 +584,7 @@
/* cluster set */
struct nm_cluster_set {
- struct usysfs_subsystem cs_subsys;
+ struct configfs_subsystem cs_subsys;
/* some stuff? */
};
@@ -592,7 +592,7 @@
static struct nm_cluster_set *to_nm_cluster_set(struct uset *uset)
{
return uset ?
- container_of(to_usysfs_subsystem(uset), struct nm_cluster_set, cs_subsys)
+ container_of(to_configfs_subsystem(uset), struct nm_cluster_set, cs_subsys)
: NULL;
}
#endif
@@ -661,7 +661,7 @@
uobject_put(uobj);
}
-static struct usysfs_set_operations nm_cluster_set_set_ops = {
+static struct configfs_set_operations nm_cluster_set_set_ops = {
.make_set = nm_cluster_set_make_set,
.drop_object = nm_cluster_set_drop_object,
};
@@ -687,7 +687,7 @@
nmprintk("unloading nm module\n");
/* XXX sync with hb callbacks and shut down hb? */
net_unregister_hb_callbacks();
- usysfs_unregister_subsystem(&nm_cluster_set.cs_subsys);
+ configfs_unregister_subsystem(&nm_cluster_set.cs_subsys);
}
static int __init init_nm(void)
@@ -699,7 +699,7 @@
if (!ret) {
uset_init(&nm_cluster_set.cs_subsys.su_set);
init_MUTEX(&nm_cluster_set.cs_subsys.su_sem);
- ret = usysfs_register_subsystem(&nm_cluster_set.cs_subsys);
+ ret = configfs_register_subsystem(&nm_cluster_set.cs_subsys);
if (ret) {
printk(KERN_ERR "nodemanager: Registration returned %d\n", ret);
net_unregister_hb_callbacks();
More information about the Ocfs2-commits
mailing list