[Devel] [PATCH RH8 26/61] ploop: Further convert in process_discard_pios()

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 14 18:56:56 MSK 2021


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