Revert "writeback: fix WB_SYNC_NONE writeback from umount"
[safe/jmp/linux-2.6] / fs / gfs2 / main.c
index eacd78a..fb2a5f9 100644 (file)
@@ -52,6 +52,22 @@ static void gfs2_init_glock_once(void *foo)
        atomic_set(&gl->gl_ail_count, 0);
 }
 
+static void gfs2_init_gl_aspace_once(void *foo)
+{
+       struct gfs2_glock *gl = foo;
+       struct address_space *mapping = (struct address_space *)(gl + 1);
+
+       gfs2_init_glock_once(gl);
+       memset(mapping, 0, sizeof(*mapping));
+       INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC);
+       spin_lock_init(&mapping->tree_lock);
+       spin_lock_init(&mapping->i_mmap_lock);
+       INIT_LIST_HEAD(&mapping->private_list);
+       spin_lock_init(&mapping->private_lock);
+       INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap);
+       INIT_LIST_HEAD(&mapping->i_mmap_nonlinear);
+}
+
 /**
  * init_gfs2_fs - Register GFS2 as a filesystem
  *
@@ -78,6 +94,14 @@ static int __init init_gfs2_fs(void)
        if (!gfs2_glock_cachep)
                goto fail;
 
+       gfs2_glock_aspace_cachep = kmem_cache_create("gfs2_glock(aspace)",
+                                       sizeof(struct gfs2_glock) +
+                                       sizeof(struct address_space),
+                                       0, 0, gfs2_init_gl_aspace_once);
+
+       if (!gfs2_glock_aspace_cachep)
+               goto fail;
+
        gfs2_inode_cachep = kmem_cache_create("gfs2_inode",
                                              sizeof(struct gfs2_inode),
                                              0,  SLAB_RECLAIM_ACCOUNT|
@@ -114,7 +138,7 @@ static int __init init_gfs2_fs(void)
        if (error)
                goto fail_unregister;
 
-       error = slow_work_register_user();
+       error = slow_work_register_user(THIS_MODULE);
        if (error)
                goto fail_slow;
 
@@ -144,6 +168,9 @@ fail:
        if (gfs2_inode_cachep)
                kmem_cache_destroy(gfs2_inode_cachep);
 
+       if (gfs2_glock_aspace_cachep)
+               kmem_cache_destroy(gfs2_glock_aspace_cachep);
+
        if (gfs2_glock_cachep)
                kmem_cache_destroy(gfs2_glock_cachep);
 
@@ -163,12 +190,13 @@ static void __exit exit_gfs2_fs(void)
        gfs2_unregister_debugfs();
        unregister_filesystem(&gfs2_fs_type);
        unregister_filesystem(&gfs2meta_fs_type);
-       slow_work_unregister_user();
+       slow_work_unregister_user(THIS_MODULE);
 
        kmem_cache_destroy(gfs2_quotad_cachep);
        kmem_cache_destroy(gfs2_rgrpd_cachep);
        kmem_cache_destroy(gfs2_bufdata_cachep);
        kmem_cache_destroy(gfs2_inode_cachep);
+       kmem_cache_destroy(gfs2_glock_aspace_cachep);
        kmem_cache_destroy(gfs2_glock_cachep);
 
        gfs2_sys_uninit();