Use backported upstream patches instead. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34032master
parent
661d1efc80
commit
4baeb543f0
@ -1,147 +0,0 @@ |
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -72,7 +72,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/proc_fs.h>
|
||||
-#include <linux/smp_lock.h>
|
||||
+#include <linux/mutex.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -97,6 +97,8 @@
|
||||
|
||||
#include <asm/div64.h>
|
||||
|
||||
+static DEFINE_MUTEX(yaffs_mutex);
|
||||
+
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
|
||||
#include <linux/statfs.h>
|
||||
@@ -1538,7 +1540,7 @@ static loff_t yaffs_dir_llseek(struct fi
|
||||
{
|
||||
long long retval;
|
||||
|
||||
- lock_kernel();
|
||||
+ mutex_lock(&yaffs_mutex);
|
||||
|
||||
switch (origin){
|
||||
case 2:
|
||||
@@ -1555,7 +1557,7 @@ static loff_t yaffs_dir_llseek(struct fi
|
||||
|
||||
retval = offset;
|
||||
}
|
||||
- unlock_kernel();
|
||||
+ mutex_unlock(&yaffs_mutex);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -3087,98 +3089,52 @@ static struct super_block *yaffs_interna
|
||||
return sb;
|
||||
}
|
||||
|
||||
-
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data,
|
||||
int silent)
|
||||
{
|
||||
return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
-static int yaffs_read_super(struct file_system_type *fs,
|
||||
+static struct dentry *yaffs_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name,
|
||||
- void *data, struct vfsmount *mnt)
|
||||
-{
|
||||
-
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs_internal_read_super_mtd, mnt);
|
||||
-}
|
||||
-#else
|
||||
-static struct super_block *yaffs_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name,
|
||||
- void *data)
|
||||
+ void *data)
|
||||
{
|
||||
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
+ return mount_bdev(fs, flags, dev_name, data,
|
||||
yaffs_internal_read_super_mtd);
|
||||
}
|
||||
-#endif
|
||||
|
||||
static struct file_system_type yaffs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs",
|
||||
- .get_sb = yaffs_read_super,
|
||||
+ .mount = yaffs_read_super,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
-#else
|
||||
-static struct super_block *yaffs_read_super(struct super_block *sb, void *data,
|
||||
- int silent)
|
||||
-{
|
||||
- return yaffs_internal_read_super(1, sb, data, silent);
|
||||
-}
|
||||
-
|
||||
-static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super,
|
||||
- FS_REQUIRES_DEV);
|
||||
-#endif
|
||||
-
|
||||
|
||||
#ifdef CONFIG_YAFFS_YAFFS2
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data,
|
||||
int silent)
|
||||
{
|
||||
return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
-static int yaffs2_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name, void *data,
|
||||
- struct vfsmount *mnt)
|
||||
+static struct dentry *yaffs2_read_super(struct file_system_type *fs,
|
||||
+ int flags, const char *dev_name,
|
||||
+ void *data)
|
||||
{
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs2_internal_read_super_mtd, mnt);
|
||||
+ return mount_bdev(fs, flags, dev_name, data,
|
||||
+ yaffs_internal_read_super_mtd);
|
||||
}
|
||||
-#else
|
||||
-static struct super_block *yaffs2_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name,
|
||||
- void *data)
|
||||
-{
|
||||
-
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs2_internal_read_super_mtd);
|
||||
-}
|
||||
-#endif
|
||||
|
||||
static struct file_system_type yaffs2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs2",
|
||||
- .get_sb = yaffs2_read_super,
|
||||
+ .mount = yaffs2_read_super,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
-#else
|
||||
-static struct super_block *yaffs2_read_super(struct super_block *sb,
|
||||
- void *data, int silent)
|
||||
-{
|
||||
- return yaffs_internal_read_super(2, sb, data, silent);
|
||||
-}
|
||||
-
|
||||
-static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
|
||||
- FS_REQUIRES_DEV);
|
||||
-#endif
|
||||
|
||||
#endif /* CONFIG_YAFFS_YAFFS2 */
|
||||
|
@ -0,0 +1,72 @@ |
||||
From cd6657c4bde20886b0805ea9f2cbac7ec25ac2e5 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Manning <cdhmanning@gmail.com>
|
||||
Date: Tue, 30 Nov 2010 16:01:28 +1300
|
||||
Subject: [PATCH 1/2] yaffs: Replace yaffs_dir_llseek with Linux generic
|
||||
llseek
|
||||
|
||||
commit ed8188fb7659cfb65b5adbe154d143190ade0324 upstream.
|
||||
|
||||
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 <cdhmanning@gmail.com>
|
||||
---
|
||||
yaffs_vfs.c | 30 +-----------------------------
|
||||
yaffs_vfs_multi.c | 30 +-----------------------------
|
||||
2 files changed, 2 insertions(+), 58 deletions(-)
|
||||
|
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -342,8 +342,6 @@ static int yaffs_follow_link(struct dent
|
||||
|
||||
static void yaffs_touch_super(yaffs_dev_t *dev);
|
||||
|
||||
-static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin);
|
||||
-
|
||||
static int yaffs_vfs_setattr(struct inode *, struct iattr *);
|
||||
|
||||
|
||||
@@ -460,7 +458,7 @@ static const struct file_operations yaff
|
||||
.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 = {
|
||||
@@ -1534,32 +1532,6 @@ static void yaffs_release_space(struct f
|
||||
}
|
||||
|
||||
|
||||
-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)
|
||||
{
|
||||
yaffs_obj_t *obj;
|
@ -0,0 +1,110 @@ |
||||
From e1537a700c2e750c5eacc5ad93f30821f1e94424 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Manning <cdhmanning@gmail.com>
|
||||
Date: Mon, 15 Aug 2011 11:40:30 +1200
|
||||
Subject: [PATCH 2/2] Mods for Linux 3.0 and fix a typo
|
||||
|
||||
commit a7b5dcf904ba6f7890e4b77ce1f56388b855d0f6 upstream.
|
||||
|
||||
Roll in NCB's patch and some other changes for Linux 3.0.
|
||||
Also fix a dumb type retired_writes->retried_writes
|
||||
|
||||
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
|
||||
---
|
||||
patch-ker.sh | 2 +-
|
||||
yaffs_vfs_glue.c | 42 ++++++++++++++++++++++++++++++++++--------
|
||||
2 files changed, 35 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -72,7 +72,9 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/proc_fs.h>
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39))
|
||||
#include <linux/smp_lock.h>
|
||||
+#endif
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -236,7 +238,9 @@ static int yaffs_file_flush(struct file
|
||||
static int yaffs_file_flush(struct file *file);
|
||||
#endif
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync);
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
static int yaffs_sync_object(struct file *file, int datasync);
|
||||
#else
|
||||
static int yaffs_sync_object(struct file *file, struct dentry *dentry,
|
||||
@@ -1864,7 +1868,9 @@ static int yaffs_symlink(struct inode *d
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync)
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
static int yaffs_sync_object(struct file *file, int datasync)
|
||||
#else
|
||||
static int yaffs_sync_object(struct file *file, struct dentry *dentry,
|
||||
@@ -3067,7 +3073,13 @@ static int yaffs_internal_read_super_mtd
|
||||
return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static struct dentry *yaffs_mount(struct file_system_type *fs_type, int flags,
|
||||
+ const char *dev_name, void *data)
|
||||
+{
|
||||
+ return mount_bdev(fs_type, flags, dev_name, data, yaffs_internal_read_super_mtd);
|
||||
+}
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
static int yaffs_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
@@ -3090,8 +3102,12 @@ static struct super_block *yaffs_read_su
|
||||
static struct file_system_type yaffs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs",
|
||||
- .get_sb = yaffs_read_super,
|
||||
- .kill_sb = kill_block_super,
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+ .mount = yaffs_mount,
|
||||
+#else
|
||||
+ .get_sb = yaffs_read_super,
|
||||
+#endif
|
||||
+ .kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
#else
|
||||
@@ -3115,7 +3131,13 @@ static int yaffs2_internal_read_super_mt
|
||||
return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static struct dentry *yaffs2_mount(struct file_system_type *fs_type, int flags,
|
||||
+ const char *dev_name, void *data)
|
||||
+{
|
||||
+ return mount_bdev(fs_type, flags, dev_name, data, yaffs2_internal_read_super_mtd);
|
||||
+}
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
static int yaffs2_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
@@ -3137,8 +3159,12 @@ static struct super_block *yaffs2_read_s
|
||||
static struct file_system_type yaffs2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs2",
|
||||
- .get_sb = yaffs2_read_super,
|
||||
- .kill_sb = kill_block_super,
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+ .mount = yaffs2_mount,
|
||||
+#else
|
||||
+ .get_sb = yaffs2_read_super,
|
||||
+#endif
|
||||
+ .kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
#else
|
@ -1,147 +0,0 @@ |
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -72,7 +72,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/proc_fs.h>
|
||||
-#include <linux/smp_lock.h>
|
||||
+#include <linux/mutex.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -97,6 +97,8 @@
|
||||
|
||||
#include <asm/div64.h>
|
||||
|
||||
+static DEFINE_MUTEX(yaffs_mutex);
|
||||
+
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
|
||||
#include <linux/statfs.h>
|
||||
@@ -1538,7 +1540,7 @@ static loff_t yaffs_dir_llseek(struct fi
|
||||
{
|
||||
long long retval;
|
||||
|
||||
- lock_kernel();
|
||||
+ mutex_lock(&yaffs_mutex);
|
||||
|
||||
switch (origin){
|
||||
case 2:
|
||||
@@ -1555,7 +1557,7 @@ static loff_t yaffs_dir_llseek(struct fi
|
||||
|
||||
retval = offset;
|
||||
}
|
||||
- unlock_kernel();
|
||||
+ mutex_unlock(&yaffs_mutex);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -3087,98 +3089,52 @@ static struct super_block *yaffs_interna
|
||||
return sb;
|
||||
}
|
||||
|
||||
-
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data,
|
||||
int silent)
|
||||
{
|
||||
return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
-static int yaffs_read_super(struct file_system_type *fs,
|
||||
+static struct dentry *yaffs_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name,
|
||||
- void *data, struct vfsmount *mnt)
|
||||
-{
|
||||
-
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs_internal_read_super_mtd, mnt);
|
||||
-}
|
||||
-#else
|
||||
-static struct super_block *yaffs_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name,
|
||||
- void *data)
|
||||
+ void *data)
|
||||
{
|
||||
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
+ return mount_bdev(fs, flags, dev_name, data,
|
||||
yaffs_internal_read_super_mtd);
|
||||
}
|
||||
-#endif
|
||||
|
||||
static struct file_system_type yaffs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs",
|
||||
- .get_sb = yaffs_read_super,
|
||||
+ .mount = yaffs_read_super,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
-#else
|
||||
-static struct super_block *yaffs_read_super(struct super_block *sb, void *data,
|
||||
- int silent)
|
||||
-{
|
||||
- return yaffs_internal_read_super(1, sb, data, silent);
|
||||
-}
|
||||
-
|
||||
-static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super,
|
||||
- FS_REQUIRES_DEV);
|
||||
-#endif
|
||||
-
|
||||
|
||||
#ifdef CONFIG_YAFFS_YAFFS2
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
|
||||
static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data,
|
||||
int silent)
|
||||
{
|
||||
return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
-static int yaffs2_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name, void *data,
|
||||
- struct vfsmount *mnt)
|
||||
+static struct dentry *yaffs2_read_super(struct file_system_type *fs,
|
||||
+ int flags, const char *dev_name,
|
||||
+ void *data)
|
||||
{
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs2_internal_read_super_mtd, mnt);
|
||||
+ return mount_bdev(fs, flags, dev_name, data,
|
||||
+ yaffs_internal_read_super_mtd);
|
||||
}
|
||||
-#else
|
||||
-static struct super_block *yaffs2_read_super(struct file_system_type *fs,
|
||||
- int flags, const char *dev_name,
|
||||
- void *data)
|
||||
-{
|
||||
-
|
||||
- return get_sb_bdev(fs, flags, dev_name, data,
|
||||
- yaffs2_internal_read_super_mtd);
|
||||
-}
|
||||
-#endif
|
||||
|
||||
static struct file_system_type yaffs2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs2",
|
||||
- .get_sb = yaffs2_read_super,
|
||||
+ .mount = yaffs2_read_super,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
-#else
|
||||
-static struct super_block *yaffs2_read_super(struct super_block *sb,
|
||||
- void *data, int silent)
|
||||
-{
|
||||
- return yaffs_internal_read_super(2, sb, data, silent);
|
||||
-}
|
||||
-
|
||||
-static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
|
||||
- FS_REQUIRES_DEV);
|
||||
-#endif
|
||||
|
||||
#endif /* CONFIG_YAFFS_YAFFS2 */
|
||||
|
@ -0,0 +1,72 @@ |
||||
From cd6657c4bde20886b0805ea9f2cbac7ec25ac2e5 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Manning <cdhmanning@gmail.com>
|
||||
Date: Tue, 30 Nov 2010 16:01:28 +1300
|
||||
Subject: [PATCH 1/2] yaffs: Replace yaffs_dir_llseek with Linux generic
|
||||
llseek
|
||||
|
||||
commit ed8188fb7659cfb65b5adbe154d143190ade0324 upstream.
|
||||
|
||||
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 <cdhmanning@gmail.com>
|
||||
---
|
||||
yaffs_vfs.c | 30 +-----------------------------
|
||||
yaffs_vfs_multi.c | 30 +-----------------------------
|
||||
2 files changed, 2 insertions(+), 58 deletions(-)
|
||||
|
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -342,8 +342,6 @@ static int yaffs_follow_link(struct dent
|
||||
|
||||
static void yaffs_touch_super(yaffs_dev_t *dev);
|
||||
|
||||
-static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin);
|
||||
-
|
||||
static int yaffs_vfs_setattr(struct inode *, struct iattr *);
|
||||
|
||||
|
||||
@@ -460,7 +458,7 @@ static const struct file_operations yaff
|
||||
.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 = {
|
||||
@@ -1534,32 +1532,6 @@ static void yaffs_release_space(struct f
|
||||
}
|
||||
|
||||
|
||||
-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)
|
||||
{
|
||||
yaffs_obj_t *obj;
|
@ -0,0 +1,110 @@ |
||||
From e1537a700c2e750c5eacc5ad93f30821f1e94424 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Manning <cdhmanning@gmail.com>
|
||||
Date: Mon, 15 Aug 2011 11:40:30 +1200
|
||||
Subject: [PATCH 2/2] Mods for Linux 3.0 and fix a typo
|
||||
|
||||
commit a7b5dcf904ba6f7890e4b77ce1f56388b855d0f6 upstream.
|
||||
|
||||
Roll in NCB's patch and some other changes for Linux 3.0.
|
||||
Also fix a dumb type retired_writes->retried_writes
|
||||
|
||||
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
|
||||
---
|
||||
patch-ker.sh | 2 +-
|
||||
yaffs_vfs_glue.c | 42 ++++++++++++++++++++++++++++++++++--------
|
||||
2 files changed, 35 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/fs/yaffs2/yaffs_vfs_glue.c
|
||||
+++ b/fs/yaffs2/yaffs_vfs_glue.c
|
||||
@@ -72,7 +72,9 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/proc_fs.h>
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39))
|
||||
#include <linux/smp_lock.h>
|
||||
+#endif
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -236,7 +238,9 @@ static int yaffs_file_flush(struct file
|
||||
static int yaffs_file_flush(struct file *file);
|
||||
#endif
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync);
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
static int yaffs_sync_object(struct file *file, int datasync);
|
||||
#else
|
||||
static int yaffs_sync_object(struct file *file, struct dentry *dentry,
|
||||
@@ -1864,7 +1868,9 @@ static int yaffs_symlink(struct inode *d
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync)
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
|
||||
static int yaffs_sync_object(struct file *file, int datasync)
|
||||
#else
|
||||
static int yaffs_sync_object(struct file *file, struct dentry *dentry,
|
||||
@@ -3067,7 +3073,13 @@ static int yaffs_internal_read_super_mtd
|
||||
return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static struct dentry *yaffs_mount(struct file_system_type *fs_type, int flags,
|
||||
+ const char *dev_name, void *data)
|
||||
+{
|
||||
+ return mount_bdev(fs_type, flags, dev_name, data, yaffs_internal_read_super_mtd);
|
||||
+}
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
static int yaffs_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
@@ -3090,8 +3102,12 @@ static struct super_block *yaffs_read_su
|
||||
static struct file_system_type yaffs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs",
|
||||
- .get_sb = yaffs_read_super,
|
||||
- .kill_sb = kill_block_super,
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+ .mount = yaffs_mount,
|
||||
+#else
|
||||
+ .get_sb = yaffs_read_super,
|
||||
+#endif
|
||||
+ .kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
#else
|
||||
@@ -3115,7 +3131,13 @@ static int yaffs2_internal_read_super_mt
|
||||
return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+static struct dentry *yaffs2_mount(struct file_system_type *fs_type, int flags,
|
||||
+ const char *dev_name, void *data)
|
||||
+{
|
||||
+ return mount_bdev(fs_type, flags, dev_name, data, yaffs2_internal_read_super_mtd);
|
||||
+}
|
||||
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
|
||||
static int yaffs2_read_super(struct file_system_type *fs,
|
||||
int flags, const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
@@ -3137,8 +3159,12 @@ static struct super_block *yaffs2_read_s
|
||||
static struct file_system_type yaffs2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "yaffs2",
|
||||
- .get_sb = yaffs2_read_super,
|
||||
- .kill_sb = kill_block_super,
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
+ .mount = yaffs2_mount,
|
||||
+#else
|
||||
+ .get_sb = yaffs2_read_super,
|
||||
+#endif
|
||||
+ .kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
#else
|
Loading…
Reference in new issue