tmpfs: support fsync always successful

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-12-11 14:50:23 +08:00 committed by Gustavo Henrique Nihei
parent e2c9f612c9
commit f04ca25f9d

View file

@ -124,6 +124,7 @@ static ssize_t tmpfs_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen);
static off_t tmpfs_seek(FAR struct file *filep, off_t offset, int whence);
static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int tmpfs_sync(FAR struct file *filep);
static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp);
static int tmpfs_fstat(FAR const struct file *filep, FAR struct stat *buf);
static int tmpfs_truncate(FAR struct file *filep, off_t length);
@ -165,7 +166,7 @@ const struct mountpt_operations tmpfs_operations =
tmpfs_seek, /* seek */
tmpfs_ioctl, /* ioctl */
NULL, /* sync */
tmpfs_sync, /* sync */
tmpfs_dup, /* dup */
tmpfs_fstat, /* fstat */
NULL, /* fchstat */
@ -1750,6 +1751,15 @@ static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
return -ENOTTY;
}
/****************************************************************************
* Name: tmpfs_sync
****************************************************************************/
static int tmpfs_sync(FAR struct file *filep)
{
return 0;
}
/****************************************************************************
* Name: tmpfs_dup
****************************************************************************/