[Devel] [PATCH RH8 20/61] ploop: convert inc_nr_inflight()

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


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

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index eb0f5405b525..75bed1721aa0 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -269,11 +269,9 @@ static void inc_nr_inflight_raw(struct ploop *ploop, struct pio *h)
 	}
 }
 
-static void inc_nr_inflight(struct ploop *ploop, struct bio *bio)
+static void inc_nr_inflight(struct ploop *ploop, struct pio *pio)
 {
-	struct pio *h = bio_to_endio_hook(bio);
-
-	inc_nr_inflight_raw(ploop, h);
+	inc_nr_inflight_raw(ploop, pio);
 }
 
 /*
@@ -491,7 +489,7 @@ static void handle_discard_bio(struct ploop *ploop, struct bio *bio,
 	add_cluster_lk(ploop, h, cluster);
 
 	read_lock_irq(&ploop->bat_rwlock);
-	inc_nr_inflight(ploop, bio);
+	inc_nr_inflight(ploop, h);
 	read_unlock_irq(&ploop->bat_rwlock);
 	atomic_inc(&ploop->nr_discard_bios);
 
@@ -1388,7 +1386,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct bio *bio,
 queue:
 	/* To improve: read lock may be avoided */
 	read_lock_irq(&ploop->bat_rwlock);
-	inc_nr_inflight(ploop, bio);
+	inc_nr_inflight(ploop, pio);
 	read_unlock_irq(&ploop->bat_rwlock);
 
 	maybe_link_submitting_bio(ploop, pio, cluster);




More information about the Devel mailing list