[Devel] [PATCH VZ9 v3 01/13] dm-ploop: do not flush after metadata writes

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Thu Oct 24 20:23:29 MSK 2024


Flushed should be explicitly called by the writer if he really
wants it.
Drop ploop_md_write_endio() and ploop_md_fsync_endio().

https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index d07ae1a07ead..f2a28026b2b5 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -837,9 +837,10 @@ static void ploop_put_piwb(struct ploop_index_wb *piwb)
 }
 
 /* This handler is called after BAT is updated. */
-static void ploop_bat_write_complete(struct ploop_index_wb *piwb,
+static void ploop_bat_write_complete(struct pio *pio, void *piwb_ptr,
 				     blk_status_t bi_status)
 {
+	struct ploop_index_wb *piwb = piwb_ptr;
 	struct ploop *ploop = piwb->ploop;
 	struct pio *aux_pio;
 	struct ploop_cow *cow;
@@ -1563,32 +1564,6 @@ static int ploop_process_one_deferred_bio(struct ploop *ploop, struct pio *pio)
 	return 0;
 }
 
-static void ploop_md_fsync_endio(struct pio *pio, void *piwb_ptr,
-				 blk_status_t bi_status)
-{
-	struct ploop_index_wb *piwb = piwb_ptr;
-
-	ploop_bat_write_complete(piwb, bi_status);
-}
-
-static void ploop_md_write_endio(struct pio *pio, void *piwb_ptr,
-				 blk_status_t bi_status)
-{
-	struct ploop_index_wb *piwb = piwb_ptr;
-	struct ploop *ploop = piwb->ploop;
-
-	if (bi_status) {
-		ploop_md_fsync_endio(pio, piwb, bi_status);
-	} else {
-		ploop_init_pio(ploop, REQ_OP_FLUSH, pio);
-		pio->endio_cb = ploop_md_fsync_endio;
-		pio->endio_cb_data = piwb;
-
-		pio->queue_list_id = PLOOP_LIST_FLUSH;
-		ploop_dispatch_pios(ploop, pio, NULL);
-	}
-}
-
 void ploop_index_wb_submit(struct ploop *ploop, struct ploop_index_wb *piwb)
 {
 	loff_t pos = (loff_t)piwb->page_id << PAGE_SHIFT;
@@ -1605,7 +1580,7 @@ void ploop_index_wb_submit(struct ploop *ploop, struct ploop_index_wb *piwb)
 	pio->bi_iter.bi_bvec_done = 0;
 	pio->bi_io_vec = bvec;
 	pio->level = ploop_top_level(ploop);
-	pio->endio_cb = ploop_md_write_endio;
+	pio->endio_cb = ploop_bat_write_complete;
 	pio->endio_cb_data = piwb;
 
 	ploop_submit_rw_mapped(ploop, pio);
-- 
2.39.3



More information about the Devel mailing list