blob: 610e9c36a94cd17423b388598b7be1dbe1e0ce53 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef BTRFS_SYSFS_H
4#define BTRFS_SYSFS_H
5
David Brazdil0f672f62019-12-10 10:32:29 +00006#include <linux/kobject.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00007
8enum btrfs_feature_set {
David Brazdil0f672f62019-12-10 10:32:29 +00009 FEAT_COMPAT,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010 FEAT_COMPAT_RO,
11 FEAT_INCOMPAT,
12 FEAT_MAX
13};
14
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000015char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
David Brazdil0f672f62019-12-10 10:32:29 +000016const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000017int 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);
David Brazdil0f672f62019-12-10 10:32:29 +000025void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
26 const u8 *fsid);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000027void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
28 u64 bit, enum btrfs_feature_set set);
David Brazdil0f672f62019-12-10 10:32:29 +000029void 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);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000039
40#endif