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 | 9e6df7c | 2020-08-17 10:56:00 +0200 | [diff] [blame] | 16 | const char *btrfs_feature_set_name(enum btrfs_feature_set set); |
Anand Jain | cd36da2 | 2020-09-05 01:34:26 +0800 | [diff] [blame] | 17 | int btrfs_sysfs_add_device(struct btrfs_device *device); |
Anand Jain | 53f8a74 | 2020-09-05 01:34:27 +0800 | [diff] [blame] | 18 | void btrfs_sysfs_remove_device(struct btrfs_device *device); |
Anand Jain | c6761a9 | 2019-11-21 17:33:32 +0800 | [diff] [blame] | 19 | int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs); |
Anand Jain | 1d1c1be | 2015-03-10 06:38:37 +0800 | [diff] [blame] | 20 | void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs); |
Nikolay Borisov | 8e56008 | 2020-08-12 16:18:51 +0300 | [diff] [blame] | 21 | void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices); |
David Sterba | 444e751 | 2016-01-21 18:50:40 +0100 | [diff] [blame] | 22 | void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, |
| 23 | u64 bit, enum btrfs_feature_set set); |
David Sterba | 5b28692 | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 24 | void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action); |
David Sterba | 444e751 | 2016-01-21 18:50:40 +0100 | [diff] [blame] | 25 | |
David Sterba | 8943910 | 2019-08-01 17:34:41 +0200 | [diff] [blame] | 26 | int __init btrfs_init_sysfs(void); |
| 27 | void __cold btrfs_exit_sysfs(void); |
| 28 | int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info); |
| 29 | void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info); |
David Sterba | 32da5386 | 2019-10-29 19:20:18 +0100 | [diff] [blame] | 30 | void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache); |
David Sterba | b882327 | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 31 | int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info, |
| 32 | struct btrfs_space_info *space_info); |
David Sterba | b5865ba | 2019-08-01 18:50:16 +0200 | [diff] [blame] | 33 | void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info); |
Anand Jain | 668e48af | 2020-01-06 19:38:31 +0800 | [diff] [blame] | 34 | void btrfs_sysfs_update_devid(struct btrfs_device *device); |
David Sterba | 8943910 | 2019-08-01 17:34:41 +0200 | [diff] [blame] | 35 | |
Qu Wenruo | 49e5fb4 | 2020-06-28 13:07:15 +0800 | [diff] [blame] | 36 | int btrfs_sysfs_add_one_qgroup(struct btrfs_fs_info *fs_info, |
| 37 | struct btrfs_qgroup *qgroup); |
| 38 | void btrfs_sysfs_del_qgroups(struct btrfs_fs_info *fs_info); |
| 39 | int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info); |
| 40 | void btrfs_sysfs_del_one_qgroup(struct btrfs_fs_info *fs_info, |
| 41 | struct btrfs_qgroup *qgroup); |
| 42 | |
David Sterba | 9888c34 | 2018-04-03 19:16:55 +0200 | [diff] [blame] | 43 | #endif |