From: Charles Manning Date: Tue, 30 Nov 2010 03:01:28 +0000 (+1300) Subject: yaffs: Replace yaffs_dir_llseek with Linux generic llseek X-Git-Tag: linux-mainline-patchset-4~24^2 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=ed8188fb7659cfb65b5adbe154d143190ade0324 yaffs: Replace yaffs_dir_llseek with Linux generic llseek There was not much point in having the yaffs version as it is functionally equivalent to the kernel one. This also gets rid of using BKL in yaffs2. Signed-off-by: Charles Manning --- diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 1d9ca00..2a3695a 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -341,8 +341,6 @@ static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd); static void yaffs_touch_super(struct yaffs_dev *dev); -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin); - static int yaffs_vfs_setattr(struct inode *, struct iattr *); static struct address_space_operations yaffs_file_address_operations = { @@ -456,7 +454,7 @@ static const struct file_operations yaffs_dir_operations = { .read = generic_read_dir, .readdir = yaffs_readdir, .fsync = yaffs_sync_object, - .llseek = yaffs_dir_llseek, + .llseek = generic_file_llseek, }; static const struct super_operations yaffs_super_ops = { @@ -1529,31 +1527,6 @@ static void yaffs_release_space(struct file *f) yaffs_gross_unlock(dev); } -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin) -{ - long long retval; - - lock_kernel(); - - switch (origin) { - case 2: - offset += i_size_read(file->f_path.dentry->d_inode); - break; - case 1: - offset += file->f_pos; - } - retval = -EINVAL; - - if (offset >= 0) { - if (offset != file->f_pos) - file->f_pos = offset; - - retval = offset; - } - unlock_kernel(); - return retval; -} - static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir) { struct yaffs_obj *obj; diff --git a/yaffs_vfs_single.c b/yaffs_vfs_single.c index c5376e9..0e2095f 100644 --- a/yaffs_vfs_single.c +++ b/yaffs_vfs_single.c @@ -185,8 +185,6 @@ static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd); static void yaffs_touch_super(struct yaffs_dev *dev); -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin); - static int yaffs_vfs_setattr(struct inode *, struct iattr *); static struct address_space_operations yaffs_file_address_operations = { @@ -255,7 +253,7 @@ static const struct file_operations yaffs_dir_operations = { .read = generic_read_dir, .readdir = yaffs_readdir, .fsync = yaffs_sync_object, - .llseek = yaffs_dir_llseek, + .llseek = generic_file_llseek, }; static const struct super_operations yaffs_super_ops = { @@ -1126,31 +1124,6 @@ static void yaffs_release_space(struct file *f) yaffs_gross_unlock(dev); } -static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin) -{ - long long retval; - - lock_kernel(); - - switch (origin) { - case 2: - offset += i_size_read(file->f_path.dentry->d_inode); - break; - case 1: - offset += file->f_pos; - } - retval = -EINVAL; - - if (offset >= 0) { - if (offset != file->f_pos) - file->f_pos = offset; - - retval = offset; - } - unlock_kernel(); - return retval; -} - static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir) { struct yaffs_obj *obj;