sysfs.h 1.9 KB

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