Commit f516b369 authored by Adrian Bunk's avatar Adrian Bunk Committed by Greg Kroah-Hartman

[PATCH] small sysfs cleanups

The patch below does the following cleanups for the sysfs code:
- remove the unused global function sysfs_mknod
- make some structs and functions static

Please check whether this patch is correct, or whether some of the
things I made static should be used globally in the forseeable future.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 8e62c731
...@@ -201,7 +201,7 @@ static int sysfs_attach_link(struct sysfs_dirent * sd, struct dentry * dentry) ...@@ -201,7 +201,7 @@ static int sysfs_attach_link(struct sysfs_dirent * sd, struct dentry * dentry)
return err; return err;
} }
struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
struct sysfs_dirent * parent_sd = dentry->d_parent->d_fsdata; struct sysfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
......
...@@ -76,11 +76,6 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *)) ...@@ -76,11 +76,6 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
return error; return error;
} }
int sysfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
{
return sysfs_create(dentry, mode, NULL);
}
struct dentry * sysfs_get_dentry(struct dentry * parent, const char * name) struct dentry * sysfs_get_dentry(struct dentry * parent, const char * name)
{ {
struct qstr qstr; struct qstr qstr;
......
...@@ -22,7 +22,7 @@ static struct super_operations sysfs_ops = { ...@@ -22,7 +22,7 @@ static struct super_operations sysfs_ops = {
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
}; };
struct sysfs_dirent sysfs_root = { static struct sysfs_dirent sysfs_root = {
.s_sibling = LIST_HEAD_INIT(sysfs_root.s_sibling), .s_sibling = LIST_HEAD_INIT(sysfs_root.s_sibling),
.s_children = LIST_HEAD_INIT(sysfs_root.s_children), .s_children = LIST_HEAD_INIT(sysfs_root.s_children),
.s_element = NULL, .s_element = NULL,
......
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
#include "sysfs.h" #include "sysfs.h"
struct inode_operations sysfs_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = sysfs_follow_link,
.put_link = sysfs_put_link,
};
static int object_depth(struct kobject * kobj) static int object_depth(struct kobject * kobj)
{ {
struct kobject * p = kobj; struct kobject * p = kobj;
...@@ -157,7 +151,7 @@ static int sysfs_getlink(struct dentry *dentry, char * path) ...@@ -157,7 +151,7 @@ static int sysfs_getlink(struct dentry *dentry, char * path)
} }
int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) static int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
int error = -ENOMEM; int error = -ENOMEM;
unsigned long page = get_zeroed_page(GFP_KERNEL); unsigned long page = get_zeroed_page(GFP_KERNEL);
...@@ -167,13 +161,20 @@ int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) ...@@ -167,13 +161,20 @@ int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
return 0; return 0;
} }
void sysfs_put_link(struct dentry *dentry, struct nameidata *nd) static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd)
{ {
char *page = nd_get_link(nd); char *page = nd_get_link(nd);
if (!IS_ERR(page)) if (!IS_ERR(page))
free_page((unsigned long)page); free_page((unsigned long)page);
} }
struct inode_operations sysfs_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = sysfs_follow_link,
.put_link = sysfs_put_link,
};
EXPORT_SYMBOL_GPL(sysfs_create_link); EXPORT_SYMBOL_GPL(sysfs_create_link);
EXPORT_SYMBOL_GPL(sysfs_remove_link); EXPORT_SYMBOL_GPL(sysfs_remove_link);
...@@ -17,8 +17,6 @@ extern void sysfs_remove_subdir(struct dentry *); ...@@ -17,8 +17,6 @@ extern void sysfs_remove_subdir(struct dentry *);
extern const unsigned char * sysfs_get_name(struct sysfs_dirent *sd); extern const unsigned char * sysfs_get_name(struct sysfs_dirent *sd);
extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent); extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent);
extern int sysfs_follow_link(struct dentry *, struct nameidata *);
extern void sysfs_put_link(struct dentry *, struct nameidata *);
extern struct rw_semaphore sysfs_rename_sem; extern struct rw_semaphore sysfs_rename_sem;
extern struct super_block * sysfs_sb; extern struct super_block * sysfs_sb;
extern struct file_operations sysfs_dir_operations; extern struct file_operations sysfs_dir_operations;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment