aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/sysfs.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-13 14:45:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:04 -0400
commita26cd7226c24c3be5dd5f48a74832fe64beb8489 (patch)
tree0dfb4a15d800494a06a4ddf83c4d33812c404fac /fs/sysfs/sysfs.h
parent996b73764e9bb9d5e751fd15b130ba38637d66a8 (diff)
sysfs: consolidate sysfs_dirent creation functions
Currently there are four functions to create sysfs_dirent - __sysfs_new_dirent(), sysfs_new_dirent(), __sysfs_make_dirent() and sysfs_make_dirent(). Other than sysfs_make_dirent(), no function has two users if calls to implement other functions are excluded. This patch consolidates sysfs_dirent creation functions into the following two. * sysfs_new_dirent() : allocate and initialize * sysfs_attach_dirent() : attach to sysfs_dirent hierarchy and/or associate with dentry This simplifies interface and gives callers more flexibility. This is in preparation of object reference simplification. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r--fs/sysfs/sysfs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index f4fdbbffd571..f8f49cc5c852 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -20,8 +20,11 @@ extern int sysfs_create(struct dentry *, int mode, int (*init)(struct inode *));
20 20
21extern void release_sysfs_dirent(struct sysfs_dirent * sd); 21extern void release_sysfs_dirent(struct sysfs_dirent * sd);
22extern int sysfs_dirent_exist(struct sysfs_dirent *, const unsigned char *); 22extern int sysfs_dirent_exist(struct sysfs_dirent *, const unsigned char *);
23extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *, 23extern struct sysfs_dirent *sysfs_new_dirent(void *element, umode_t mode,
24 umode_t, int); 24 int type);
25extern void sysfs_attach_dirent(struct sysfs_dirent *sd,
26 struct sysfs_dirent *parent_sd,
27 struct dentry *dentry);
25 28
26extern int sysfs_add_file(struct dentry *, const struct attribute *, int); 29extern int sysfs_add_file(struct dentry *, const struct attribute *, int);
27extern int sysfs_hash_and_remove(struct dentry * dir, const char * name); 30extern int sysfs_hash_and_remove(struct dentry * dir, const char * name);