[Devel] [PATCH RHEL8 COMMIT] ploop: Call ploop_endio() from pio_endio()

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 17 19:05:06 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 a2f2454d1074ff1d24ad97ff18ed1ca1ded6e731
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Mon May 17 19:05:06 2021 +0300

    ploop: Call ploop_endio() from pio_endio()
    
    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 | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index c08ae454e554..bd2e41e379ac 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -34,7 +34,7 @@
  */
 
 extern void dm_request_set_error(struct request *rq, blk_status_t error);
-static void ploop_endio(struct ploop *ploop, struct pio *pio);
+static void handle_cleanup(struct ploop *ploop, struct pio *pio);
 
 #define DM_MSG_PREFIX "ploop"
 
@@ -135,8 +135,6 @@ static void prq_endio(struct pio *pio, void *prq_ptr, blk_status_t bi_status)
         struct ploop_rq *prq = prq_ptr;
         struct request *rq = prq->rq;
 
-	ploop_endio(pio->ploop, pio);
-
 	if (bi_status)
 		dm_request_set_error(rq, bi_status);
 
@@ -149,6 +147,12 @@ void pio_endio(struct pio *pio)
 {
 	ploop_endio_t endio_cb = pio->endio_cb;
 	void *endio_cb_data = pio->endio_cb_data;
+	struct ploop *ploop = pio->ploop;
+
+	if (pio->ref_index != PLOOP_REF_INDEX_INVALID)
+		track_pio(ploop, pio);
+
+	handle_cleanup(ploop, pio);
 
 	endio_cb(pio, endio_cb_data, pio->bi_status);
 }
@@ -953,7 +957,6 @@ void submit_rw_mapped(struct ploop *ploop, u32 dst_clu, struct pio *pio)
 
 /*
  * Read cluster or its part from secondary delta.
- * @pio is dm's or plain (w/o bio container and ploop_endio()).
  * Note, that nr inflight is not incremented here, so delegate this to caller
  * (if you need).
  */
@@ -1734,16 +1737,8 @@ int ploop_clone_and_map(struct dm_target *ti, struct request *rq,
 	return DM_MAPIO_SUBMITTED;
 }
 
-static void ploop_endio(struct ploop *ploop, struct pio *pio)
+static void handle_cleanup(struct ploop *ploop, struct pio *pio)
 {
-	if (pio->ref_index != PLOOP_REF_INDEX_INVALID) {
-		/*
-		 * This function may be called twice for discard
-		 * and for data bios. Check for ref_index to not
-		 * track @pio twice.
-		 */
-		track_pio(ploop, pio);
-	}
 	/*
 	 * This function is called from the very beginning
 	 * of call_bio_endio().


More information about the Devel mailing list