[Devel] [PATCH rh7 7/9] ploop: generalize issue_flush

Maxim Patlasov mpatlasov at virtuozzo.com
Thu Jun 23 22:41:07 PDT 2016


From: Dmitry Monakhov <dmonakhov at openvz.org>

Rebase Dima's patch to rh7-3.10.0-327.18.2.vz7.14.19:

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>
Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 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 6b5702f..557ddba 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2063,6 +2063,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 ee3cd5c..94936c7 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -1818,7 +1818,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 73edc5e..ed550f4 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -957,7 +957,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);



More information about the Devel mailing list