aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/super.c')
-rw-r--r--fs/jffs2/super.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 662bba099501..853b8e300084 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -12,7 +12,6 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/list.h> 16#include <linux/list.h>
18#include <linux/fs.h> 17#include <linux/fs.h>
@@ -41,11 +40,18 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb)
41 return &f->vfs_inode; 40 return &f->vfs_inode;
42} 41}
43 42
44static void jffs2_destroy_inode(struct inode *inode) 43static void jffs2_i_callback(struct rcu_head *head)
45{ 44{
45 struct inode *inode = container_of(head, struct inode, i_rcu);
46 INIT_LIST_HEAD(&inode->i_dentry);
46 kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode)); 47 kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode));
47} 48}
48 49
50static void jffs2_destroy_inode(struct inode *inode)
51{
52 call_rcu(&inode->i_rcu, jffs2_i_callback);
53}
54
49static void jffs2_i_init_once(void *foo) 55static void jffs2_i_init_once(void *foo)
50{ 56{
51 struct jffs2_inode_info *f = foo; 57 struct jffs2_inode_info *f = foo;
@@ -146,6 +152,7 @@ static const struct super_operations jffs2_super_operations =
146static int jffs2_fill_super(struct super_block *sb, void *data, int silent) 152static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
147{ 153{
148 struct jffs2_sb_info *c; 154 struct jffs2_sb_info *c;
155 int ret;
149 156
150 D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():" 157 D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():"
151 " New superblock for device %d (\"%s\")\n", 158 " New superblock for device %d (\"%s\")\n",
@@ -175,15 +182,15 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
175#ifdef CONFIG_JFFS2_FS_POSIX_ACL 182#ifdef CONFIG_JFFS2_FS_POSIX_ACL
176 sb->s_flags |= MS_POSIXACL; 183 sb->s_flags |= MS_POSIXACL;
177#endif 184#endif
178 return jffs2_do_fill_super(sb, data, silent); 185 ret = jffs2_do_fill_super(sb, data, silent);
186 return ret;
179} 187}
180 188
181static int jffs2_get_sb(struct file_system_type *fs_type, 189static struct dentry *jffs2_mount(struct file_system_type *fs_type,
182 int flags, const char *dev_name, 190 int flags, const char *dev_name,
183 void *data, struct vfsmount *mnt) 191 void *data)
184{ 192{
185 return get_sb_mtd(fs_type, flags, dev_name, data, jffs2_fill_super, 193 return mount_mtd(fs_type, flags, dev_name, data, jffs2_fill_super);
186 mnt);
187} 194}
188 195
189static void jffs2_put_super (struct super_block *sb) 196static void jffs2_put_super (struct super_block *sb)
@@ -192,8 +199,6 @@ static void jffs2_put_super (struct super_block *sb)
192 199
193 D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n")); 200 D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n"));
194 201
195 lock_kernel();
196
197 if (sb->s_dirt) 202 if (sb->s_dirt)
198 jffs2_write_super(sb); 203 jffs2_write_super(sb);
199 204
@@ -215,8 +220,6 @@ static void jffs2_put_super (struct super_block *sb)
215 if (c->mtd->sync) 220 if (c->mtd->sync)
216 c->mtd->sync(c->mtd); 221 c->mtd->sync(c->mtd);
217 222
218 unlock_kernel();
219
220 D1(printk(KERN_DEBUG "jffs2_put_super returning\n")); 223 D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
221} 224}
222 225
@@ -232,7 +235,7 @@ static void jffs2_kill_sb(struct super_block *sb)
232static struct file_system_type jffs2_fs_type = { 235static struct file_system_type jffs2_fs_type = {
233 .owner = THIS_MODULE, 236 .owner = THIS_MODULE,
234 .name = "jffs2", 237 .name = "jffs2",
235 .get_sb = jffs2_get_sb, 238 .mount = jffs2_mount,
236 .kill_sb = jffs2_kill_sb, 239 .kill_sb = jffs2_kill_sb,
237}; 240};
238 241