Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[cascardo/linux.git] / fs / btrfs / super.c
index f267718..c5f8fca 100644 (file)
@@ -755,7 +755,6 @@ static int btrfs_fill_super(struct super_block *sb,
                            void *data, int silent)
 {
        struct inode *inode;
-       struct dentry *root_dentry;
        struct btrfs_fs_info *fs_info = btrfs_sb(sb);
        struct btrfs_key key;
        int err;
@@ -786,15 +785,12 @@ static int btrfs_fill_super(struct super_block *sb,
                goto fail_close;
        }
 
-       root_dentry = d_alloc_root(inode);
-       if (!root_dentry) {
-               iput(inode);
+       sb->s_root = d_make_root(inode);
+       if (!sb->s_root) {
                err = -ENOMEM;
                goto fail_close;
        }
 
-       sb->s_root = root_dentry;
-
        save_mount_options(sb, data);
        cleancache_init_fs(sb);
        sb->s_flags |= MS_ACTIVE;