From f04ca25f9d5f1c424d5fc1c6260802548de4b8fb Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Sat, 11 Dec 2021 14:50:23 +0800 Subject: [PATCH] tmpfs: support fsync always successful Signed-off-by: Jiuzhu Dong --- fs/tmpfs/fs_tmpfs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 3610867946..b4a75b817b 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -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 ****************************************************************************/