[Devel] [RH7 PATCH 2/6] ploop: generalize issue_flush

Dmitry Monakhov dmonakhov at openvz.org
Thu Jun 23 10:25:54 PDT 2016


Currently io->ops->issue_flush is called only from single place,
but it has potential to generic. Patch does not change actual logic,
but allow to call ->issue_flush from various places

Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 drivers/block/ploop/dev.c       | 1 +
 drivers/block/ploop/io_direct.c | 1 -
 drivers/block/ploop/io_kaio.c   | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index e8b0304..95e3067 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -1989,6 +1989,7 @@ ploop_entry_request(struct ploop_request * preq)
 		if (preq->req_size == 0) {
 			if (preq->req_rw & REQ_FLUSH &&
 			    !test_bit(PLOOP_REQ_FSYNC_DONE, &preq->state)) {
+				preq->eng_state = PLOOP_E_COMPLETE;
 				if (top_io->ops->issue_flush) {
 					top_io->ops->issue_flush(top_io, preq);
 					return;
diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index ec905b4..195d318 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -1836,7 +1836,6 @@ static void dio_issue_flush(struct ploop_io * io, struct ploop_request *preq)
 	bio->bi_private = preq;
 
 	atomic_inc(&preq->io_count);
-	preq->eng_state = PLOOP_E_COMPLETE;
 	ploop_acc_ff_out(io->plo, preq->req_rw | bio->bi_rw);
 	submit_bio(preq->req_rw, bio);
 	ploop_complete_io_request(preq);
diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index de26319..bee2cee 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -951,7 +951,6 @@ static void kaio_issue_flush(struct ploop_io * io, struct ploop_request *preq)
 {
 	struct ploop_delta *delta = container_of(io, struct ploop_delta, io);
 
-	preq->eng_state = PLOOP_E_COMPLETE;
 	preq->req_rw &= ~REQ_FLUSH;
 
 	spin_lock_irq(&io->plo->lock);
-- 
1.8.3.1



More information about the Devel mailing list