diff options
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6695040a0317..30b2ebee6439 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifndef _SYSFS_H_ | 12 | #ifndef _SYSFS_H_ |
13 | #define _SYSFS_H_ | 13 | #define _SYSFS_H_ |
14 | 14 | ||
15 | #include <linux/kernfs.h> | ||
15 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
@@ -175,8 +176,6 @@ struct sysfs_ops { | |||
175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); | 176 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); |
176 | }; | 177 | }; |
177 | 178 | ||
178 | struct sysfs_dirent; | ||
179 | |||
180 | #ifdef CONFIG_SYSFS | 179 | #ifdef CONFIG_SYSFS |
181 | 180 | ||
182 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 181 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
@@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | |||
244 | const char *link_name); | 243 | const char *link_name); |
245 | 244 | ||
246 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 245 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
247 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | ||
248 | struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, | ||
249 | const unsigned char *name, | ||
250 | const void *ns); | ||
251 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
252 | void sysfs_put(struct sysfs_dirent *sd); | ||
253 | 246 | ||
254 | int __must_check sysfs_init(void); | 247 | int __must_check sysfs_init(void); |
255 | 248 | ||
@@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, | |||
419 | const char *attr) | 412 | const char *attr) |
420 | { | 413 | { |
421 | } | 414 | } |
422 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
423 | { | ||
424 | } | ||
425 | static inline struct sysfs_dirent * | ||
426 | sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, | ||
427 | const void *ns) | ||
428 | { | ||
429 | return NULL; | ||
430 | } | ||
431 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
432 | { | ||
433 | return NULL; | ||
434 | } | ||
435 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
436 | { | ||
437 | } | ||
438 | 415 | ||
439 | static inline int __must_check sysfs_init(void) | 416 | static inline int __must_check sysfs_init(void) |
440 | { | 417 | { |
@@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target | |||
461 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); | 438 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); |
462 | } | 439 | } |
463 | 440 | ||
464 | static inline struct sysfs_dirent * | 441 | static inline void sysfs_notify_dirent(struct kernfs_node *kn) |
465 | sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) | 442 | { |
443 | kernfs_notify(kn); | ||
444 | } | ||
445 | |||
446 | static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent, | ||
447 | const unsigned char *name) | ||
448 | { | ||
449 | return kernfs_find_and_get(parent, name); | ||
450 | } | ||
451 | |||
452 | static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) | ||
453 | { | ||
454 | kernfs_get(kn); | ||
455 | return kn; | ||
456 | } | ||
457 | |||
458 | static inline void sysfs_put(struct kernfs_node *kn) | ||
466 | { | 459 | { |
467 | return sysfs_get_dirent_ns(parent_sd, name, NULL); | 460 | kernfs_put(kn); |
468 | } | 461 | } |
469 | 462 | ||
470 | #endif /* _SYSFS_H_ */ | 463 | #endif /* _SYSFS_H_ */ |