Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
David Sterba | 9888c34 | 2018-04-03 19:16:55 +0200 | [diff] [blame] | 2 | |
| 3 | #ifndef BTRFS_SYSFS_H |
| 4 | #define BTRFS_SYSFS_H |
Jeff Mahoney | 079b72b | 2013-11-01 13:06:57 -0400 | [diff] [blame] | 5 | |
David Sterba | 67715b2 | 2019-08-01 19:46:20 +0200 | [diff] [blame] | 6 | #include <linux/kobject.h> |
| 7 | |
Jeff Mahoney | 079b72b | 2013-11-01 13:06:57 -0400 | [diff] [blame] | 8 | enum btrfs_feature_set { |
David Sterba | bbe339c | 2018-11-27 15:25:13 +0100 | [diff] [blame] | 9 | FEAT_COMPAT, |
Jeff Mahoney | 079b72b | 2013-11-01 13:06:57 -0400 | [diff] [blame] | 10 | FEAT_COMPAT_RO, |
| 11 | FEAT_INCOMPAT, |
| 12 | FEAT_MAX |
| 13 | }; |
| 14 | |
Jeff Mahoney | 3b02a68 | 2013-11-01 13:07:02 -0400 | [diff] [blame] | 15 | char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags); |
David Sterba | f10152b | 2019-08-01 19:07:55 +0200 | [diff] [blame] | 16 | const char * const btrfs_feature_set_name(enum btrfs_feature_set set); |
Anand Jain | e3bd697 | 2015-08-14 18:32:48 +0800 | [diff] [blame] | 17 | int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices, |
Anand Jain | 0d39376 | 2014-06-03 11:36:01 +0800 | [diff] [blame] | 18 | struct btrfs_device *one_device); |
Anand Jain | 3257604 | 2015-08-14 18:32:49 +0800 | [diff] [blame] | 19 | int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices, |
Anand Jain | 99994cd | 2014-06-03 11:36:00 +0800 | [diff] [blame] | 20 | struct btrfs_device *one_device); |
Anand Jain | c6761a9 | 2019-11-21 17:33:32 +0800 | [diff] [blame] | 21 | int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs); |
Anand Jain | 1d1c1be | 2015-03-10 06:38:37 +0800 | [diff] [blame] | 22 | void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs); |
David Sterba | f93c399 | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 23 | void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices, |
| 24 | const u8 *fsid); |
David Sterba | 444e751 | 2016-01-21 18:50:40 +0100 | [diff] [blame] | 25 | void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, |
| 26 | u64 bit, enum btrfs_feature_set set); |
David Sterba | 5b28692 | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 27 | void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action); |
David Sterba | 444e751 | 2016-01-21 18:50:40 +0100 | [diff] [blame] | 28 | |
David Sterba | 8943910 | 2019-08-01 17:34:41 +0200 | [diff] [blame] | 29 | int __init btrfs_init_sysfs(void); |
| 30 | void __cold btrfs_exit_sysfs(void); |
| 31 | int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info); |
| 32 | void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info); |
David Sterba | 32da5386 | 2019-10-29 19:20:18 +0100 | [diff] [blame] | 33 | void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache); |
David Sterba | b882327 | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 34 | int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info, |
| 35 | struct btrfs_space_info *space_info); |
David Sterba | b5865ba | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 36 | void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info); |
Anand Jain | 668e48af | 2020-01-06 19:38:31 +0800 | [diff] [blame] | 37 | void btrfs_sysfs_update_devid(struct btrfs_device *device); |
David Sterba | 8943910 | 2019-08-01 17:34:41 +0200 | [diff] [blame] | 38 | |
David Sterba | 9888c34 | 2018-04-03 19:16:55 +0200 | [diff] [blame] | 39 | #endif |