提交 1b24bc3a 编写于 作者: C Corentin Chary 提交者: Artem Bityutskiy

UBI: add fsync capability

Now, we can call fsync() on an UBI volume.
Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 d2f8d7ee
...@@ -186,6 +186,16 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin) ...@@ -186,6 +186,16 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
return new_offset; return new_offset;
} }
static int vol_cdev_fsync(struct file *file, struct dentry *dentry,
int datasync)
{
struct ubi_volume_desc *desc = file->private_data;
struct ubi_device *ubi = desc->vol->ubi;
return ubi_sync(ubi->ubi_num);
}
static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count,
loff_t *offp) loff_t *offp)
{ {
...@@ -1073,6 +1083,7 @@ const struct file_operations ubi_vol_cdev_operations = { ...@@ -1073,6 +1083,7 @@ const struct file_operations ubi_vol_cdev_operations = {
.llseek = vol_cdev_llseek, .llseek = vol_cdev_llseek,
.read = vol_cdev_read, .read = vol_cdev_read,
.write = vol_cdev_write, .write = vol_cdev_write,
.fsync = vol_cdev_fsync,
.unlocked_ioctl = vol_cdev_ioctl, .unlocked_ioctl = vol_cdev_ioctl,
.compat_ioctl = vol_cdev_compat_ioctl, .compat_ioctl = vol_cdev_compat_ioctl,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册