You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
996b73764e
commit
a26cd7226c
+5
-2
@@ -20,8 +20,11 @@ extern int sysfs_create(struct dentry *, int mode, int (*init)(struct inode *));
|
||||
|
||||
extern void release_sysfs_dirent(struct sysfs_dirent * sd);
|
||||
extern int sysfs_dirent_exist(struct sysfs_dirent *, const unsigned char *);
|
||||
extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *,
|
||||
umode_t, int);
|
||||
extern struct sysfs_dirent *sysfs_new_dirent(void *element, umode_t mode,
|
||||
int type);
|
||||
extern void sysfs_attach_dirent(struct sysfs_dirent *sd,
|
||||
struct sysfs_dirent *parent_sd,
|
||||
struct dentry *dentry);
|
||||
|
||||
extern int sysfs_add_file(struct dentry *, const struct attribute *, int);
|
||||
extern int sysfs_hash_and_remove(struct dentry * dir, const char * name);
|
||||
|
||||
Reference in New Issue
Block a user