Lines Matching refs:fs_info
807 static inline void btrfs_set_last_root_drop_gen(struct btrfs_fs_info *fs_info, in btrfs_set_last_root_drop_gen() argument
810 WRITE_ONCE(fs_info->last_root_drop_gen, gen); in btrfs_set_last_root_drop_gen()
813 static inline u64 btrfs_get_last_root_drop_gen(const struct btrfs_fs_info *fs_info) in btrfs_get_last_root_drop_gen() argument
815 return READ_ONCE(fs_info->last_root_drop_gen); in btrfs_get_last_root_drop_gen()
823 const struct btrfs_fs_info *fs_info, u64 csum_bytes) in btrfs_csum_bytes_to_leaves() argument
825 const u64 num_csums = csum_bytes >> fs_info->sectorsize_bits; in btrfs_csum_bytes_to_leaves()
827 return DIV_ROUND_UP_ULL(num_csums, fs_info->csums_per_leaf); in btrfs_csum_bytes_to_leaves()
834 static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info, in btrfs_calc_insert_metadata_size() argument
837 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items; in btrfs_calc_insert_metadata_size()
844 static inline u64 btrfs_calc_metadata_size(struct btrfs_fs_info *fs_info, in btrfs_calc_metadata_size() argument
847 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items; in btrfs_calc_metadata_size()
850 #define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \
853 static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info) in btrfs_is_zoned() argument
855 return fs_info->zone_size > 0; in btrfs_is_zoned()
861 static inline u32 count_max_extents(struct btrfs_fs_info *fs_info, u64 size) in count_max_extents() argument
864 if (!fs_info) in count_max_extents()
868 return div_u64(size + fs_info->max_extent_size - 1, fs_info->max_extent_size); in count_max_extents()
871 bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
873 bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info,
875 void btrfs_exclop_start_unlock(struct btrfs_fs_info *fs_info);
876 void btrfs_exclop_finish(struct btrfs_fs_info *fs_info);
877 void btrfs_exclop_balance(struct btrfs_fs_info *fs_info,
881 void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
883 void __btrfs_clear_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
885 void __btrfs_set_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
887 void __btrfs_clear_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
890 #define __btrfs_fs_incompat(fs_info, flags) \ argument
891 (!!(btrfs_super_incompat_flags((fs_info)->super_copy) & (flags)))
893 #define __btrfs_fs_compat_ro(fs_info, flags) \ argument
894 (!!(btrfs_super_compat_ro_flags((fs_info)->super_copy) & (flags)))
902 #define btrfs_fs_incompat(fs_info, opt) \ argument
903 __btrfs_fs_incompat((fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
911 #define btrfs_fs_compat_ro(fs_info, opt) \ argument
912 __btrfs_fs_compat_ro((fs_info), BTRFS_FEATURE_COMPAT_RO_##opt)
917 #define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \ argument
920 #define btrfs_set_and_info(fs_info, opt, fmt, args...) \ argument
922 if (!btrfs_test_opt(fs_info, opt)) \
923 btrfs_info(fs_info, fmt, ##args); \
924 btrfs_set_opt(fs_info->mount_opt, opt); \
927 #define btrfs_clear_and_info(fs_info, opt, fmt, args...) \ argument
929 if (btrfs_test_opt(fs_info, opt)) \
930 btrfs_info(fs_info, fmt, ##args); \
931 btrfs_clear_opt(fs_info->mount_opt, opt); \
934 static inline int btrfs_fs_closing(struct btrfs_fs_info *fs_info) in btrfs_fs_closing() argument
937 if (test_bit(BTRFS_FS_CLOSING_START, &fs_info->flags)) { in btrfs_fs_closing()
938 if (test_bit(BTRFS_FS_CLOSING_DONE, &fs_info->flags)) in btrfs_fs_closing()
953 static inline int btrfs_need_cleaner_sleep(struct btrfs_fs_info *fs_info) in btrfs_need_cleaner_sleep() argument
955 return test_bit(BTRFS_FS_STATE_RO, &fs_info->fs_state) || in btrfs_need_cleaner_sleep()
956 btrfs_fs_closing(fs_info); in btrfs_need_cleaner_sleep()
959 static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info) in btrfs_wake_unfinished_drop() argument
961 clear_and_wake_up_bit(BTRFS_FS_UNFINISHED_DROPS, &fs_info->flags); in btrfs_wake_unfinished_drop()
964 #define BTRFS_FS_ERROR(fs_info) (unlikely(test_bit(BTRFS_FS_STATE_ERROR, \ argument
965 &(fs_info)->fs_state)))
966 #define BTRFS_FS_LOG_CLEANUP_ERROR(fs_info) \ argument
968 &(fs_info)->fs_state)))
974 static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info) in btrfs_is_testing() argument
976 return test_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state); in btrfs_is_testing()
985 static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info) in btrfs_is_testing() argument