Lines Matching refs:fs_info

884 #define page_to_fs_info(_page)	 (page_to_inode(_page)->root->fs_info)
885 #define folio_to_fs_info(_folio) (folio_to_inode(_folio)->root->fs_info)
888 struct inode *: (_inode)))->root->fs_info)
890 static inline u64 btrfs_get_fs_generation(const struct btrfs_fs_info *fs_info) in btrfs_get_fs_generation() argument
892 return READ_ONCE(fs_info->generation); in btrfs_get_fs_generation()
895 static inline void btrfs_set_fs_generation(struct btrfs_fs_info *fs_info, u64 gen) in btrfs_set_fs_generation() argument
897 WRITE_ONCE(fs_info->generation, gen); in btrfs_set_fs_generation()
900 static inline u64 btrfs_get_last_trans_committed(const struct btrfs_fs_info *fs_info) in btrfs_get_last_trans_committed() argument
902 return READ_ONCE(fs_info->last_trans_committed); in btrfs_get_last_trans_committed()
905 static inline void btrfs_set_last_trans_committed(struct btrfs_fs_info *fs_info, u64 gen) in btrfs_set_last_trans_committed() argument
907 WRITE_ONCE(fs_info->last_trans_committed, gen); in btrfs_set_last_trans_committed()
910 static inline void btrfs_set_last_root_drop_gen(struct btrfs_fs_info *fs_info, in btrfs_set_last_root_drop_gen() argument
913 WRITE_ONCE(fs_info->last_root_drop_gen, gen); in btrfs_set_last_root_drop_gen()
916 static inline u64 btrfs_get_last_root_drop_gen(const struct btrfs_fs_info *fs_info) in btrfs_get_last_root_drop_gen() argument
918 return READ_ONCE(fs_info->last_root_drop_gen); in btrfs_get_last_root_drop_gen()
926 const struct btrfs_fs_info *fs_info, u64 csum_bytes) in btrfs_csum_bytes_to_leaves() argument
928 const u64 num_csums = csum_bytes >> fs_info->sectorsize_bits; in btrfs_csum_bytes_to_leaves()
930 return DIV_ROUND_UP_ULL(num_csums, fs_info->csums_per_leaf); in btrfs_csum_bytes_to_leaves()
937 static inline u64 btrfs_calc_insert_metadata_size(const struct btrfs_fs_info *fs_info, in btrfs_calc_insert_metadata_size() argument
940 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items; in btrfs_calc_insert_metadata_size()
947 static inline u64 btrfs_calc_metadata_size(const struct btrfs_fs_info *fs_info, in btrfs_calc_metadata_size() argument
950 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items; in btrfs_calc_metadata_size()
953 #define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \
956 static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info) in btrfs_is_zoned() argument
958 return IS_ENABLED(CONFIG_BLK_DEV_ZONED) && fs_info->zone_size > 0; in btrfs_is_zoned()
964 static inline u32 count_max_extents(const struct btrfs_fs_info *fs_info, u64 size) in count_max_extents() argument
967 if (!fs_info) in count_max_extents()
971 return div_u64(size + fs_info->max_extent_size - 1, fs_info->max_extent_size); in count_max_extents()
974 bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
976 bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info,
978 void btrfs_exclop_start_unlock(struct btrfs_fs_info *fs_info);
979 void btrfs_exclop_finish(struct btrfs_fs_info *fs_info);
980 void btrfs_exclop_balance(struct btrfs_fs_info *fs_info,
986 void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
988 void __btrfs_clear_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
990 void __btrfs_set_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
992 void __btrfs_clear_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
995 #define __btrfs_fs_incompat(fs_info, flags) \ argument
996 (!!(btrfs_super_incompat_flags((fs_info)->super_copy) & (flags)))
998 #define __btrfs_fs_compat_ro(fs_info, flags) \ argument
999 (!!(btrfs_super_compat_ro_flags((fs_info)->super_copy) & (flags)))
1007 #define btrfs_fs_incompat(fs_info, opt) \ argument
1008 __btrfs_fs_incompat((fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
1016 #define btrfs_fs_compat_ro(fs_info, opt) \ argument
1017 __btrfs_fs_compat_ro((fs_info), BTRFS_FEATURE_COMPAT_RO_##opt)
1022 #define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \ argument
1025 static inline int btrfs_fs_closing(const struct btrfs_fs_info *fs_info) in btrfs_fs_closing() argument
1028 if (test_bit(BTRFS_FS_CLOSING_START, &fs_info->flags)) { in btrfs_fs_closing()
1029 if (test_bit(BTRFS_FS_CLOSING_DONE, &fs_info->flags)) in btrfs_fs_closing()
1044 static inline int btrfs_need_cleaner_sleep(const struct btrfs_fs_info *fs_info) in btrfs_need_cleaner_sleep() argument
1046 return test_bit(BTRFS_FS_STATE_RO, &fs_info->fs_state) || in btrfs_need_cleaner_sleep()
1047 btrfs_fs_closing(fs_info); in btrfs_need_cleaner_sleep()
1050 static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info) in btrfs_wake_unfinished_drop() argument
1052 clear_and_wake_up_bit(BTRFS_FS_UNFINISHED_DROPS, &fs_info->flags); in btrfs_wake_unfinished_drop()
1055 #define BTRFS_FS_ERROR(fs_info) (READ_ONCE((fs_info)->fs_error)) argument
1057 #define BTRFS_FS_LOG_CLEANUP_ERROR(fs_info) \ argument
1059 &(fs_info)->fs_state)))
1065 static inline int btrfs_is_testing(const struct btrfs_fs_info *fs_info) in btrfs_is_testing() argument
1067 return test_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state); in btrfs_is_testing()
1076 static inline int btrfs_is_testing(const struct btrfs_fs_info *fs_info) in btrfs_is_testing() argument