[6/8] Partial revert "ploop: Enable native discard support for kaio engine"

Submitted by Kirill Tkhai on May 21, 2019, 10:36 a.m.

Details

Message ID 155843497749.28886.14527670969918838346.stgit@localhost.localdomain
State New
Series "Revert "ploop: Disable ioctl(PLOOP_IOC_BALLOON)""
Headers show

Commit Message

Kirill Tkhai May 21, 2019, 10:36 a.m.
This partially reverts commit 48bff0f3ae926c8463fbb99e99e19c8ae209ca41.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    3 +++
 include/linux/ploop/ploop.h      |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 2ae22179c9c5..32437175dadb 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -271,6 +271,9 @@  ploop1_open(struct ploop_delta * delta)
 	    ((u64)ph->bd_size + ph->l1_off) << 9)
 		delta->flags |= PLOOP_FMT_PREALLOCATED;
 
+	if (delta->io.ops->id != PLOOP_IO_DIRECT)
+		set_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
+
 	return 0;
 
 out_err:
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index 8c7a42e32864..939385e89ac2 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -52,7 +52,7 @@  enum {
 	PLOOP_S_ENOSPC_EVENT,	/* ENOSPC event happened but but was not
 				 * consumed by userspace yet */
 	PLOOP_S_CONGESTED,	/* Too many bios submitted to us */
-	PLOOP_S_NO_FALLOC_DISCARD, /* FIXME: Remove this: Unable to handle discard requests by fallocate */
+	PLOOP_S_NO_FALLOC_DISCARD, /* Unable to handle discard requests by fallocate */
 	PLOOP_S_DISCARD,	/* ploop is ready to handle discard request */
 	PLOOP_S_DISCARD_LOADED,	/* A discard request was handled and
 				   free blocks loaded */