UBI: add fsync capability

Now, we can call fsync() on an UBI volume.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

authored by Corentin Chary and committed by Artem Bityutskiy 1b24bc3a d2f8d7ee

+11
+11
drivers/mtd/ubi/cdev.c
··· 186 186 return new_offset; 187 187 } 188 188 189 + static int vol_cdev_fsync(struct file *file, struct dentry *dentry, 190 + int datasync) 191 + { 192 + struct ubi_volume_desc *desc = file->private_data; 193 + struct ubi_device *ubi = desc->vol->ubi; 194 + 195 + return ubi_sync(ubi->ubi_num); 196 + } 197 + 198 + 189 199 static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, 190 200 loff_t *offp) 191 201 { ··· 1083 1073 .llseek = vol_cdev_llseek, 1084 1074 .read = vol_cdev_read, 1085 1075 .write = vol_cdev_write, 1076 + .fsync = vol_cdev_fsync, 1086 1077 .unlocked_ioctl = vol_cdev_ioctl, 1087 1078 .compat_ioctl = vol_cdev_compat_ioctl, 1088 1079 };