sysfs: make sysfs_add_one() automatically check for duplicate entry
Make sysfs_add_one() check for duplicate entry and return -EEXIST if such entry exists. This simplifies node addition code a bit. This patch doesn't introduce any noticeable behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
41fc1c2745
commit
23dc279950
@@ -62,7 +62,7 @@ extern struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd);
|
||||
extern void sysfs_put_active_two(struct sysfs_dirent *sd);
|
||||
extern void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
|
||||
struct sysfs_dirent *parent_sd);
|
||||
extern void sysfs_add_one(struct sysfs_addrm_cxt *acxt,
|
||||
extern int sysfs_add_one(struct sysfs_addrm_cxt *acxt,
|
||||
struct sysfs_dirent *sd);
|
||||
extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt,
|
||||
struct sysfs_dirent *sd);
|
||||
|
Reference in New Issue
Block a user