From 06ed855862853dcdd365a12f7cf182961bec61de Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 9 Jul 2019 12:56:43 -0400 Subject: 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 --- fs/bcachefs/io.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fs/bcachefs/io.h') 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) { -- cgit v1.2.3