diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-12 20:29:28 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:55 -0400 |
commit | c8d94403de0534030e43efce5c2f1d6c2d79dcda (patch) | |
tree | d4def5ee28f6bdf73e017ced2b5c0b67f64f9535 /fs/bcachefs/io.h | |
parent | 07bca3bd1e5423b2d6fe8c7085af3e92b31c461f (diff) | |
download | lwn-c8d94403de0534030e43efce5c2f1d6c2d79dcda.tar.gz lwn-c8d94403de0534030e43efce5c2f1d6c2d79dcda.zip |
bcachefs: Consolidate bch2_read_retry and bch2_read()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.h')
-rw-r--r-- | fs/bcachefs/io.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/bcachefs/io.h b/fs/bcachefs/io.h index 8535e1f631be..1c0a444ea325 100644 --- a/fs/bcachefs/io.h +++ b/fs/bcachefs/io.h @@ -156,7 +156,24 @@ static inline void bch2_read_extent(struct btree_trans *trans, offset_into_extent, NULL, flags); } -void bch2_read(struct bch_fs *, struct bch_read_bio *, u64); +void __bch2_read(struct bch_fs *, struct bch_read_bio *, struct bvec_iter, + u64, struct bch_io_failures *, unsigned flags); + +static inline void bch2_read(struct bch_fs *c, struct bch_read_bio *rbio, + u64 inode) +{ + struct bch_io_failures failed = { .nr = 0 }; + + BUG_ON(rbio->_state); + + rbio->c = c; + rbio->start_time = local_clock(); + + __bch2_read(c, rbio, rbio->bio.bi_iter, inode, &failed, + BCH_READ_RETRY_IF_STALE| + BCH_READ_MAY_PROMOTE| + BCH_READ_USER_MAPPED); +} static inline struct bch_read_bio *rbio_init(struct bio *bio, struct bch_io_opts opts) |