blob: 6296c4f6b3303501308231ae93eb125c20a9e9f3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
David Sterba9888c342018-04-03 19:16:55 +02002
3#ifndef BTRFS_SYSFS_H
4#define BTRFS_SYSFS_H
Jeff Mahoney079b72b2013-11-01 13:06:57 -04005
David Sterba67715b22019-08-01 19:46:20 +02006#include <linux/kobject.h>
7
Jeff Mahoney079b72b2013-11-01 13:06:57 -04008enum btrfs_feature_set {
David Sterbabbe339c2018-11-27 15:25:13 +01009 FEAT_COMPAT,
Jeff Mahoney079b72b2013-11-01 13:06:57 -040010 FEAT_COMPAT_RO,
11 FEAT_INCOMPAT,
12 FEAT_MAX
13};
14
Jeff Mahoney3b02a682013-11-01 13:07:02 -040015char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
David Sterba9e6df7c2020-08-17 10:56:00 +020016const char *btrfs_feature_set_name(enum btrfs_feature_set set);
Anand Jaincd36da22020-09-05 01:34:26 +080017int btrfs_sysfs_add_device(struct btrfs_device *device);
Anand Jain6a416a02020-09-05 01:34:25 +080018void btrfs_sysfs_remove_devices_dir(struct btrfs_fs_devices *fs_devices,
19 struct btrfs_device *device);
Anand Jainc6761a92019-11-21 17:33:32 +080020int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
Anand Jain1d1c1be2015-03-10 06:38:37 +080021void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
Nikolay Borisov8e560082020-08-12 16:18:51 +030022void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices);
David Sterba444e7512016-01-21 18:50:40 +010023void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
24 u64 bit, enum btrfs_feature_set set);
David Sterba5b286922019-08-01 18:50:16 +020025void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
David Sterba444e7512016-01-21 18:50:40 +010026
David Sterba89439102019-08-01 17:34:41 +020027int __init btrfs_init_sysfs(void);
28void __cold btrfs_exit_sysfs(void);
29int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
30void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
David Sterba32da53862019-10-29 19:20:18 +010031void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache);
David Sterbab8823272019-08-01 18:50:16 +020032int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
33 struct btrfs_space_info *space_info);
David Sterbab5865ba2019-08-01 18:50:16 +020034void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info);
Anand Jain668e48af2020-01-06 19:38:31 +080035void btrfs_sysfs_update_devid(struct btrfs_device *device);
David Sterba89439102019-08-01 17:34:41 +020036
Qu Wenruo49e5fb42020-06-28 13:07:15 +080037int btrfs_sysfs_add_one_qgroup(struct btrfs_fs_info *fs_info,
38 struct btrfs_qgroup *qgroup);
39void btrfs_sysfs_del_qgroups(struct btrfs_fs_info *fs_info);
40int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info);
41void btrfs_sysfs_del_one_qgroup(struct btrfs_fs_info *fs_info,
42 struct btrfs_qgroup *qgroup);
43
David Sterba9888c342018-04-03 19:16:55 +020044#endif