aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/cdev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-23 12:30:24 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 12:57:49 +0400
commit4a1f2f386b0011782099b4393ee74370916b6aef (patch)
tree3336ee1e0d4a7ab52d08de219ac7eb46ea1031c9 /drivers/mtd/ubi/cdev.c
parent54de90d686eacd4a761f7ce65c54f1eb3a159429 (diff)
ubi/cdev: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/mtd/ubi/cdev.c')
-rw-r--r--drivers/mtd/ubi/cdev.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 4f02848bb2bc..8ca49f2043e4 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -155,7 +155,6 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
{
struct ubi_volume_desc *desc = file->private_data;
struct ubi_volume *vol = desc->vol;
- loff_t new_offset;
if (vol->updating) {
/* Update is in progress, seeking is prohibited */
@@ -163,30 +162,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
return -EBUSY;
}
- switch (origin) {
- case 0: /* SEEK_SET */
- new_offset = offset;
- break;
- case 1: /* SEEK_CUR */
- new_offset = file->f_pos + offset;
- break;
- case 2: /* SEEK_END */
- new_offset = vol->used_bytes + offset;
- break;
- default:
- return -EINVAL;
- }
-
- if (new_offset < 0 || new_offset > vol->used_bytes) {
- ubi_err("bad seek %lld", new_offset);
- return -EINVAL;
- }
-
- dbg_gen("seek volume %d, offset %lld, origin %d, new offset %lld",
- vol->vol_id, offset, origin, new_offset);
-
- file->f_pos = new_offset;
- return new_offset;
+ return fixed_size_llseek(file, offset, origin, vol->used_bytes);
}
static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end,