You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/03 12:26:17 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on issue #3839: Supporting BIOC_FLUSH in littlefs_sync_block()
xiaoxiang781216 commented on issue #3839:
URL: https://github.com/apache/incubator-nuttx/issues/3839#issuecomment-853829378
> Hi, we are trying to port littlefs with your vfs layer code (lfs_vfs.c)
>
> `littlefs_sync_block()` in `lfs_vfs.c` makes an MTD_IOCTL call with `cmd = BIOC_FLUSH`
>
> For the case of imxrt1064 board, the ioctl calls are supported in function `imxrt_flexspi_nor_ioctl()`
> This function does not seem to have BIOC_FLUSH support, hence it would return -ENOTTY
>
it's optional to support BIOC_FLUSH in MTD driver, the upper layer will convert ENOTTY to OK:
https://github.com/apache/incubator-nuttx/blob/master/fs/littlefs/lfs_vfs.c#L921-L937
> BIOC_FLUSH is supported in ftl.c with the help of rwbuffer.c
> However, it's IOCTL base is _BIOC
>
> Request you to kindly clarify the following please: -
>
> 1. With MTD_IOCTL, would the control flow reach ftl.c ?
No, the call chain is: ioctl->ftl_ioctl->MTD_IOCTL, not ioctl->MTD_IOCTL->ftl_ioctl.
> 2. Why is a BIOC command used with and MTD_IOCTL call ?
Just to save one MTD_IOCTL number, but it's may better to add MTD_FLUSH, just like BIOC_XIPBASE and MTDIOC_XIPBASE.
> 3. Is the BIOC_FLUSH supported properly or is it intended to return -ENOTTY ?
>
it's designed for the MTD layer which have a cache internally, and it's optional feature as mentioned before.
> Kindly excuse any mistakes in my understanding.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org