fs: allocate inode by using alloc_inode_sb()
[sfrench/cifs-2.6.git] / fs / ocfs2 / super.c
index 1286b88b6fa17917e0f76d351621f933e865bf56..477cdf94122e7745a72ccf7af8895f20f2861dfb 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/mount.h>
 #include <linux/seq_file.h>
 #include <linux/quotaops.h>
-#include <linux/cleancache.h>
 #include <linux/signal.h>
 
 #define CREATE_TRACE_POINTS
@@ -549,7 +548,7 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb)
 {
        struct ocfs2_inode_info *oi;
 
-       oi = kmem_cache_alloc(ocfs2_inode_cachep, GFP_NOFS);
+       oi = alloc_inode_sb(sb, ocfs2_inode_cachep, GFP_NOFS);
        if (!oi)
                return NULL;
 
@@ -1106,17 +1105,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
                goto read_super_error;
        }
 
-       root = d_make_root(inode);
-       if (!root) {
-               status = -ENOMEM;
-               mlog_errno(status);
-               goto read_super_error;
-       }
-
-       sb->s_root = root;
-
-       ocfs2_complete_mount_recovery(osb);
-
        osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
                                                &ocfs2_kset->kobj);
        if (!osb->osb_dev_kset) {
@@ -1134,6 +1122,17 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
                goto read_super_error;
        }
 
+       root = d_make_root(inode);
+       if (!root) {
+               status = -ENOMEM;
+               mlog_errno(status);
+               goto read_super_error;
+       }
+
+       sb->s_root = root;
+
+       ocfs2_complete_mount_recovery(osb);
+
        if (ocfs2_mount_local(osb))
                snprintf(nodestr, sizeof(nodestr), "local");
        else
@@ -2283,7 +2282,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
                mlog_errno(status);
                goto bail;
        }
-       cleancache_init_shared_fs(sb);
 
        osb->ocfs2_wq = alloc_ordered_workqueue("ocfs2_wq", WQ_MEM_RECLAIM);
        if (!osb->ocfs2_wq) {