xref: /linux/fs/bcachefs/sysfs.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
11c6fdbd8SKent Overstreet /* SPDX-License-Identifier: GPL-2.0 */
21c6fdbd8SKent Overstreet #ifndef _BCACHEFS_SYSFS_H_
31c6fdbd8SKent Overstreet #define _BCACHEFS_SYSFS_H_
41c6fdbd8SKent Overstreet 
51c6fdbd8SKent Overstreet #include <linux/sysfs.h>
61c6fdbd8SKent Overstreet 
71c6fdbd8SKent Overstreet #ifndef NO_BCACHEFS_SYSFS
81c6fdbd8SKent Overstreet 
91c6fdbd8SKent Overstreet struct attribute;
101c6fdbd8SKent Overstreet struct sysfs_ops;
111c6fdbd8SKent Overstreet 
121c6fdbd8SKent Overstreet extern struct attribute *bch2_fs_files[];
13*104c6974SDaniel Hill extern struct attribute *bch2_fs_counters_files[];
141c6fdbd8SKent Overstreet extern struct attribute *bch2_fs_internal_files[];
151c6fdbd8SKent Overstreet extern struct attribute *bch2_fs_opts_dir_files[];
161c6fdbd8SKent Overstreet extern struct attribute *bch2_fs_time_stats_files[];
171c6fdbd8SKent Overstreet extern struct attribute *bch2_dev_files[];
181c6fdbd8SKent Overstreet 
19*104c6974SDaniel Hill extern const struct sysfs_ops bch2_fs_sysfs_ops;
20*104c6974SDaniel Hill extern const struct sysfs_ops bch2_fs_counters_sysfs_ops;
21*104c6974SDaniel Hill extern const struct sysfs_ops bch2_fs_internal_sysfs_ops;
22*104c6974SDaniel Hill extern const struct sysfs_ops bch2_fs_opts_dir_sysfs_ops;
23*104c6974SDaniel Hill extern const struct sysfs_ops bch2_fs_time_stats_sysfs_ops;
24*104c6974SDaniel Hill extern const struct sysfs_ops bch2_dev_sysfs_ops;
251c6fdbd8SKent Overstreet 
261c6fdbd8SKent Overstreet int bch2_opts_create_sysfs_files(struct kobject *);
271c6fdbd8SKent Overstreet 
281c6fdbd8SKent Overstreet #else
291c6fdbd8SKent Overstreet 
301c6fdbd8SKent Overstreet static struct attribute *bch2_fs_files[] = {};
31*104c6974SDaniel Hill static struct attribute *bch2_fs_counters_files[] = {};
321c6fdbd8SKent Overstreet static struct attribute *bch2_fs_internal_files[] = {};
331c6fdbd8SKent Overstreet static struct attribute *bch2_fs_opts_dir_files[] = {};
341c6fdbd8SKent Overstreet static struct attribute *bch2_fs_time_stats_files[] = {};
351c6fdbd8SKent Overstreet static struct attribute *bch2_dev_files[] = {};
361c6fdbd8SKent Overstreet 
371c6fdbd8SKent Overstreet static const struct sysfs_ops bch2_fs_sysfs_ops;
38*104c6974SDaniel Hill static const struct sysfs_ops bch2_fs_counters_sysfs_ops;
391c6fdbd8SKent Overstreet static const struct sysfs_ops bch2_fs_internal_sysfs_ops;
401c6fdbd8SKent Overstreet static const struct sysfs_ops bch2_fs_opts_dir_sysfs_ops;
411c6fdbd8SKent Overstreet static const struct sysfs_ops bch2_fs_time_stats_sysfs_ops;
421c6fdbd8SKent Overstreet static const struct sysfs_ops bch2_dev_sysfs_ops;
431c6fdbd8SKent Overstreet 
bch2_opts_create_sysfs_files(struct kobject * kobj)441c6fdbd8SKent Overstreet static inline int bch2_opts_create_sysfs_files(struct kobject *kobj) { return 0; }
451c6fdbd8SKent Overstreet 
461c6fdbd8SKent Overstreet #endif /* NO_BCACHEFS_SYSFS */
471c6fdbd8SKent Overstreet 
481c6fdbd8SKent Overstreet #endif  /* _BCACHEFS_SYSFS_H_ */
49