xref: /linux/fs/bcachefs/chardev.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
11c6fdbd8SKent Overstreet /* SPDX-License-Identifier: GPL-2.0 */
21c6fdbd8SKent Overstreet #ifndef _BCACHEFS_CHARDEV_H
31c6fdbd8SKent Overstreet #define _BCACHEFS_CHARDEV_H
41c6fdbd8SKent Overstreet 
51c6fdbd8SKent Overstreet #ifndef NO_BCACHEFS_FS
61c6fdbd8SKent Overstreet 
71c6fdbd8SKent Overstreet long bch2_fs_ioctl(struct bch_fs *, unsigned, void __user *);
81c6fdbd8SKent Overstreet 
91c6fdbd8SKent Overstreet void bch2_fs_chardev_exit(struct bch_fs *);
101c6fdbd8SKent Overstreet int bch2_fs_chardev_init(struct bch_fs *);
111c6fdbd8SKent Overstreet 
121c6fdbd8SKent Overstreet void bch2_chardev_exit(void);
131c6fdbd8SKent Overstreet int __init bch2_chardev_init(void);
141c6fdbd8SKent Overstreet 
151c6fdbd8SKent Overstreet #else
161c6fdbd8SKent Overstreet 
bch2_fs_ioctl(struct bch_fs * c,unsigned cmd,void __user * arg)171c6fdbd8SKent Overstreet static inline long bch2_fs_ioctl(struct bch_fs *c,
181c6fdbd8SKent Overstreet 				unsigned cmd, void __user * arg)
191c6fdbd8SKent Overstreet {
20*1e81f89bSKent Overstreet 	return -ENOTTY;
211c6fdbd8SKent Overstreet }
221c6fdbd8SKent Overstreet 
bch2_fs_chardev_exit(struct bch_fs * c)231c6fdbd8SKent Overstreet static inline void bch2_fs_chardev_exit(struct bch_fs *c) {}
bch2_fs_chardev_init(struct bch_fs * c)241c6fdbd8SKent Overstreet static inline int bch2_fs_chardev_init(struct bch_fs *c) { return 0; }
251c6fdbd8SKent Overstreet 
bch2_chardev_exit(void)261c6fdbd8SKent Overstreet static inline void bch2_chardev_exit(void) {}
bch2_chardev_init(void)271c6fdbd8SKent Overstreet static inline int __init bch2_chardev_init(void) { return 0; }
281c6fdbd8SKent Overstreet 
291c6fdbd8SKent Overstreet #endif /* NO_BCACHEFS_FS */
301c6fdbd8SKent Overstreet 
311c6fdbd8SKent Overstreet #endif /* _BCACHEFS_CHARDEV_H */
32