xiaoxiang781216 commented on code in PR #8000: URL: https://github.com/apache/nuttx/pull/8000#discussion_r1060003952
########## include/nuttx/fs/fs.h: ########## @@ -209,13 +211,19 @@ struct file_operations int (*close)(FAR struct file *filep); ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen); ssize_t (*write)(FAR struct file *filep, FAR const char *buffer, - size_t buflen); + size_t buflen); off_t (*seek)(FAR struct file *filep, off_t offset, int whence); int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg); + int (*truncate)(FAR struct file *filep, off_t length); Review Comment: > I'd prefer doing it in this same. There are many file_operations still which need to be modified, I don't want to spend time doing those many times. > Ok, you can have all patches in one PR like this first: 1. git revert dbc163f 2. Add truncate callback 3. Add mmap/munmap callback After this, you can create a new PR just include the first two patch. Once the new PR get merged, you can simply rebase this first PR. > Can you please be more specific why the truncate should be done separately? Since 1. It isn't related to mmap/munmap directly 2. The change is very simple and can merge quickly > I am in no hurry with truncate, I won't need it anyhow without mmap and munmap. If so, it's fine to keep all in one PR, but it's still good if you can split truncate change from mmap since it's always good that one patch do one thing. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org