From f81ffb51ccf1b7cd6871dcb890175d2112edcbe0 Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Tue, 30 Nov 2021 14:15:03 +0800 Subject: [PATCH] bch/ioctl: support FLUSH cache by cmd: BIOC_FLUSH Signed-off-by: Jiuzhu Dong --- drivers/bch/bchdev_driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index 50e9102bac..7326a81f62 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -422,6 +422,14 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; + case BIOC_FLUSH: + { + /* Flush any dirty pages remaining in the cache */ + + ret = bchlib_flushsector(bch); + } + break; + #ifdef CONFIG_BCH_ENCRYPTION /* This is a request to set the encryption key? */