From: Andrey Zhadchenko <andrey.zhadche...@virtuozzo.com> 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.zhadche...@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 b27769c6c857..63e13c3217b0 100644 --- a/drivers/md/dm-ploop-map.c +++ b/drivers/md/dm-ploop-map.c @@ -854,9 +854,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; @@ -1572,32 +1573,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; @@ -1614,7 +1589,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.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel