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

Kirill Tkhai ktkhai at virtuozzo.com
Tue May 21 13:36:17 MSK 2019


This partially reverts commit 48bff0f3ae926c8463fbb99e99e19c8ae209ca41.

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

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 */



More information about the Devel mailing list