]> git.sesse.net Git - bcachefs-tools-debian/blob - include/linux/sysfs.h
Update bcachefs sources to 3610542890 bcachefs: Convert to skcipher interface for...
[bcachefs-tools-debian] / include / linux / sysfs.h
1 #ifndef _SYSFS_H_
2 #define _SYSFS_H_
3
4 #include <linux/compiler.h>
5 #include <linux/stringify.h>
6
7 struct kobject;
8
9 struct attribute {
10         const char              *name;
11         umode_t                 mode;
12 };
13
14 #define __ATTR(_name, _mode, _show, _store) {                           \
15         .attr = {.name = __stringify(_name), .mode = _mode },           \
16         .show   = _show,                                                \
17         .store  = _store,                                               \
18 }
19
20 struct sysfs_ops {
21         ssize_t (*show)(struct kobject *, struct attribute *, char *);
22         ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
23 };
24
25 static inline int sysfs_create_files(struct kobject *kobj,
26                                     const struct attribute **attr)
27 {
28         return 0;
29 }
30
31 static inline int sysfs_create_link(struct kobject *kobj,
32                                     struct kobject *target, const char *name)
33 {
34         return 0;
35 }
36
37 static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
38 {
39 }
40
41 #endif /* _SYSFS_H_ */