[Devel] [PATCH RHEL7 COMMIT] Revert "ploop: Remove now unused PLOOP_E_ZERO_INDEX and PLOOP_E_DELTA_ZERO_INDEX branches"
Konstantin Khorenko
khorenko at virtuozzo.com
Tue May 21 17:44:27 MSK 2019
The commit is pushed to "branch-rh7-3.10.0-957.12.2.vz7.96.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.2.vz7.96.1
------>
commit b18aa7aa07230dbb61326b6904538c5d1ac708ec
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue May 21 17:44:25 2019 +0300
Revert "ploop: Remove now unused PLOOP_E_ZERO_INDEX and PLOOP_E_DELTA_ZERO_INDEX branches"
This reverts commit a1a81d3c859c17c056fb333ce94fb64679456b2a.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
=====================
Patchset description:
ploop: Return maintaince mode
This patch set enables it for vstorage.
Also, added file /sys/block/ploopXXX/pstate/native_discard,
which shows, whether we should use maintaince-mode based
discard or not.
https://jira.sw.ru/browse/PSBM-94662
Kirill Tkhai (8):
Revert "ploop: Remove now unused PLOOP_E_ZERO_INDEX and PLOOP_E_DELTA_ZERO_INDEX branches"
Revert "ploop: Remove now unused PLOOP_REQ_RELOC_S branches"
Revert "ploop: Remove now unused PLOOP_REQ_DISCARD branches"
Revert "ploop: Remove now unused PLOOP_REQ_ZERO branches"
Revert "ploop: Remove obsolete ioctls"
Partial revert "ploop: Enable native discard support for kaio engine"
ploop: Return maintaince mode ioctls again
ploop: Show whether device supports native discard
---
drivers/block/ploop/dev.c | 52 +++++++++++++++++++++++++++++++++++++++++++++
include/linux/ploop/ploop.h | 3 +++
2 files changed, 55 insertions(+)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index eb60d37cd9df..9a7c6aa4f2bf 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2296,6 +2296,58 @@ static void ploop_req_state_process(struct ploop_request * preq)
&sbl, cluster_size_in_sec(plo));
break;
}
+ case PLOOP_E_ZERO_INDEX:
+ {
+ preq->eng_state = PLOOP_E_DATA_WBI;
+ top_delta = ploop_top_delta(plo);
+ plo->st.bio_out++;
+ if (whole_block(plo, preq)) {
+ top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
+ &preq->bl, preq->iblock,
+ preq->req_size);
+ } else {
+ struct bio_list sbl;
+ struct bio * b;
+ int i;
+
+ if (!preq->aux_bio)
+ preq->aux_bio = bio_alloc(GFP_NOFS, block_vecs(plo));
+
+ if (!preq->aux_bio ||
+ fill_bio(plo, preq->aux_bio, preq->req_cluster)) {
+ PLOOP_REQ_FAIL_IMMEDIATE(preq, -ENOMEM);
+ break;
+ }
+
+ for (i = 0; i < preq->aux_bio->bi_vcnt; i++)
+ memset(page_address(preq->aux_bio->bi_io_vec[i].bv_page),
+ 0, PAGE_SIZE);
+
+ bio_list_for_each(b, &preq->bl) {
+ bio_bcopy(preq->aux_bio, b, plo);
+ }
+
+ sbl.head = sbl.tail = preq->aux_bio;
+ top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
+ &sbl, preq->iblock, cluster_size_in_sec(plo));
+ }
+ break;
+ }
+ case PLOOP_E_DELTA_ZERO_INDEX:
+ {
+ struct bio_list sbl;
+
+ BUG_ON (preq->aux_bio == NULL);
+
+ preq->eng_state = PLOOP_E_DATA_WBI;
+ sbl.head = sbl.tail = preq->aux_bio;
+ top_delta = ploop_top_delta(plo);
+ plo->st.bio_out++;
+ top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
+ &sbl, preq->iblock,
+ cluster_size_in_sec(plo));
+ break;
+ }
case PLOOP_E_RELOC_DATA_READ:
{
struct bio_list sbl;
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index 0854faef680f..0bf75437ade3 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -518,6 +518,9 @@ enum
PLOOP_E_DATA_WBI, /* Data writeback is in progress and index
* is not updated.
*/
+ PLOOP_E_ZERO_INDEX, /* Zeroing index of free block; original request
+ can use .submit on completion */
+ PLOOP_E_DELTA_ZERO_INDEX,/* the same but for PLOOP_E_DELTA_READ */
PLOOP_E_FSYNC_PENDED, /* INDEX_WB needs io->ops->sync() to proceed */
};
More information about the Devel
mailing list