summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/io_read.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-01-14 15:20:04 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-14 21:02:11 -0400
commit0f856b72286810a1bcf148c92f04d84c36bb4f30 (patch)
treed50c4c3df6b1380bfb517a46069b30285ec1d68e /fs/bcachefs/io_read.h
parentbcachefs: Rename BCH_WRITE flags fer consistency with other x-macros enums (diff)
downloadlinux-0f856b72286810a1bcf148c92f04d84c36bb4f30.tar.gz
linux-0f856b72286810a1bcf148c92f04d84c36bb4f30.zip
bcachefs: rbio_init_fragment()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io_read.h')
-rw-r--r--fs/bcachefs/io_read.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/bcachefs/io_read.h b/fs/bcachefs/io_read.h
index ef5603daf122..11fdf73a38b1 100644
--- a/fs/bcachefs/io_read.h
+++ b/fs/bcachefs/io_read.h
@@ -162,6 +162,20 @@ static inline void bch2_read(struct bch_fs *c, struct bch_read_bio *rbio,
BCH_READ_user_mapped);
}
+
+static inline struct bch_read_bio *rbio_init_fragment(struct bio *bio,
+ struct bch_read_bio *orig)
+{
+ struct bch_read_bio *rbio = to_rbio(bio);
+
+ rbio->_state = 0;
+ rbio->split = true;
+ rbio->parent = orig;
+ rbio->promote = NULL;
+ rbio->opts = orig->opts;
+ return rbio;
+}
+
static inline struct bch_read_bio *rbio_init(struct bio *bio,
struct bch_io_opts opts)
{