convert get_sb_nodev() users
[linux-2.6-block.git] / fs / super.c
index 6f021a171ac61a0577525093ee9f78953f0cf29c..f6a7bf1fff2b79393dfbc700dcb2ae7c7c5f3099 100644 (file)
@@ -870,29 +870,42 @@ void kill_block_super(struct super_block *sb)
 EXPORT_SYMBOL(kill_block_super);
 #endif
 
-int get_sb_nodev(struct file_system_type *fs_type,
+struct dentry *mount_nodev(struct file_system_type *fs_type,
        int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int),
-       struct vfsmount *mnt)
+       int (*fill_super)(struct super_block *, void *, int))
 {
        int error;
        struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
 
        if (IS_ERR(s))
-               return PTR_ERR(s);
+               return ERR_CAST(s);
 
        s->s_flags = flags;
 
        error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
        if (error) {
                deactivate_locked_super(s);
-               return error;
+               return ERR_PTR(error);
        }
        s->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, s);
-       return 0;
+       return dget(s->s_root);
 }
+EXPORT_SYMBOL(mount_nodev);
+
+int get_sb_nodev(struct file_system_type *fs_type,
+       int flags, void *data,
+       int (*fill_super)(struct super_block *, void *, int),
+       struct vfsmount *mnt)
+{
+       struct dentry *root;
 
+       root = mount_nodev(fs_type, flags, data, fill_super);
+       if (IS_ERR(root))
+               return PTR_ERR(root);
+       mnt->mnt_root = root;
+       mnt->mnt_sb = root->d_sb;
+       return 0;
+}
 EXPORT_SYMBOL(get_sb_nodev);
 
 static int compare_single(struct super_block *s, void *p)