diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 14:54:27 -0500 |
---|---|---|
committer | Pawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local> | 2015-03-27 14:37:30 +0100 |
commit | cf98677723fb0e42fa2b41a370bf85332bd3c750 (patch) | |
tree | fe039a314b02737fe6e350a5e8e5cfce4e4efdde /include | |
parent | ea72c71344e75459493113b7d264f5973ebdcfb8 (diff) | |
download | linux-3.10-cf98677723fb0e42fa2b41a370bf85332bd3c750.tar.gz linux-3.10-cf98677723fb0e42fa2b41a370bf85332bd3c750.tar.bz2 linux-3.10-cf98677723fb0e42fa2b41a370bf85332bd3c750.zip |
sysfs, kernfs: introduce kernfs_notify()
Introduce kernfs interface to wake up poll(2) which takes and returns
sysfs_dirents.
sysfs_notify_dirent() is renamed to kernfs_notify() and sysfs_notify()
is updated so that it doesn't directly grab sysfs_mutex but acquires
the target sysfs_dirents using sysfs_get_dirent().
sysfs_notify_dirent() is reimplemented as a dumb inline wrapper around
kernfs_notify().
This patch doesn't introduce any behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernfs.h | 3 | ||||
-rw-r--r-- | include/linux/sysfs.h | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index ba993ebcd81..f20796ecc76 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -84,6 +84,7 @@ int kernfs_rename_ns(struct sysfs_dirent *sd, struct sysfs_dirent *new_parent, const char *new_name, const void *new_ns); void kernfs_enable_ns(struct sysfs_dirent *sd); int kernfs_setattr(struct sysfs_dirent *sd, const struct iattr *iattr); +void kernfs_notify(struct sysfs_dirent *sd); #else /* CONFIG_SYSFS */ @@ -120,6 +121,8 @@ static inline int kernfs_setattr(struct sysfs_dirent *sd, const struct iattr *iattr) { return -ENOSYS; } +static inline void kernfs_notify(struct sysfs_dirent *sd) { } + #endif /* CONFIG_SYSFS */ static inline struct sysfs_dirent * diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6bd10c9dc7e..b440f934afb 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -196,7 +196,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, const char *link_name); void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); -void sysfs_notify_dirent(struct sysfs_dirent *sd); struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, const void *ns); @@ -360,9 +359,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) { } -static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) -{ -} static inline struct sysfs_dirent * sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, const void *ns) @@ -408,4 +404,9 @@ sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) return sysfs_get_dirent_ns(parent_sd, name, NULL); } +static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) +{ + kernfs_notify(sd); +} + #endif /* _SYSFS_H_ */ |