diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 2 | ||||
-rw-r--r-- | include/linux/kernfs.h | 6 | ||||
-rw-r--r-- | include/linux/sysfs.h | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 952b01033c32..1ff3f1697513 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -560,6 +560,8 @@ extern int device_create_file(struct device *device, | |||
560 | const struct device_attribute *entry); | 560 | const struct device_attribute *entry); |
561 | extern void device_remove_file(struct device *dev, | 561 | extern void device_remove_file(struct device *dev, |
562 | const struct device_attribute *attr); | 562 | const struct device_attribute *attr); |
563 | extern bool device_remove_file_self(struct device *dev, | ||
564 | const struct device_attribute *attr); | ||
563 | extern int __must_check device_create_bin_file(struct device *dev, | 565 | extern int __must_check device_create_bin_file(struct device *dev, |
564 | const struct bin_attribute *attr); | 566 | const struct bin_attribute *attr); |
565 | extern void device_remove_bin_file(struct device *dev, | 567 | extern void device_remove_bin_file(struct device *dev, |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index ac8693027058..0b7b7cc352eb 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -43,6 +43,8 @@ enum kernfs_node_flag { | |||
43 | KERNFS_HAS_MMAP = 0x0080, | 43 | KERNFS_HAS_MMAP = 0x0080, |
44 | KERNFS_LOCKDEP = 0x0100, | 44 | KERNFS_LOCKDEP = 0x0100, |
45 | KERNFS_STATIC_NAME = 0x0200, | 45 | KERNFS_STATIC_NAME = 0x0200, |
46 | KERNFS_SUICIDAL = 0x0400, | ||
47 | KERNFS_SUICIDED = 0x0800, | ||
46 | }; | 48 | }; |
47 | 49 | ||
48 | /* type-specific structures for kernfs_node union members */ | 50 | /* type-specific structures for kernfs_node union members */ |
@@ -239,6 +241,7 @@ void kernfs_reactivate(struct kernfs_node *kn); | |||
239 | void kernfs_deactivate_self(struct kernfs_node *kn); | 241 | void kernfs_deactivate_self(struct kernfs_node *kn); |
240 | void kernfs_reactivate_self(struct kernfs_node *kn); | 242 | void kernfs_reactivate_self(struct kernfs_node *kn); |
241 | void kernfs_remove(struct kernfs_node *kn); | 243 | void kernfs_remove(struct kernfs_node *kn); |
244 | bool kernfs_remove_self(struct kernfs_node *kn); | ||
242 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, | 245 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, |
243 | const void *ns); | 246 | const void *ns); |
244 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | 247 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, |
@@ -296,6 +299,9 @@ kernfs_create_link(struct kernfs_node *parent, const char *name, | |||
296 | 299 | ||
297 | static inline void kernfs_remove(struct kernfs_node *kn) { } | 300 | static inline void kernfs_remove(struct kernfs_node *kn) { } |
298 | 301 | ||
302 | static inline bool kernfs_remove_self(struct kernfs_node *kn) | ||
303 | { return false; } | ||
304 | |||
299 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, | 305 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, |
300 | const char *name, const void *ns) | 306 | const char *name, const void *ns) |
301 | { return -ENOSYS; } | 307 | { return -ENOSYS; } |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 30b2ebee6439..bd96c603ab6c 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -198,6 +198,7 @@ int __must_check sysfs_chmod_file(struct kobject *kobj, | |||
198 | const struct attribute *attr, umode_t mode); | 198 | const struct attribute *attr, umode_t mode); |
199 | void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, | 199 | void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, |
200 | const void *ns); | 200 | const void *ns); |
201 | bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr); | ||
201 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | 202 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); |
202 | 203 | ||
203 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 204 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
@@ -301,6 +302,12 @@ static inline void sysfs_remove_file_ns(struct kobject *kobj, | |||
301 | { | 302 | { |
302 | } | 303 | } |
303 | 304 | ||
305 | static inline bool sysfs_remove_file_self(struct kobject *kobj, | ||
306 | const struct attribute *attr) | ||
307 | { | ||
308 | return false; | ||
309 | } | ||
310 | |||
304 | static inline void sysfs_remove_files(struct kobject *kobj, | 311 | static inline void sysfs_remove_files(struct kobject *kobj, |
305 | const struct attribute **attr) | 312 | const struct attribute **attr) |
306 | { | 313 | { |