[Devel] [PATCH RHEL8 COMMIT] ploop: Move create_bvec_from_rq() up

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 2 22:48:00 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.51
------>
commit db014faaa9b17af0b0af96e0ad54509a6d108bb3
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:48:00 2021 +0300

    ploop: Move create_bvec_from_rq() up
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ==========================
    ploop: Split pios in kwork
    
    https://jira.sw.ru/browse/PSBM-131208
    
    Kirill Tkhai (10):
          ploop: Remove debug noinline in create_bvec_from_rq()
          ploop: Manage flush pios in generic way
          ploop: Teach dispatch_pios() work with flush pios
          ploop: Make split_pios_to_list() to add initial pio to the list too
          ploop: Introduce embedded_pio_to_prq()
          ploop: Introduce ploop_prq_valid()
          ploop: Move create_bvec_from_rq() up
          ploop: Split pios from kwork context
          ploop: Add sanity check of passed BAT from disk
          ploop: Reread file size after index update
---
 drivers/md/dm-ploop-map.c | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 94a923fa27b7..7f467db8d6b1 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1536,6 +1536,29 @@ void ploop_index_wb_submit(struct ploop *ploop, struct ploop_index_wb *piwb)
 	submit_rw_mapped(ploop, pio);
 }
 
+static struct bio_vec *create_bvec_from_rq(struct request *rq)
+{
+	struct bio_vec bv, *bvec, *tmp;
+	struct req_iterator rq_iter;
+	unsigned int nr_bvec = 0;
+
+	rq_for_each_bvec(bv, rq, rq_iter)
+		nr_bvec++;
+
+	bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec),
+			     GFP_NOIO);
+	if (!bvec)
+		goto out;
+
+	tmp = bvec;
+	rq_for_each_bvec(bv, rq, rq_iter) {
+		*tmp = bv;
+		tmp++;
+	}
+out:
+	return bvec;
+}
+
 static void process_deferred_pios(struct ploop *ploop, struct list_head *pios)
 {
 	struct pio *pio;
@@ -1692,29 +1715,6 @@ static void init_prq(struct ploop_rq *prq, struct request *rq)
 	prq->bvec = NULL;
 }
 
-static struct bio_vec *create_bvec_from_rq(struct request *rq)
-{
-	struct bio_vec bv, *bvec, *tmp;
-	struct req_iterator rq_iter;
-	unsigned int nr_bvec = 0;
-
-	rq_for_each_bvec(bv, rq, rq_iter)
-		nr_bvec++;
-
-	bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec),
-			     GFP_NOIO);
-	if (!bvec)
-		goto out;
-
-	tmp = bvec;
-	rq_for_each_bvec(bv, rq, rq_iter) {
-		*tmp = bv;
-		tmp++;
-	}
-out:
-	return bvec;
-}
-
 static void submit_pio(struct ploop *ploop, struct pio *pio)
 {
 	struct list_head *queue_list;


More information about the Devel mailing list