blob: c68582add92ed95c9d3b612c10a31d6c35516ade [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 Sterbaf10152b2019-08-01 19:07:55 +020016const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
Anand Jaine3bd6972015-08-14 18:32:48 +080017int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
Anand Jain0d393762014-06-03 11:36:01 +080018 struct btrfs_device *one_device);
Anand Jain32576042015-08-14 18:32:49 +080019int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
Anand Jain99994cd2014-06-03 11:36:00 +080020 struct btrfs_device *one_device);
Anand Jainc6761a92019-11-21 17:33:32 +080021int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
Anand Jain1d1c1be2015-03-10 06:38:37 +080022void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
David Sterbaf93c3992019-08-01 18:50:16 +020023void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
24 const u8 *fsid);
David Sterba444e7512016-01-21 18:50:40 +010025void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
26 u64 bit, enum btrfs_feature_set set);
David Sterba5b286922019-08-01 18:50:16 +020027void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
David Sterba444e7512016-01-21 18:50:40 +010028
David Sterba89439102019-08-01 17:34:41 +020029int __init btrfs_init_sysfs(void);
30void __cold btrfs_exit_sysfs(void);
31int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
32void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
David Sterba32da53862019-10-29 19:20:18 +010033void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache);
David Sterbab8823272019-08-01 18:50:16 +020034int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
35 struct btrfs_space_info *space_info);
David Sterbab5865ba2019-08-01 18:50:16 +020036void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info);
Anand Jain668e48af2020-01-06 19:38:31 +080037void btrfs_sysfs_update_devid(struct btrfs_device *device);
David Sterba89439102019-08-01 17:34:41 +020038
David Sterba9888c342018-04-03 19:16:55 +020039#endif