summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-07-09 12:56:43 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:24 -0400
commit06ed855862853dcdd365a12f7cf182961bec61de (patch)
tree12ff39c492ae211a461f86180efb57ab638c1ad9 /fs/bcachefs/io.h
parenta4461c8a7fc33aa663b0b1b2b7144d5890b6887f (diff)
downloadlwn-06ed855862853dcdd365a12f7cf182961bec61de.tar.gz
lwn-06ed855862853dcdd365a12f7cf182961bec61de.zip
bcachefs: Add offset_into_extent param to bch2_read_extent()
With reflink, we'll no longer be able to calculate the offset of the data we want into the extent we're reading from from the extent pos and the iter pos - we'll have to pass it in separately. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.h')
-rw-r--r--fs/bcachefs/io.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/bcachefs/io.h b/fs/bcachefs/io.h
index 61c8b8b3a459..aa437cb05fe7 100644
--- a/fs/bcachefs/io.h
+++ b/fs/bcachefs/io.h
@@ -99,10 +99,6 @@ struct bch_devs_mask;
struct cache_promote_op;
struct extent_ptr_decoded;
-int __bch2_read_extent(struct bch_fs *, struct bch_read_bio *, struct bvec_iter,
- struct bkey_s_c, struct bch_io_failures *, unsigned);
-void bch2_read(struct bch_fs *, struct bch_read_bio *, u64);
-
enum bch_read_flags {
BCH_READ_RETRY_IF_STALE = 1 << 0,
BCH_READ_MAY_PROMOTE = 1 << 1,
@@ -116,14 +112,22 @@ enum bch_read_flags {
BCH_READ_IN_RETRY = 1 << 7,
};
+int __bch2_read_extent(struct bch_fs *, struct bch_read_bio *,
+ struct bvec_iter, struct bkey_s_c, unsigned,
+ struct bch_io_failures *, unsigned);
+
static inline void bch2_read_extent(struct bch_fs *c,
struct bch_read_bio *rbio,
struct bkey_s_c k,
+ unsigned offset_into_extent,
unsigned flags)
{
- __bch2_read_extent(c, rbio, rbio->bio.bi_iter, k, NULL, flags);
+ __bch2_read_extent(c, rbio, rbio->bio.bi_iter, k,
+ offset_into_extent, NULL, flags);
}
+void bch2_read(struct bch_fs *, struct bch_read_bio *, u64);
+
static inline struct bch_read_bio *rbio_init(struct bio *bio,
struct bch_io_opts opts)
{