Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef BTRFS_SYSFS_H
4#define BTRFS_SYSFS_H
5
6#include <linux/kobject.h>
7
8enum btrfs_feature_set {
9 FEAT_COMPAT,
10 FEAT_COMPAT_RO,
11 FEAT_INCOMPAT,
12 FEAT_MAX
13};
14
15char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
16const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
17int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
18 struct btrfs_device *one_device);
19int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
20 struct btrfs_device *one_device);
21int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs,
22 struct kobject *parent);
23int btrfs_sysfs_add_device(struct btrfs_fs_devices *fs_devs);
24void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
25void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
26 const u8 *fsid);
27void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
28 u64 bit, enum btrfs_feature_set set);
29void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
30
31int __init btrfs_init_sysfs(void);
32void __cold btrfs_exit_sysfs(void);
33int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
34void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
35void btrfs_sysfs_add_block_group_type(struct btrfs_block_group_cache *cache);
36int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
37 struct btrfs_space_info *space_info);
38void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info);
39
40#endif
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef BTRFS_SYSFS_H
4#define BTRFS_SYSFS_H
5
6#include <linux/types.h>
7#include <linux/compiler_types.h>
8#include <linux/kobject.h>
9
10struct btrfs_fs_info;
11struct btrfs_device;
12struct btrfs_fs_devices;
13struct btrfs_block_group;
14struct btrfs_space_info;
15struct btrfs_qgroup;
16
17enum btrfs_feature_set {
18 FEAT_COMPAT,
19 FEAT_COMPAT_RO,
20 FEAT_INCOMPAT,
21 FEAT_MAX
22};
23
24char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
25const char *btrfs_feature_set_name(enum btrfs_feature_set set);
26int btrfs_sysfs_add_device(struct btrfs_device *device);
27void btrfs_sysfs_remove_device(struct btrfs_device *device);
28int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
29void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
30void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices);
31void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info);
32void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
33
34int __init btrfs_init_sysfs(void);
35void __cold btrfs_exit_sysfs(void);
36int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
37void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
38void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache);
39int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
40 struct btrfs_space_info *space_info);
41void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info);
42void btrfs_sysfs_update_devid(struct btrfs_device *device);
43
44int btrfs_sysfs_add_one_qgroup(struct btrfs_fs_info *fs_info,
45 struct btrfs_qgroup *qgroup);
46void btrfs_sysfs_del_qgroups(struct btrfs_fs_info *fs_info);
47int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info);
48void btrfs_sysfs_del_one_qgroup(struct btrfs_fs_info *fs_info,
49 struct btrfs_qgroup *qgroup);
50
51#endif