| 1 | From cd6657c4bde20886b0805ea9f2cbac7ec25ac2e5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Charles Manning <cdhmanning@gmail.com> |
| 3 | Date: Tue, 30 Nov 2010 16:01:28 +1300 |
| 4 | Subject: [PATCH 1/2] yaffs: Replace yaffs_dir_llseek with Linux generic |
| 5 | llseek |
| 6 | |
| 7 | commit ed8188fb7659cfb65b5adbe154d143190ade0324 upstream. |
| 8 | |
| 9 | There was not much point in having the yaffs version as it is |
| 10 | functionally equivalent to the kernel one. |
| 11 | |
| 12 | This also gets rid of using BKL in yaffs2. |
| 13 | |
| 14 | Signed-off-by: Charles Manning <cdhmanning@gmail.com> |
| 15 | --- |
| 16 | yaffs_vfs.c | 30 +----------------------------- |
| 17 | yaffs_vfs_multi.c | 30 +----------------------------- |
| 18 | 2 files changed, 2 insertions(+), 58 deletions(-) |
| 19 | |
| 20 | --- a/fs/yaffs2/yaffs_vfs_glue.c |
| 21 | +++ b/fs/yaffs2/yaffs_vfs_glue.c |
| 22 | @@ -342,8 +342,6 @@ static int yaffs_follow_link(struct dent |
| 23 | |
| 24 | static void yaffs_touch_super(yaffs_dev_t *dev); |
| 25 | |
| 26 | -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin); |
| 27 | - |
| 28 | static int yaffs_vfs_setattr(struct inode *, struct iattr *); |
| 29 | |
| 30 | |
| 31 | @@ -460,7 +458,7 @@ static const struct file_operations yaff |
| 32 | .read = generic_read_dir, |
| 33 | .readdir = yaffs_readdir, |
| 34 | .fsync = yaffs_sync_object, |
| 35 | - .llseek = yaffs_dir_llseek, |
| 36 | + .llseek = generic_file_llseek, |
| 37 | }; |
| 38 | |
| 39 | static const struct super_operations yaffs_super_ops = { |
| 40 | @@ -1534,32 +1532,6 @@ static void yaffs_release_space(struct f |
| 41 | } |
| 42 | |
| 43 | |
| 44 | -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin) |
| 45 | -{ |
| 46 | - long long retval; |
| 47 | - |
| 48 | - lock_kernel(); |
| 49 | - |
| 50 | - switch (origin){ |
| 51 | - case 2: |
| 52 | - offset += i_size_read(file->f_path.dentry->d_inode); |
| 53 | - break; |
| 54 | - case 1: |
| 55 | - offset += file->f_pos; |
| 56 | - } |
| 57 | - retval = -EINVAL; |
| 58 | - |
| 59 | - if (offset >= 0){ |
| 60 | - if (offset != file->f_pos) |
| 61 | - file->f_pos = offset; |
| 62 | - |
| 63 | - retval = offset; |
| 64 | - } |
| 65 | - unlock_kernel(); |
| 66 | - return retval; |
| 67 | -} |
| 68 | - |
| 69 | - |
| 70 | static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir) |
| 71 | { |
| 72 | yaffs_obj_t *obj; |
| 73 | |