jlaitine opened a new pull request, #8000: URL: https://github.com/apache/nuttx/pull/8000
…alls - Add truncate, mmap and munmap into file_operations and remove them from ioctl definitions. - Move truncate to be common for mountpt_operations and file_operations - Modify all drivers to initialize the operations struct accordingly Signed-off-by: Jukka Laitinen <[email protected]> ## Summary - IOCTLs are ment for communication from userspace application to the drivers. It doesn't make sense for an application to perform a direct IOCTL (such as FIOC_MMAP, FIOC_MUNMAP or FIOC_TRUNCATE). Application should always use posix mmap, munmap and truncate calls instead. - For mmap, munmap and truncate there is a syscall lookup already in place in nuttx - there is no ioctl needed for the userspace-kernel communication - Especially for "unmap", the ioctl doesn't make sense, since file_ioctl is supposed to work on a file pointer. But unmap cannot be done on a file. Even when unmapping a previously mapped "file", unmap can only work on inode, since there may not be an open file, or even a linked inode present. It must be possible to do "munmap" for a mapped file, even if the actual file is closed and/or deleted after mapping. ## Impact Cleanup of the interfaces, doesn't change the current functionality but makes it easier to add new ## Testing Inspected only. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
