[Devel] [PATCH RHEL8 COMMIT] ploop: Further convert in process_one_deferred_bio()

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 17 19:04:46 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.30
------>
commit 2cbc044b930eb6a43445ad8079d754ce5fd677b0
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Mon May 17 19:04:46 2021 +0300

    ploop: Further convert in process_one_deferred_bio()
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    dm-ploop: Kill loop
    
    Intermediate patches can't be base for bisect.
    
    In scope of https://jira.sw.ru/browse/PSBM-123654
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 6ce7027f0648..eb0f5405b525 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -377,10 +377,9 @@ static void del_cluster_lk(struct ploop *ploop, struct pio *h)
 
 }
 
-static void maybe_link_submitting_bio(struct ploop *ploop, struct bio *bio,
+static void maybe_link_submitting_bio(struct ploop *ploop, struct pio *h,
 				      unsigned int cluster)
 {
-	struct pio *h = bio_to_endio_hook(bio);
 	unsigned long flags;
 
 	if (!ploop->force_link_inflight_bios)
@@ -1332,8 +1331,8 @@ static void submit_rw_mapped(struct ploop *ploop, loff_t clu_pos, struct pio *pi
 static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 				    struct ploop_index_wb *piwb)
 {
-	sector_t sector = bio->bi_iter.bi_sector;
 	struct pio *pio = bio_to_endio_hook(bio);
+	sector_t sector = pio->bi_iter.bi_sector;
 	unsigned int cluster, dst_cluster;
 	u8 level;
 	bool ret;
@@ -1352,7 +1351,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 	if (postpone_if_required_for_backup(ploop, pio, cluster))
 		goto out;
 
-	if (op_is_discard(bio->bi_opf)) {
+	if (op_is_discard(pio->bi_opf)) {
 		handle_discard_bio(ploop, bio, cluster, dst_cluster);
 		goto out;
 	}
@@ -1360,7 +1359,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 	if (cluster_is_in_top_delta(ploop, cluster)) {
 		/* Already mapped */
 		goto queue;
-	} else if (!op_is_write(bio->bi_opf)) {
+	} else if (!op_is_write(pio->bi_opf)) {
 		/*
 		 * Simple read from secondary delta. May fail.
 		 * (Also handles the case dst_cluster == BAT_ENTRY_NONE).
@@ -1381,7 +1380,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 	if (unlikely(bio_endio_if_all_zeros(pio)))
 		goto out;
 
-	/* Cluster exists nowhere. Allocate it and setup bio as outrunning */
+	/* Cluster exists nowhere. Allocate it and setup pio as outrunning */
 	ret = locate_new_cluster_and_attach_bio(ploop, piwb, cluster,
 						&dst_cluster, pio);
 	if (!ret)
@@ -1392,7 +1391,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 	inc_nr_inflight(ploop, bio);
 	read_unlock_irq(&ploop->bat_rwlock);
 
-	maybe_link_submitting_bio(ploop, bio, cluster);
+	maybe_link_submitting_bio(ploop, pio, cluster);
 
 	submit_rw_mapped(ploop, dst_cluster, pio);
 out:


More information about the Devel mailing list