Commit 3c5fa33a authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent d16b4a77
...@@ -125,7 +125,7 @@ struct bch_hash_desc { ...@@ -125,7 +125,7 @@ struct bch_hash_desc {
bool (*cmp_bkey)(struct bkey_s_c, struct bkey_s_c); 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, bch2_hash_lookup(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
...@@ -159,7 +159,7 @@ bch2_hash_lookup(struct btree_trans *trans, ...@@ -159,7 +159,7 @@ bch2_hash_lookup(struct btree_trans *trans,
return IS_ERR(k.k) ? ERR_CAST(k.k) : ERR_PTR(-ENOENT); 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, bch2_hash_hole(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
...@@ -185,7 +185,8 @@ bch2_hash_hole(struct btree_trans *trans, ...@@ -185,7 +185,8 @@ bch2_hash_hole(struct btree_trans *trans,
return IS_ERR(k.k) ? ERR_CAST(k.k) : ERR_PTR(-ENOSPC); return IS_ERR(k.k) ? ERR_CAST(k.k) : ERR_PTR(-ENOSPC);
} }
static inline int bch2_hash_needs_whiteout(struct btree_trans *trans, static __always_inline
int bch2_hash_needs_whiteout(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
struct btree_iter *start) struct btree_iter *start)
...@@ -211,7 +212,8 @@ static inline int bch2_hash_needs_whiteout(struct btree_trans *trans, ...@@ -211,7 +212,8 @@ static inline int bch2_hash_needs_whiteout(struct btree_trans *trans,
return btree_iter_err(k); return btree_iter_err(k);
} }
static inline int __bch2_hash_set(struct btree_trans *trans, static __always_inline
int __bch2_hash_set(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
u64 inode, struct bkey_i *insert, int flags) u64 inode, struct bkey_i *insert, int flags)
...@@ -276,7 +278,8 @@ static inline int bch2_hash_set(const struct bch_hash_desc desc, ...@@ -276,7 +278,8 @@ static inline int bch2_hash_set(const struct bch_hash_desc desc,
inode, insert, flags)); inode, insert, flags));
} }
static inline int bch2_hash_delete_at(struct btree_trans *trans, static __always_inline
int bch2_hash_delete_at(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
struct btree_iter *iter) struct btree_iter *iter)
...@@ -300,7 +303,8 @@ static inline int bch2_hash_delete_at(struct btree_trans *trans, ...@@ -300,7 +303,8 @@ static inline int bch2_hash_delete_at(struct btree_trans *trans,
return 0; return 0;
} }
static inline int bch2_hash_delete(struct btree_trans *trans, static __always_inline
int bch2_hash_delete(struct btree_trans *trans,
const struct bch_hash_desc desc, const struct bch_hash_desc desc,
const struct bch_hash_info *info, const struct bch_hash_info *info,
u64 inode, const void *key) u64 inode, const void *key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment