Merge branch 'for-3.4'
[cascardo/linux.git] / fs / libfs.c
index 5b2dbb3..4a0d1f0 100644 (file)
@@ -3,7 +3,7 @@
  *     Library for filesystems writers.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/mount.h>
@@ -491,11 +491,9 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
        inode->i_op = &simple_dir_inode_operations;
        inode->i_fop = &simple_dir_operations;
        set_nlink(inode, 2);
-       root = d_alloc_root(inode);
-       if (!root) {
-               iput(inode);
+       root = d_make_root(inode);
+       if (!root)
                return -ENOMEM;
-       }
        for (i = 0; !files->name || files->name[0]; i++, files++) {
                if (!files->name)
                        continue;
@@ -536,7 +534,7 @@ int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *c
        spin_lock(&pin_fs_lock);
        if (unlikely(!*mount)) {
                spin_unlock(&pin_fs_lock);
-               mnt = vfs_kern_mount(type, 0, type->name, NULL);
+               mnt = vfs_kern_mount(type, MS_KERNMOUNT, type->name, NULL);
                if (IS_ERR(mnt))
                        return PTR_ERR(mnt);
                spin_lock(&pin_fs_lock);