UBI: add fsync capability
authorCorentin Chary <corentincj@iksaif.net>
Thu, 5 Feb 2009 21:25:52 +0000 (22:25 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 17 Jul 2009 13:04:19 +0000 (16:04 +0300)
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>
drivers/mtd/ubi/cdev.c

index 07b93c0..0726fe3 100644 (file)
@@ -191,6 +191,16 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
        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,
                             loff_t *offp)
 {
@@ -1078,6 +1088,7 @@ const struct file_operations ubi_vol_cdev_operations = {
        .llseek         = vol_cdev_llseek,
        .read           = vol_cdev_read,
        .write          = vol_cdev_write,
+       .fsync          = vol_cdev_fsync,
        .unlocked_ioctl = vol_cdev_ioctl,
        .compat_ioctl   = vol_cdev_compat_ioctl,
 };