diff options
author | Corentin Chary <corentincj@iksaif.net> | 2009-02-05 16:25:52 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-02-20 06:34:06 -0500 |
commit | 1b24bc3aaba899f4e7f681cbbc3b93cadcf4d770 (patch) | |
tree | 4d577d02b183a8eb2d2707d8d5e9b181f707ce44 /drivers/mtd/ubi | |
parent | d2f8d7ee1a9b4650b4e43325b321801264f7c37a (diff) |
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/ubi')
-rw-r--r-- | drivers/mtd/ubi/cdev.c | 11 |
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) | |||
186 | return new_offset; | 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 | static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, | 199 | static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, |
190 | loff_t *offp) | 200 | loff_t *offp) |
191 | { | 201 | { |
@@ -1073,6 +1083,7 @@ const struct file_operations ubi_vol_cdev_operations = { | |||
1073 | .llseek = vol_cdev_llseek, | 1083 | .llseek = vol_cdev_llseek, |
1074 | .read = vol_cdev_read, | 1084 | .read = vol_cdev_read, |
1075 | .write = vol_cdev_write, | 1085 | .write = vol_cdev_write, |
1086 | .fsync = vol_cdev_fsync, | ||
1076 | .unlocked_ioctl = vol_cdev_ioctl, | 1087 | .unlocked_ioctl = vol_cdev_ioctl, |
1077 | .compat_ioctl = vol_cdev_compat_ioctl, | 1088 | .compat_ioctl = vol_cdev_compat_ioctl, |
1078 | }; | 1089 | }; |