Commit | Line | Data |
---|---|---|
1c6fdbd8 KO |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | #ifndef _BCACHEFS_SYSFS_H_ | |
3 | #define _BCACHEFS_SYSFS_H_ | |
4 | ||
5 | #include <linux/sysfs.h> | |
6 | ||
7 | #ifndef NO_BCACHEFS_SYSFS | |
8 | ||
9 | struct attribute; | |
10 | struct sysfs_ops; | |
11 | ||
12 | extern struct attribute *bch2_fs_files[]; | |
104c6974 | 13 | extern struct attribute *bch2_fs_counters_files[]; |
1c6fdbd8 KO |
14 | extern struct attribute *bch2_fs_internal_files[]; |
15 | extern struct attribute *bch2_fs_opts_dir_files[]; | |
16 | extern struct attribute *bch2_fs_time_stats_files[]; | |
17 | extern struct attribute *bch2_dev_files[]; | |
18 | ||
104c6974 DH |
19 | extern const struct sysfs_ops bch2_fs_sysfs_ops; |
20 | extern const struct sysfs_ops bch2_fs_counters_sysfs_ops; | |
21 | extern const struct sysfs_ops bch2_fs_internal_sysfs_ops; | |
22 | extern const struct sysfs_ops bch2_fs_opts_dir_sysfs_ops; | |
23 | extern const struct sysfs_ops bch2_fs_time_stats_sysfs_ops; | |
24 | extern const struct sysfs_ops bch2_dev_sysfs_ops; | |
1c6fdbd8 KO |
25 | |
26 | int bch2_opts_create_sysfs_files(struct kobject *); | |
27 | ||
28 | #else | |
29 | ||
30 | static struct attribute *bch2_fs_files[] = {}; | |
104c6974 | 31 | static struct attribute *bch2_fs_counters_files[] = {}; |
1c6fdbd8 KO |
32 | static struct attribute *bch2_fs_internal_files[] = {}; |
33 | static struct attribute *bch2_fs_opts_dir_files[] = {}; | |
34 | static struct attribute *bch2_fs_time_stats_files[] = {}; | |
35 | static struct attribute *bch2_dev_files[] = {}; | |
36 | ||
37 | static const struct sysfs_ops bch2_fs_sysfs_ops; | |
104c6974 | 38 | static const struct sysfs_ops bch2_fs_counters_sysfs_ops; |
1c6fdbd8 KO |
39 | static const struct sysfs_ops bch2_fs_internal_sysfs_ops; |
40 | static const struct sysfs_ops bch2_fs_opts_dir_sysfs_ops; | |
41 | static const struct sysfs_ops bch2_fs_time_stats_sysfs_ops; | |
42 | static const struct sysfs_ops bch2_dev_sysfs_ops; | |
43 | ||
44 | static inline int bch2_opts_create_sysfs_files(struct kobject *kobj) { return 0; } | |
45 | ||
46 | #endif /* NO_BCACHEFS_SYSFS */ | |
47 | ||
48 | #endif /* _BCACHEFS_SYSFS_H_ */ |