[Devel] [PATCH RHEL7 COMMIT] ploop: Zero indexes on discard
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Mar 28 12:37:43 MSK 2019
The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.85.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.85.5
------>
commit 1e44f2e2d0bcb9d5a2100717dbae6f190ed8fc12
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Thu Mar 28 12:37:41 2019 +0300
ploop: Zero indexes on discard
Shitch preq into PLOOP_E_DATA_WBI state
to continue execution after discard's write
is finished.
Zero index in that stage.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
=====================
Patchset description:
ploop: Discard with zeroing of ploop1 indexes support
https://jira.sw.ru/browse/PSBM-92367
https://pmc.acronis.com/browse/VSTOR-19972
Kirill Tkhai (10):
ploop: Export map defines to separate header file
ploop: Make submit_alloc() return int value
ploop: Introduce ploop_submit_alloc() helper
ploop: Prohibit discard ioctls
ploop: Prohibit PLOOP_IOC_UPDATE_INDEX on singular list
ploop: Introduce data_off_in_clusters() helper
ploop: Add .complete_merge method
ploop: Zero indexes on discard
ploop: Fallocate cluster in cached_submit() during hole reuse
ploop: Populate and maintain holes bitmap
---
drivers/block/ploop/dev.c | 5 ++++-
drivers/block/ploop/fmt_ploop1.c | 5 +++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 618d22bf02ec..3ada41f91867 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2461,7 +2461,10 @@ ploop_entry_request(struct ploop_request * preq)
spin_unlock_irq(&plo->lock);
}
preq->iblock = iblk;
- preq->eng_state = PLOOP_E_COMPLETE;
+ if (!(preq->req_rw & REQ_DISCARD))
+ preq->eng_state = PLOOP_E_COMPLETE;
+ else
+ preq->eng_state = PLOOP_E_DATA_WBI;
__TRACE("T %p %u\n", preq, preq->req_cluster);
plo->st.bio_out++;
delta->io.ops->submit(&delta->io, preq, preq->req_rw,
diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 370aa6369a8a..9cfc56296e5e 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -250,6 +250,11 @@ ploop1_allocate(struct ploop_delta * delta, struct ploop_request * preq,
static void
ploop1_allocate_complete(struct ploop_delta * delta, struct ploop_request * preq)
{
+ if ((preq->req_rw & REQ_DISCARD) &&
+ !test_bit(PLOOP_REQ_DISCARD, &preq->state)) {
+ preq->iblock = 0;
+ }
+
ploop_index_update(preq);
}
More information about the Devel
mailing list