[Devel] [PATCH RH8 28/61] ploop: Convert dec_nr_inflight()

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


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index d30c055c2d50..057633854049 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -290,11 +290,9 @@ static void dec_nr_inflight_raw(struct ploop *ploop, struct pio *h)
 	}
 }
 
-static void dec_nr_inflight(struct ploop *ploop, struct bio *bio)
+static void dec_nr_inflight(struct ploop *ploop, struct pio *pio)
 {
-	struct pio *h = bio_to_endio_hook(bio);
-
-	dec_nr_inflight_raw(ploop, h);
+	dec_nr_inflight_raw(ploop, pio);
 }
 
 static void link_endio_hook(struct ploop *ploop, struct pio *new, struct rb_root *root,
@@ -503,7 +501,7 @@ static int ploop_discard_bio_end(struct ploop *ploop, struct bio *bio)
 {
 	struct pio *h = bio_to_endio_hook(bio);
 
-	dec_nr_inflight(ploop, bio);
+	dec_nr_inflight(ploop, h);
 	if (bio->bi_status == BLK_STS_OK)
 		queue_discard_index_wb(ploop, h);
 	else
@@ -863,7 +861,7 @@ static int ploop_data_bio_end(struct bio *bio)
 		bio->bi_status = piwb->bi_status;
 	spin_unlock_irqrestore(&piwb->lock, flags);
 
-	dec_nr_inflight(piwb->ploop, bio);
+	dec_nr_inflight(piwb->ploop, pio);
 
 	if (!completed)
 		return DM_ENDIO_INCOMPLETE;
@@ -1704,7 +1702,7 @@ int ploop_endio(struct dm_target *ti, struct bio *bio, blk_status_t *err)
 
 	if (ret == DM_ENDIO_DONE) {
 		maybe_unlink_completed_bio(ploop, bio);
-		dec_nr_inflight(ploop, bio);
+		dec_nr_inflight(ploop, h);
 	}
 
 	return ret;




More information about the Devel mailing list