summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-08-22 16:07:37 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:25 -0400
commit3fb5ebcdd4b0599ba8d20a322d322f3a1aaea381 (patch)
tree97b68eec2b9dce3c9b6ea6445513a699684ef4a4 /fs/bcachefs/io.h
parent416f6852523d8599713b756b2d2027d2e9f90b3f (diff)
downloadlwn-3fb5ebcdd4b0599ba8d20a322d322f3a1aaea381.tar.gz
lwn-3fb5ebcdd4b0599ba8d20a322d322f3a1aaea381.zip
bcachefs: Inline some fast paths
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.h')
-rw-r--r--fs/bcachefs/io.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/bcachefs/io.h b/fs/bcachefs/io.h
index a768ccc90f1f..c6f5ae717cf3 100644
--- a/fs/bcachefs/io.h
+++ b/fs/bcachefs/io.h
@@ -99,8 +99,17 @@ struct bch_devs_mask;
struct cache_promote_op;
struct extent_ptr_decoded;
-int bch2_read_indirect_extent(struct btree_trans *, struct btree_iter *,
- unsigned *, struct bkey_i *);
+int __bch2_read_indirect_extent(struct btree_trans *, unsigned *,
+ struct bkey_i *);
+
+static inline int bch2_read_indirect_extent(struct btree_trans *trans,
+ unsigned *offset_into_extent,
+ struct bkey_i *k)
+{
+ return k->k.type == KEY_TYPE_reflink_p
+ ? __bch2_read_indirect_extent(trans, offset_into_extent, k)
+ : 0;
+}
enum bch_read_flags {
BCH_READ_RETRY_IF_STALE = 1 << 0,