aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/kernfs.h6
-rw-r--r--include/linux/sysfs.h7
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);
561extern void device_remove_file(struct device *dev, 561extern void device_remove_file(struct device *dev,
562 const struct device_attribute *attr); 562 const struct device_attribute *attr);
563extern bool device_remove_file_self(struct device *dev,
564 const struct device_attribute *attr);
563extern int __must_check device_create_bin_file(struct device *dev, 565extern int __must_check device_create_bin_file(struct device *dev,
564 const struct bin_attribute *attr); 566 const struct bin_attribute *attr);
565extern void device_remove_bin_file(struct device *dev, 567extern 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);
239void kernfs_deactivate_self(struct kernfs_node *kn); 241void kernfs_deactivate_self(struct kernfs_node *kn);
240void kernfs_reactivate_self(struct kernfs_node *kn); 242void kernfs_reactivate_self(struct kernfs_node *kn);
241void kernfs_remove(struct kernfs_node *kn); 243void kernfs_remove(struct kernfs_node *kn);
244bool kernfs_remove_self(struct kernfs_node *kn);
242int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, 245int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
243 const void *ns); 246 const void *ns);
244int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, 247int 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
297static inline void kernfs_remove(struct kernfs_node *kn) { } 300static inline void kernfs_remove(struct kernfs_node *kn) { }
298 301
302static inline bool kernfs_remove_self(struct kernfs_node *kn)
303{ return false; }
304
299static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, 305static 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);
199void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, 199void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
200 const void *ns); 200 const void *ns);
201bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
201void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); 202void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
202 203
203int __must_check sysfs_create_bin_file(struct kobject *kobj, 204int __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
305static inline bool sysfs_remove_file_self(struct kobject *kobj,
306 const struct attribute *attr)
307{
308 return false;
309}
310
304static inline void sysfs_remove_files(struct kobject *kobj, 311static inline void sysfs_remove_files(struct kobject *kobj,
305 const struct attribute **attr) 312 const struct attribute **attr)
306{ 313{