[Devel] [PATCH RH8 58/61] ploop: Call ploop_endio() from pio_endio()
Kirill Tkhai
ktkhai at virtuozzo.com
Fri May 14 18:59:47 MSK 2021
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