blob: bacef43f72672ba594420dcf65c8fd17d27f563d [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 Jain53f8a742020-09-05 01:34:27 +080018void btrfs_sysfs_remove_device(struct btrfs_device *device);
Anand Jainc6761a92019-11-21 17:33:32 +080019int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
Anand Jain1d1c1be2015-03-10 06:38:37 +080020void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
Nikolay Borisov8e560082020-08-12 16:18:51 +030021void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices);
David Sterba444e7512016-01-21 18:50:40 +010022void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
23 u64 bit, enum btrfs_feature_set set);
David Sterba5b286922019-08-01 18:50:16 +020024void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
David Sterba444e7512016-01-21 18:50:40 +010025
David Sterba89439102019-08-01 17:34:41 +020026int __init btrfs_init_sysfs(void);
27void __cold btrfs_exit_sysfs(void);
28int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
29void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
David Sterba32da53862019-10-29 19:20:18 +010030void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache);
David Sterbab8823272019-08-01 18:50:16 +020031int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
32 struct btrfs_space_info *space_info);
David Sterbab5865ba2019-08-01 18:50:16 +020033void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info);
Anand Jain668e48af2020-01-06 19:38:31 +080034void btrfs_sysfs_update_devid(struct btrfs_device *device);
David Sterba89439102019-08-01 17:34:41 +020035
Qu Wenruo49e5fb42020-06-28 13:07:15 +080036int btrfs_sysfs_add_one_qgroup(struct btrfs_fs_info *fs_info,
37 struct btrfs_qgroup *qgroup);
38void btrfs_sysfs_del_qgroups(struct btrfs_fs_info *fs_info);
39int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info);
40void btrfs_sysfs_del_one_qgroup(struct btrfs_fs_info *fs_info,
41 struct btrfs_qgroup *qgroup);
42
David Sterba9888c342018-04-03 19:16:55 +020043#endif