diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-02-20 14:18:44 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:16 -0400 |
commit | 3c5fa33a55ac2a1539c89635c07eee9fc3823bac (patch) | |
tree | 70a897fa396624c0c30755601ee499266b9af379 | |
parent | d16b4a77a5c64fca52ff637c22668b679b47ef22 (diff) | |
download | linux-stable-3c5fa33a55ac2a1539c89635c07eee9fc3823bac.tar.gz linux-stable-3c5fa33a55ac2a1539c89635c07eee9fc3823bac.tar.bz2 linux-stable-3c5fa33a55ac2a1539c89635c07eee9fc3823bac.zip |
bcachefs: force str_hash code to be inlined
the btree trans iterator stuff relies on a dirty horrible hack that uses
a short backtrace to generate tokens, and gcc uninlining these functions
breaks that hack. ugh.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/str_hash.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h index 6f30fbe44eb8..c5bce01bf34c 100644 --- a/fs/bcachefs/str_hash.h +++ b/fs/bcachefs/str_hash.h @@ -125,7 +125,7 @@ struct bch_hash_desc { bool (*cmp_bkey)(struct bkey_s_c, struct bkey_s_c); }; -static inline struct btree_iter * +static __always_inline struct btree_iter * bch2_hash_lookup(struct btree_trans *trans, const struct bch_hash_desc desc, const struct bch_hash_info *info, @@ -159,7 +159,7 @@ bch2_hash_lookup(struct btree_trans *trans, return IS_ERR(k.k) ? ERR_CAST(k.k) : ERR_PTR(-ENOENT); } -static inline struct btree_iter * +static __always_inline struct btree_iter * bch2_hash_hole(struct btree_trans *trans, const struct bch_hash_desc desc, const struct bch_hash_info *info, @@ -185,10 +185,11 @@ bch2_hash_hole(struct btree_trans *trans, return IS_ERR(k.k) ? ERR_CAST(k.k) : ERR_PTR(-ENOSPC); } -static inline int bch2_hash_needs_whiteout(struct btree_trans *trans, - const struct bch_hash_desc desc, - const struct bch_hash_info *info, - struct btree_iter *start) +static __always_inline +int bch2_hash_needs_whiteout(struct btree_trans *trans, + const struct bch_hash_desc desc, + const struct bch_hash_info *info, + struct btree_iter *start) { struct btree_iter *iter; struct bkey_s_c k; @@ -211,10 +212,11 @@ static inline int bch2_hash_needs_whiteout(struct btree_trans *trans, return btree_iter_err(k); } -static inline int __bch2_hash_set(struct btree_trans *trans, - const struct bch_hash_desc desc, - const struct bch_hash_info *info, - u64 inode, struct bkey_i *insert, int flags) +static __always_inline +int __bch2_hash_set(struct btree_trans *trans, + const struct bch_hash_desc desc, + const struct bch_hash_info *info, + u64 inode, struct bkey_i *insert, int flags) { struct btree_iter *iter, *slot = NULL; struct bkey_s_c k; @@ -276,10 +278,11 @@ static inline int bch2_hash_set(const struct bch_hash_desc desc, inode, insert, flags)); } -static inline int bch2_hash_delete_at(struct btree_trans *trans, - const struct bch_hash_desc desc, - const struct bch_hash_info *info, - struct btree_iter *iter) +static __always_inline +int bch2_hash_delete_at(struct btree_trans *trans, + const struct bch_hash_desc desc, + const struct bch_hash_info *info, + struct btree_iter *iter) { struct bkey_i *delete; int ret; @@ -300,10 +303,11 @@ static inline int bch2_hash_delete_at(struct btree_trans *trans, return 0; } -static inline int bch2_hash_delete(struct btree_trans *trans, - const struct bch_hash_desc desc, - const struct bch_hash_info *info, - u64 inode, const void *key) +static __always_inline +int bch2_hash_delete(struct btree_trans *trans, + const struct bch_hash_desc desc, + const struct bch_hash_info *info, + u64 inode, const void *key) { struct btree_iter *iter; |