1 --- a/fs/yaffs2/yaffs_vfs_glue.c
2 +++ b/fs/yaffs2/yaffs_vfs_glue.c
4 #include <linux/init.h>
6 #include <linux/proc_fs.h>
7 -#include <linux/smp_lock.h>
8 +#include <linux/mutex.h>
9 #include <linux/pagemap.h>
10 #include <linux/mtd/mtd.h>
11 #include <linux/interrupt.h>
14 #include <asm/div64.h>
16 +static DEFINE_MUTEX(yaffs_mutex);
18 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
20 #include <linux/statfs.h>
21 @@ -1538,7 +1540,7 @@ static loff_t yaffs_dir_llseek(struct fi
26 + mutex_lock(&yaffs_mutex);
30 @@ -1555,7 +1557,7 @@ static loff_t yaffs_dir_llseek(struct fi
35 + mutex_unlock(&yaffs_mutex);
39 @@ -3087,98 +3089,52 @@ static struct super_block *yaffs_interna
44 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
45 static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data,
48 return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
51 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
52 -static int yaffs_read_super(struct file_system_type *fs,
53 +static struct dentry *yaffs_read_super(struct file_system_type *fs,
54 int flags, const char *dev_name,
55 - void *data, struct vfsmount *mnt)
58 - return get_sb_bdev(fs, flags, dev_name, data,
59 - yaffs_internal_read_super_mtd, mnt);
62 -static struct super_block *yaffs_read_super(struct file_system_type *fs,
63 - int flags, const char *dev_name,
68 - return get_sb_bdev(fs, flags, dev_name, data,
69 + return mount_bdev(fs, flags, dev_name, data,
70 yaffs_internal_read_super_mtd);
74 static struct file_system_type yaffs_fs_type = {
77 - .get_sb = yaffs_read_super,
78 + .mount = yaffs_read_super,
79 .kill_sb = kill_block_super,
80 .fs_flags = FS_REQUIRES_DEV,
83 -static struct super_block *yaffs_read_super(struct super_block *sb, void *data,
86 - return yaffs_internal_read_super(1, sb, data, silent);
89 -static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super,
94 #ifdef CONFIG_YAFFS_YAFFS2
96 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
97 static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data,
100 return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
103 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
104 -static int yaffs2_read_super(struct file_system_type *fs,
105 - int flags, const char *dev_name, void *data,
106 - struct vfsmount *mnt)
107 +static struct dentry *yaffs2_read_super(struct file_system_type *fs,
108 + int flags, const char *dev_name,
111 - return get_sb_bdev(fs, flags, dev_name, data,
112 - yaffs2_internal_read_super_mtd, mnt);
113 + return mount_bdev(fs, flags, dev_name, data,
114 + yaffs_internal_read_super_mtd);
117 -static struct super_block *yaffs2_read_super(struct file_system_type *fs,
118 - int flags, const char *dev_name,
122 - return get_sb_bdev(fs, flags, dev_name, data,
123 - yaffs2_internal_read_super_mtd);
127 static struct file_system_type yaffs2_fs_type = {
128 .owner = THIS_MODULE,
130 - .get_sb = yaffs2_read_super,
131 + .mount = yaffs2_read_super,
132 .kill_sb = kill_block_super,
133 .fs_flags = FS_REQUIRES_DEV,
136 -static struct super_block *yaffs2_read_super(struct super_block *sb,
137 - void *data, int silent)
139 - return yaffs_internal_read_super(2, sb, data, silent);
142 -static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
146 #endif /* CONFIG_YAFFS_YAFFS2 */