mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
drivers/bch: ioctl() - BIOC_FLUSH: Add calling ioctl() of block driver
Passing `BIOC_FLUSH` to block driver to ensure that changes transfers ("flushes") to the block device
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
+14
-11
@@ -420,14 +420,6 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BIOC_FLUSH:
|
|
||||||
{
|
|
||||||
/* Flush any dirty pages remaining in the cache */
|
|
||||||
|
|
||||||
ret = bchlib_flushsector(bch, false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef CONFIG_BCH_ENCRYPTION
|
#ifdef CONFIG_BCH_ENCRYPTION
|
||||||
/* This is a request to set the encryption key? */
|
/* This is a request to set the encryption key? */
|
||||||
|
|
||||||
@@ -439,9 +431,20 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Otherwise, pass the IOCTL command on to the contained block
|
case BIOC_FLUSH:
|
||||||
* driver.
|
{
|
||||||
*/
|
/* Flush any dirty pages remaining in the cache */
|
||||||
|
|
||||||
|
ret = bchlib_flushsector(bch, false);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Go through */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pass the IOCTL command on to the contained block driver. */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user