[Devel] [PATCH RHEL8 COMMIT] dm-qcow2: Move submit_rw_mapped() and map_and_submit_rw() up
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Aug 13 15:26:53 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.vz8.7.6
------>
commit 99be11d198b2cedcebab2b3931c5683fff044a73
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri Aug 13 15:26:53 2021 +0300
dm-qcow2: Move submit_rw_mapped() and map_and_submit_rw() up
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
====================
It's a preparation for https://jira.sw.ru/browse/PSBM-132049
---
drivers/md/dm-qcow2-map.c | 51 +++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index b31d1f770942..b908d979e692 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -1231,6 +1231,31 @@ static void dec_cluster_usage(struct qcow2 *qcow2, struct md_page *r2_md,
spin_unlock_irqrestore(&qcow2->md_pages_lock, flags);
}
+static void submit_rw_mapped(struct qcow2 *qcow2, struct qio *qio)
+{
+ unsigned int rw, nr_segs;
+ struct bio_vec *bvec;
+ struct iov_iter iter;
+ loff_t pos;
+
+ rw = (op_is_write(qio->bi_op) ? WRITE : READ);
+ nr_segs = qio_nr_segs(qio);
+ bvec = __bvec_iter_bvec(qio->bi_io_vec, qio->bi_iter);
+ pos = to_bytes(qio->bi_iter.bi_sector);
+
+ iov_iter_bvec(&iter, rw, bvec, nr_segs, qio->bi_iter.bi_size);
+ iter.iov_offset = qio->bi_iter.bi_bvec_done;
+
+ call_rw_iter(qcow2->file, pos, rw, &iter, qio);
+}
+
+static void map_and_submit_rw(struct qcow2 *qcow2, loff_t clu_pos, struct qio *qio)
+{
+ WARN_ON_ONCE(qio->qcow2 != qcow2);
+ remap_to_clu(qcow2, qio, clu_pos);
+
+ submit_rw_mapped(qcow2, qio);
+}
static void do_md_page_read_complete(int ret, struct qcow2 *qcow2,
struct md_page *md)
@@ -2706,32 +2731,6 @@ static void data_rw_complete(struct qio *qio)
complete_wbd(qcow2, wbd);
}
-static void submit_rw_mapped(struct qcow2 *qcow2, struct qio *qio)
-{
- unsigned int rw, nr_segs;
- struct bio_vec *bvec;
- struct iov_iter iter;
- loff_t pos;
-
- rw = (op_is_write(qio->bi_op) ? WRITE : READ);
- nr_segs = qio_nr_segs(qio);
- bvec = __bvec_iter_bvec(qio->bi_io_vec, qio->bi_iter);
- pos = to_bytes(qio->bi_iter.bi_sector);
-
- iov_iter_bvec(&iter, rw, bvec, nr_segs, qio->bi_iter.bi_size);
- iter.iov_offset = qio->bi_iter.bi_bvec_done;
-
- call_rw_iter(qcow2->file, pos, rw, &iter, qio);
-}
-
-static void map_and_submit_rw(struct qcow2 *qcow2, loff_t clu_pos, struct qio *qio)
-{
- WARN_ON_ONCE(qio->qcow2 != qcow2);
- remap_to_clu(qcow2, qio, clu_pos);
-
- submit_rw_mapped(qcow2, qio);
-}
-
static void perform_rw_mapped(struct qcow2_map *map, struct qio *qio)
{
struct qcow2 *qcow2 = map->qcow2;
More information about the Devel
mailing list