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

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

    ploop: Further convert in process_discard_pios()
    
    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 f6ce55fa3a0c..89cfd7b82868 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1495,17 +1495,16 @@ static void do_discard_cleanup(struct ploop *ploop)
 static void process_discard_pios(struct ploop *ploop, struct list_head *pios,
 				 struct ploop_index_wb *piwb)
 {
-	struct bio *bio;
-	struct pio *h;
+	struct pio *pio;
 
-	while ((h = pio_list_pop(pios)) != NULL) {
+	while ((pio = pio_list_pop(pios)) != NULL) {
 
-		if (WARN_ON_ONCE(h->action != PLOOP_END_IO_DISCARD_BIO)) {
-			bio = dm_bio_from_per_bio_data(h, sizeof(*h));
-			bio_io_error(bio);
+		if (WARN_ON_ONCE(pio->action != PLOOP_END_IO_DISCARD_BIO)) {
+			pio->bi_status = BLK_STS_IOERR;
+			pio_endio(pio);
 			continue;
 		}
-		process_one_discard_pio(ploop, h, piwb);
+		process_one_discard_pio(ploop, pio, piwb);
 	}
 }
 


More information about the Devel mailing list