summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2009-02-05 22:25:52 +0100
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-02-20 12:34:06 +0100
commit1b24bc3aaba899f4e7f681cbbc3b93cadcf4d770 (patch)
tree4d577d02b183a8eb2d2707d8d5e9b181f707ce44 /drivers/mtd
parentLinux 2.6.29-rc5 (diff)
downloadlinux-1b24bc3aaba899f4e7f681cbbc3b93cadcf4d770.tar.xz
linux-1b24bc3aaba899f4e7f681cbbc3b93cadcf4d770.zip
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/cdev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index e63c8fc3df3a..f8e0f68f2186 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -186,6 +186,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)
{
@@ -1073,6 +1083,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,
};