]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 15:06:25 +0000 (08:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 15:06:25 +0000 (08:06 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (29 commits)
  braino in internal.h
  convert simple cases of nfs-related ->get_sb() to ->mount()
  convert btrfs
  convert ceph
  convert gfs2
  convert afs
  convert ecryptfs
  convert sysfs
  convert cgroup and cpuset
  switch get_sb_ns() users
  switch procfs to ->mount()
  setting ->proc_mnt doesn't belong in proc_get_sb()
  convert cifs
  convert nilfs
  switch logfs to ->mount()
  logfs: fix a leak in get_sb
  logfs get_sb, part 3
  logfs get_sb, part 2
  logfs get_sb massage, part 1
  convert v9fs
  ...

102 files changed:
arch/ia64/kernel/perfmon.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/s390/hypfs/inode.c
drivers/base/devtmpfs.c
drivers/infiniband/hw/ipath/ipath_fs.c
drivers/infiniband/hw/qib/qib_fs.c
drivers/isdn/capi/capifs.c
drivers/misc/ibmasm/ibmasmfs.c
drivers/mtd/mtdchar.c
drivers/mtd/mtdsuper.c
drivers/oprofile/oprofilefs.c
drivers/staging/autofs/init.c
drivers/staging/pohmelfs/inode.c
drivers/staging/smbfs/inode.c
drivers/usb/core/inode.c
drivers/usb/gadget/f_fs.c
drivers/usb/gadget/inode.c
drivers/xen/xenfs/super.c
fs/9p/vfs_super.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/super.c
fs/anon_inodes.c
fs/autofs4/init.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/binfmt_misc.c
fs/block_dev.c
fs/btrfs/super.c
fs/ceph/super.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/configfs/mount.c
fs/cramfs/inode.c
fs/debugfs/inode.c
fs/devpts/inode.c
fs/ecryptfs/main.c
fs/efs/super.c
fs/exofs/super.c
fs/ext2/super.c
fs/ext3/super.c
fs/ext4/super.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/freevxfs/vxfs_super.c
fs/fuse/control.c
fs/fuse/inode.c
fs/gfs2/ops_fstype.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hostfs/hostfs_kern.c
fs/hpfs/super.c
fs/hppfs/hppfs.c
fs/hugetlbfs/inode.c
fs/internal.h
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/super.c
fs/libfs.c
fs/logfs/dev_bdev.c
fs/logfs/dev_mtd.c
fs/logfs/logfs.h
fs/logfs/super.c
fs/minix/inode.c
fs/namei.c
fs/ncpfs/inode.c
fs/nfs/super.c
fs/nfs/unlink.c
fs/nfsd/nfsctl.c
fs/nilfs2/super.c
fs/ntfs/super.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/super.c
fs/omfs/inode.c
fs/open.c
fs/openpromfs/inode.c
fs/pipe.c
fs/proc/root.c
fs/qnx4/inode.c
fs/ramfs/inode.c
fs/reiserfs/super.c
fs/romfs/super.c
fs/squashfs/super.c
fs/super.c
fs/sysfs/mount.c
fs/sysv/super.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/linux-2.6/xfs_super.c
include/linux/fs.h
include/linux/mtd/super.h
include/linux/ramfs.h
ipc/mqueue.c
kernel/cgroup.c
kernel/cpuset.c
mm/shmem.c
net/socket.c
net/sunrpc/rpc_pipe.c
security/inode.c
security/selinux/selinuxfs.c
security/smack/smackfs.c

index 6b1852f7f972b80fcccc06ba0214acc321cd84e5..39e534f5a3b05fc36c46d1e58b0c581c6c307bc5 100644 (file)
@@ -618,16 +618,15 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 }
 
 
-static int
-pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data,
-            struct vfsmount *mnt)
+static struct dentry *
+pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt);
+       return mount_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC);
 }
 
 static struct file_system_type pfm_fs_type = {
        .name     = "pfmfs",
-       .get_sb   = pfmfs_get_sb,
+       .mount    = pfmfs_mount,
        .kill_sb  = kill_anon_super,
 };
 
index 5dec408d670353a9f4651a1b72a244e2a695d381..3532b92de98335d84f1f177721072428dd5c166f 100644 (file)
@@ -798,17 +798,17 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
        return spufs_create_root(sb, data);
 }
 
-static int
-spufs_get_sb(struct file_system_type *fstype, int flags,
-               const char *name, void *data, struct vfsmount *mnt)
+static struct dentry *
+spufs_mount(struct file_system_type *fstype, int flags,
+               const char *name, void *data)
 {
-       return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);
+       return mount_single(fstype, flags, data, spufs_fill_super);
 }
 
 static struct file_system_type spufs_type = {
        .owner = THIS_MODULE,
        .name = "spufs",
-       .get_sb = spufs_get_sb,
+       .mount = spufs_mount,
        .kill_sb = kill_litter_super,
 };
 
index 74d98670be27023241aff6ba8a2b02c35a052e0b..47cc446dab8f1fee4e7305516cca315c8f6baac4 100644 (file)
@@ -316,10 +316,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int hypfs_get_super(struct file_system_type *fst, int flags,
-                       const char *devname, void *data, struct vfsmount *mnt)
+static struct dentry *hypfs_mount(struct file_system_type *fst, int flags,
+                       const char *devname, void *data)
 {
-       return get_sb_single(fst, flags, data, hypfs_fill_super, mnt);
+       return mount_single(fst, flags, data, hypfs_fill_super);
 }
 
 static void hypfs_kill_super(struct super_block *sb)
@@ -455,7 +455,7 @@ static const struct file_operations hypfs_file_ops = {
 static struct file_system_type hypfs_type = {
        .owner          = THIS_MODULE,
        .name           = "s390_hypfs",
-       .get_sb         = hypfs_get_super,
+       .mount          = hypfs_mount,
        .kill_sb        = hypfs_kill_super
 };
 
index af0600143d1c506efb32d3d7f5038cf1af02aa7e..82bbb5967aa99ab94e8c0a64b97ae8a7cf4cd9b9 100644 (file)
 static struct vfsmount *dev_mnt;
 
 #if defined CONFIG_DEVTMPFS_MOUNT
-static int dev_mount = 1;
+static int mount_dev = 1;
 #else
-static int dev_mount;
+static int mount_dev;
 #endif
 
 static DEFINE_MUTEX(dirlock);
 
 static int __init mount_param(char *str)
 {
-       dev_mount = simple_strtoul(str, NULL, 0);
+       mount_dev = simple_strtoul(str, NULL, 0);
        return 1;
 }
 __setup("devtmpfs.mount=", mount_param);
 
-static int dev_get_sb(struct file_system_type *fs_type, int flags,
-                     const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
+                     const char *dev_name, void *data)
 {
 #ifdef CONFIG_TMPFS
-       return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt);
+       return mount_single(fs_type, flags, data, shmem_fill_super);
 #else
-       return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, ramfs_fill_super);
 #endif
 }
 
 static struct file_system_type dev_fs_type = {
        .name = "devtmpfs",
-       .get_sb = dev_get_sb,
+       .mount = dev_mount,
        .kill_sb = kill_litter_super,
 };
 
@@ -351,7 +351,7 @@ int devtmpfs_mount(const char *mntdir)
 {
        int err;
 
-       if (!dev_mount)
+       if (!mount_dev)
                return 0;
 
        if (!dev_mnt)
index 12d5bf76302cc0eff403b5538607350f4e554e42..8c8afc716b984863694f6f15ea0131ae491cde59 100644 (file)
@@ -362,13 +362,13 @@ bail:
        return ret;
 }
 
-static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *data)
 {
-       int ret = get_sb_single(fs_type, flags, data,
-                                   ipathfs_fill_super, mnt);
-       if (ret >= 0)
-               ipath_super = mnt->mnt_sb;
+       struct dentry *ret;
+       ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
+       if (!IS_ERR(ret))
+               ipath_super = ret->d_sb;
        return ret;
 }
 
@@ -411,7 +411,7 @@ bail:
 static struct file_system_type ipathfs_fs_type = {
        .owner =        THIS_MODULE,
        .name =         "ipathfs",
-       .get_sb =       ipathfs_get_sb,
+       .mount =        ipathfs_mount,
        .kill_sb =      ipathfs_kill_super,
 };
 
index 7e433d75c775a963fdedb38612ef734a6211ce79..f99bddc017163e01fec54ae30ac5c121ccc25186 100644 (file)
@@ -555,13 +555,13 @@ bail:
        return ret;
 }
 
-static int qibfs_get_sb(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
+                       const char *dev_name, void *data)
 {
-       int ret = get_sb_single(fs_type, flags, data,
-                               qibfs_fill_super, mnt);
-       if (ret >= 0)
-               qib_super = mnt->mnt_sb;
+       struct dentry *ret;
+       ret = mount_single(fs_type, flags, data, qibfs_fill_super);
+       if (!IS_ERR(ret))
+               qib_super = ret->d_sb;
        return ret;
 }
 
@@ -603,7 +603,7 @@ int qibfs_remove(struct qib_devdata *dd)
 static struct file_system_type qibfs_fs_type = {
        .owner =        THIS_MODULE,
        .name =         "ipathfs",
-       .get_sb =       qibfs_get_sb,
+       .mount =        qibfs_mount,
        .kill_sb =      qibfs_kill_super,
 };
 
index 2b83850997c3903df974e6088b81854e9d5c1ebb..b4faed7fe0d338dffd6e57aaf4256cf859af5e10 100644 (file)
@@ -125,16 +125,16 @@ fail:
        return -ENOMEM;
 }
 
-static int capifs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *capifs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, capifs_fill_super);
 }
 
 static struct file_system_type capifs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "capifs",
-       .get_sb         = capifs_get_sb,
+       .mount          = capifs_mount,
        .kill_sb        = kill_anon_super,
 };
 
index 0a53500636c9d3f4c4d1f886d386f1b1b675f95d..d2d5d23416dda28bf6719649f0c1a84ff1ffcf8a 100644 (file)
@@ -91,11 +91,10 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root);
 static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
 
 
-static int ibmasmfs_get_super(struct file_system_type *fst,
-                       int flags, const char *name, void *data,
-                       struct vfsmount *mnt)
+static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
+                       int flags, const char *name, void *data)
 {
-       return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);
+       return mount_single(fst, flags, data, ibmasmfs_fill_super);
 }
 
 static const struct super_operations ibmasmfs_s_ops = {
@@ -108,7 +107,7 @@ static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
 static struct file_system_type ibmasmfs_type = {
        .owner          = THIS_MODULE,
        .name           = "ibmasmfs",
-       .get_sb         = ibmasmfs_get_super,
+       .mount          = ibmasmfs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 5ef45487b65f01c261222b35d5fd6ecc548bea7e..a34a0fe148841dc83007517e9adec2cca57bd25b 100644 (file)
@@ -1030,17 +1030,15 @@ static const struct file_operations mtd_fops = {
 #endif
 };
 
-static int mtd_inodefs_get_sb(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *data,
-                               struct vfsmount *mnt)
+static struct dentry *mtd_inodefs_mount(struct file_system_type *fs_type,
+                               int flags, const char *dev_name, void *data)
 {
-        return get_sb_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC,
-                             mnt);
+        return mount_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC);
 }
 
 static struct file_system_type mtd_inodefs_type = {
        .name = "mtd_inodefs",
-       .get_sb = mtd_inodefs_get_sb,
+       .mount = mtd_inodefs_mount,
        .kill_sb = kill_anon_super,
 };
 
index 38e2ab07e7a3fc771f40d7a4448b52906d88c0d6..16b02a1fc100ce542bfdaad9bb6fdbf7f8b433fe 100644 (file)
@@ -54,11 +54,10 @@ static int get_sb_mtd_set(struct super_block *sb, void *_mtd)
 /*
  * get a superblock on an MTD-backed filesystem
  */
-static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
+static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
                          const char *dev_name, void *data,
                          struct mtd_info *mtd,
-                         int (*fill_super)(struct super_block *, void *, int),
-                         struct vfsmount *mnt)
+                         int (*fill_super)(struct super_block *, void *, int))
 {
        struct super_block *sb;
        int ret;
@@ -79,57 +78,49 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
        ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
        if (ret < 0) {
                deactivate_locked_super(sb);
-               return ret;
+               return ERR_PTR(ret);
        }
 
        /* go */
        sb->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, sb);
-
-       return 0;
+       return dget(sb->s_root);
 
        /* new mountpoint for an already mounted superblock */
 already_mounted:
        DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n",
              mtd->index, mtd->name);
-       simple_set_mnt(mnt, sb);
-       ret = 0;
-       goto out_put;
+       put_mtd_device(mtd);
+       return dget(sb->s_root);
 
 out_error:
-       ret = PTR_ERR(sb);
-out_put:
        put_mtd_device(mtd);
-       return ret;
+       return ERR_CAST(sb);
 }
 
 /*
  * get a superblock on an MTD-backed filesystem by MTD device number
  */
-static int get_sb_mtd_nr(struct file_system_type *fs_type, int flags,
+static struct dentry *mount_mtd_nr(struct file_system_type *fs_type, int flags,
                         const char *dev_name, void *data, int mtdnr,
-                        int (*fill_super)(struct super_block *, void *, int),
-                        struct vfsmount *mnt)
+                        int (*fill_super)(struct super_block *, void *, int))
 {
        struct mtd_info *mtd;
 
        mtd = get_mtd_device(NULL, mtdnr);
        if (IS_ERR(mtd)) {
                DEBUG(0, "MTDSB: Device #%u doesn't appear to exist\n", mtdnr);
-               return PTR_ERR(mtd);
+               return ERR_CAST(mtd);
        }
 
-       return get_sb_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super,
-                             mnt);
+       return mount_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super);
 }
 
 /*
  * set up an MTD-based superblock
  */
-int get_sb_mtd(struct file_system_type *fs_type, int flags,
+struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
               const char *dev_name, void *data,
-              int (*fill_super)(struct super_block *, void *, int),
-              struct vfsmount *mnt)
+              int (*fill_super)(struct super_block *, void *, int))
 {
 #ifdef CONFIG_BLOCK
        struct block_device *bdev;
@@ -138,7 +129,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
        int mtdnr;
 
        if (!dev_name)
-               return -EINVAL;
+               return ERR_PTR(-EINVAL);
 
        DEBUG(2, "MTDSB: dev_name \"%s\"\n", dev_name);
 
@@ -156,10 +147,10 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
 
                        mtd = get_mtd_device_nm(dev_name + 4);
                        if (!IS_ERR(mtd))
-                               return get_sb_mtd_aux(
+                               return mount_mtd_aux(
                                        fs_type, flags,
                                        dev_name, data, mtd,
-                                       fill_super, mnt);
+                                       fill_super);
 
                        printk(KERN_NOTICE "MTD:"
                               " MTD device with name \"%s\" not found.\n",
@@ -174,9 +165,9 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
                                /* It was a valid number */
                                DEBUG(1, "MTDSB: mtd%%d, mtdnr %d\n",
                                      mtdnr);
-                               return get_sb_mtd_nr(fs_type, flags,
+                               return mount_mtd_nr(fs_type, flags,
                                                     dev_name, data,
-                                                    mtdnr, fill_super, mnt);
+                                                    mtdnr, fill_super);
                        }
                }
        }
@@ -189,7 +180,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
        if (IS_ERR(bdev)) {
                ret = PTR_ERR(bdev);
                DEBUG(1, "MTDSB: lookup_bdev() returned %d\n", ret);
-               return ret;
+               return ERR_PTR(ret);
        }
        DEBUG(1, "MTDSB: lookup_bdev() returned 0\n");
 
@@ -202,8 +193,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
        if (major != MTD_BLOCK_MAJOR)
                goto not_an_MTD_device;
 
-       return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super,
-                            mnt);
+       return mount_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super);
 
 not_an_MTD_device:
 #endif /* CONFIG_BLOCK */
@@ -212,10 +202,10 @@ not_an_MTD_device:
                printk(KERN_NOTICE
                       "MTD: Attempt to mount non-MTD device \"%s\"\n",
                       dev_name);
-       return -EINVAL;
+       return ERR_PTR(-EINVAL);
 }
 
-EXPORT_SYMBOL_GPL(get_sb_mtd);
+EXPORT_SYMBOL_GPL(mount_mtd);
 
 /*
  * destroy an MTD-based superblock
index 449de59bf35bb8a255d73b1a77eff0d040f953be..e9ff6f7770be23a046cd5ce22b8fd504794b3907 100644 (file)
@@ -259,17 +259,17 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 
-static int oprofilefs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *oprofilefs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, oprofilefs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, oprofilefs_fill_super);
 }
 
 
 static struct file_system_type oprofilefs_type = {
        .owner          = THIS_MODULE,
        .name           = "oprofilefs",
-       .get_sb         = oprofilefs_get_sb,
+       .mount          = oprofilefs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 765c72f42976ef9d30440d59814b568cb4fd5c1f..5e4b372ea663169f9680d3c20eecf40ad0d4c54b 100644 (file)
 #include <linux/init.h>
 #include "autofs_i.h"
 
-static int autofs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *autofs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, autofs_fill_super);
 }
 
 static struct file_system_type autofs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "autofs",
-       .get_sb         = autofs_get_sb,
+       .mount          = autofs_mount,
        .kill_sb        = autofs_kill_sb,
 };
 
index c62d30017c07257bb7ac073a465f3e1adfa148ce..61685ccceda88c474bfaa97337d8e34eceeed1cb 100644 (file)
@@ -1937,11 +1937,10 @@ err_out_exit:
 /*
  * Some VFS magic here...
  */
-static int pohmelfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *pohmelfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, pohmelfs_fill_super,
-                               mnt);
+       return mount_nodev(fs_type, flags, data, pohmelfs_fill_super);
 }
 
 /*
@@ -1958,7 +1957,7 @@ static void pohmelfs_kill_super(struct super_block *sb)
 static struct file_system_type pohmel_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "pohmel",
-       .get_sb         = pohmelfs_get_sb,
+       .mount          = pohmelfs_mount,
        .kill_sb        = pohmelfs_kill_super,
 };
 
index 552951aa749834ebc9d61baa4368d066e9f858ef..f9c493591ce75f151ead6fbbeed379cb5a8a1290 100644 (file)
@@ -793,16 +793,16 @@ out:
        return error;
 }
 
-static int smb_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *smb_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, smb_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, smb_fill_super);
 }
 
 static struct file_system_type smb_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "smbfs",
-       .get_sb         = smb_get_sb,
+       .mount          = smb_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = FS_BINARY_MOUNTDATA,
 };
index e2f63c0ea09df16286ea8c4ad04a743ff3d0a9b5..9819a4cc3b264d48111a08a8d51e242b0b1329d8 100644 (file)
@@ -574,16 +574,16 @@ static void fs_remove_file (struct dentry *dentry)
 
 /* --------------------------------------------------------------------- */
 
-static int usb_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *usb_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, usbfs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, usbfs_fill_super);
 }
 
 static struct file_system_type usb_fs_type = {
        .owner =        THIS_MODULE,
        .name =         "usbfs",
-       .get_sb =       usb_get_sb,
+       .mount =        usb_mount,
        .kill_sb =      kill_litter_super,
 };
 
index f276e9594f00eab91ff7f789b58e80e7a95a8bcc..4a830df4fc31a1a58692f6b1b5adc29a7a9895c4 100644 (file)
@@ -1176,9 +1176,9 @@ invalid:
 
 /* "mount -t functionfs dev_name /dev/function" ends up here */
 
-static int
-ffs_fs_get_sb(struct file_system_type *t, int flags,
-             const char *dev_name, void *opts, struct vfsmount *mnt)
+static struct dentry *
+ffs_fs_mount(struct file_system_type *t, int flags,
+             const char *dev_name, void *opts)
 {
        struct ffs_sb_fill_data data = {
                .perms = {
@@ -1194,14 +1194,14 @@ ffs_fs_get_sb(struct file_system_type *t, int flags,
 
        ret = functionfs_check_dev_callback(dev_name);
        if (unlikely(ret < 0))
-               return ret;
+               return ERR_PTR(ret);
 
        ret = ffs_fs_parse_opts(&data, opts);
        if (unlikely(ret < 0))
-               return ret;
+               return ERR_PTR(ret);
 
        data.dev_name = dev_name;
-       return get_sb_single(t, flags, &data, ffs_sb_fill, mnt);
+       return mount_single(t, flags, &data, ffs_sb_fill);
 }
 
 static void
@@ -1220,7 +1220,7 @@ ffs_fs_kill_sb(struct super_block *sb)
 static struct file_system_type ffs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "functionfs",
-       .get_sb         = ffs_fs_get_sb,
+       .mount          = ffs_fs_mount,
        .kill_sb        = ffs_fs_kill_sb,
 };
 
index ba145e7fbe03ef27fcd37598dc46a9f1fb31eb27..3ed73f49cf188cd98b92cc3e847a6e40f0062efb 100644 (file)
@@ -2097,11 +2097,11 @@ enomem0:
 }
 
 /* "mount -t gadgetfs path /dev/gadget" ends up here */
-static int
-gadgetfs_get_sb (struct file_system_type *t, int flags,
-               const char *path, void *opts, struct vfsmount *mnt)
+static struct dentry *
+gadgetfs_mount (struct file_system_type *t, int flags,
+               const char *path, void *opts)
 {
-       return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt);
+       return mount_single (t, flags, opts, gadgetfs_fill_super);
 }
 
 static void
@@ -2119,7 +2119,7 @@ gadgetfs_kill_sb (struct super_block *sb)
 static struct file_system_type gadgetfs_type = {
        .owner          = THIS_MODULE,
        .name           = shortname,
-       .get_sb         = gadgetfs_get_sb,
+       .mount          = gadgetfs_mount,
        .kill_sb        = gadgetfs_kill_sb,
 };
 
index d6662b789b6bf05a3cc172623216ea662e681781..f6339d11d59cbdebc8d558f552cc199175003e05 100644 (file)
@@ -121,17 +121,17 @@ static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
        return rc;
 }
 
-static int xenfs_get_sb(struct file_system_type *fs_type,
+static int xenfs_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data, struct vfsmount *mnt)
+                       void *data)
 {
-       return get_sb_single(fs_type, flags, data, xenfs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, xenfs_fill_super);
 }
 
 static struct file_system_type xenfs_type = {
        .owner =        THIS_MODULE,
        .name =         "xenfs",
-       .get_sb =       xenfs_get_sb,
+       .mount =        xenfs_mount,
        .kill_sb =      kill_litter_super,
 };
 
index 48d4215c60a8924df5dbb35706a28f84ac9ea5eb..c55c614500ad4e4e74561264e9766fe65b0633a3 100644 (file)
@@ -68,7 +68,7 @@ static int v9fs_set_super(struct super_block *s, void *data)
  * v9fs_fill_super - populate superblock with info
  * @sb: superblock
  * @v9ses: session information
- * @flags: flags propagated from v9fs_get_sb()
+ * @flags: flags propagated from v9fs_mount()
  *
  */
 
@@ -99,18 +99,16 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
 }
 
 /**
- * v9fs_get_sb - mount a superblock
+ * v9fs_mount - mount a superblock
  * @fs_type: file system type
  * @flags: mount flags
  * @dev_name: device name that was mounted
  * @data: mount options
- * @mnt: mountpoint record to be instantiated
  *
  */
 
-static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data,
-                      struct vfsmount *mnt)
+static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
+                      const char *dev_name, void *data)
 {
        struct super_block *sb = NULL;
        struct inode *inode = NULL;
@@ -124,7 +122,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
 
        v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
        if (!v9ses)
-               return -ENOMEM;
+               return ERR_PTR(-ENOMEM);
 
        fid = v9fs_session_init(v9ses, dev_name, data);
        if (IS_ERR(fid)) {
@@ -186,15 +184,15 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
        v9fs_fid_add(root, fid);
 
        P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 
 clunk_fid:
        p9_client_clunk(fid);
 close_session:
        v9fs_session_close(v9ses);
        kfree(v9ses);
-       return retval;
+       return ERR_PTR(retval);
+
 release_sb:
        /*
         * we will do the session_close and root dentry release
@@ -204,7 +202,7 @@ release_sb:
         */
        p9_client_clunk(fid);
        deactivate_locked_super(sb);
-       return retval;
+       return ERR_PTR(retval);
 }
 
 /**
@@ -300,7 +298,7 @@ static const struct super_operations v9fs_super_ops_dotl = {
 
 struct file_system_type v9fs_fs_type = {
        .name = "9p",
-       .get_sb = v9fs_get_sb,
+       .mount = v9fs_mount,
        .kill_sb = v9fs_kill_super,
        .owner = THIS_MODULE,
        .fs_flags = FS_RENAME_DOES_D_MOVE,
index d9803f73236f543fca9764cbe453414f6fe22286..959dbff2d42dc4a0a0026e3b3aad5f7f0008a7f3 100644 (file)
@@ -490,17 +490,16 @@ error:
        return -EINVAL;
 }
 
-static int adfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *adfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
 }
 
 static struct file_system_type adfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "adfs",
-       .get_sb         = adfs_get_sb,
+       .mount          = adfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index fa4fbe1e238a344bbe35207e635461f07ac81691..0cf7f4384cbd472b46f3c50f1812cb84b4ab6f91 100644 (file)
@@ -573,17 +573,16 @@ affs_statfs(struct dentry *dentry, struct kstatfs *buf)
        return 0;
 }
 
-static int affs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *affs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super);
 }
 
 static struct file_system_type affs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "affs",
-       .get_sb         = affs_get_sb,
+       .mount          = affs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index eacf76d98ae02345d00d62f22f5ab4893a0452e6..27201cffece4946879f01482f7aa61ffdbc6b339 100644 (file)
@@ -29,9 +29,8 @@
 #define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
 
 static void afs_i_init_once(void *foo);
-static int afs_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name,
-                     void *data, struct vfsmount *mnt);
+static struct dentry *afs_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data);
 static struct inode *afs_alloc_inode(struct super_block *sb);
 static void afs_put_super(struct super_block *sb);
 static void afs_destroy_inode(struct inode *inode);
@@ -40,7 +39,7 @@ static int afs_statfs(struct dentry *dentry, struct kstatfs *buf);
 struct file_system_type afs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "afs",
-       .get_sb         = afs_get_sb,
+       .mount          = afs_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = 0,
 };
@@ -359,11 +358,8 @@ error:
 /*
  * get an AFS superblock
  */
-static int afs_get_sb(struct file_system_type *fs_type,
-                     int flags,
-                     const char *dev_name,
-                     void *options,
-                     struct vfsmount *mnt)
+static struct dentry *afs_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *options)
 {
        struct afs_mount_params params;
        struct super_block *sb;
@@ -427,12 +423,11 @@ static int afs_get_sb(struct file_system_type *fs_type,
                ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
        }
 
-       simple_set_mnt(mnt, sb);
        afs_put_volume(params.volume);
        afs_put_cell(params.cell);
        kfree(new_opts);
        _leave(" = 0 [%p]", sb);
-       return 0;
+       return dget(sb->s_root);
 
 error:
        afs_put_volume(params.volume);
@@ -440,7 +435,7 @@ error:
        key_put(params.key);
        kfree(new_opts);
        _leave(" = %d", ret);
-       return ret;
+       return ERR_PTR(ret);
 }
 
 /*
index 5365527ca43fec37cdc021afbc21acf76c321889..57ce55b2564cf38159638fa146c2b653c5fc66a6 100644 (file)
@@ -26,12 +26,10 @@ static struct vfsmount *anon_inode_mnt __read_mostly;
 static struct inode *anon_inode_inode;
 static const struct file_operations anon_inode_fops;
 
-static int anon_inodefs_get_sb(struct file_system_type *fs_type, int flags,
-                              const char *dev_name, void *data,
-                              struct vfsmount *mnt)
+static struct dentry *anon_inodefs_mount(struct file_system_type *fs_type,
+                               int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "anon_inode:", NULL, ANON_INODE_FS_MAGIC,
-                            mnt);
+       return mount_pseudo(fs_type, "anon_inode:", NULL, ANON_INODE_FS_MAGIC);
 }
 
 /*
@@ -45,7 +43,7 @@ static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen)
 
 static struct file_system_type anon_inode_fs_type = {
        .name           = "anon_inodefs",
-       .get_sb         = anon_inodefs_get_sb,
+       .mount          = anon_inodefs_mount,
        .kill_sb        = kill_anon_super,
 };
 static const struct dentry_operations anon_inodefs_dentry_operations = {
index 9722e4bd895725f42361b86d74355c3c4656bfbe..c038727b405031fb91052c7af314d62508c3a5bd 100644 (file)
 #include <linux/init.h>
 #include "autofs_i.h"
 
-static int autofs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *autofs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, autofs4_fill_super);
 }
 
 static struct file_system_type autofs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "autofs",
-       .get_sb         = autofs_get_sb,
+       .mount          = autofs_mount,
        .kill_sb        = autofs4_kill_sb,
 };
 
index dc39d282488514418a7bedeeaf01fc1560ffb0cb..aa4e7c7ae3c657e9c4b11efb77cbd46982fa3389 100644 (file)
@@ -913,18 +913,17 @@ befs_statfs(struct dentry *dentry, struct kstatfs *buf)
        return 0;
 }
 
-static int
-befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
-           void *data, struct vfsmount *mnt)
+static struct dentry *
+befs_mount(struct file_system_type *fs_type, int flags, const char *dev_name,
+           void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, befs_fill_super);
 }
 
 static struct file_system_type befs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "befs",
-       .get_sb         = befs_get_sb,
+       .mount          = befs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,      
 };
index 883e77acd5a8cd8e0c3598cb62e5993e82725d97..76db6d7d49bbd75d22a23016ab0b9df3449d0b00 100644 (file)
@@ -450,16 +450,16 @@ out:
        return ret;
 }
 
-static int bfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *bfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, bfs_fill_super);
 }
 
 static struct file_system_type bfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "bfs",
-       .get_sb         = bfs_get_sb,
+       .mount          = bfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 29990f0eee0c90adb18771c2c327fc99ee32c765..1befe2ec8186768a7b7baebc4a4c4d20418cfc14 100644 (file)
@@ -706,10 +706,10 @@ static int bm_fill_super(struct super_block * sb, void * data, int silent)
        return err;
 }
 
-static int bm_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *bm_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, bm_fill_super, mnt);
+       return mount_single(fs_type, flags, data, bm_fill_super);
 }
 
 static struct linux_binfmt misc_format = {
@@ -720,7 +720,7 @@ static struct linux_binfmt misc_format = {
 static struct file_system_type bm_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "binfmt_misc",
-       .get_sb         = bm_get_sb,
+       .mount          = bm_mount,
        .kill_sb        = kill_litter_super,
 };
 
index dea3b628a6ce9a9058c24d2b13c364b7c6adb3c3..06e8ff12b97c8fa74d4b2eb05c900801b3adb150 100644 (file)
@@ -464,15 +464,15 @@ static const struct super_operations bdev_sops = {
        .evict_inode = bdev_evict_inode,
 };
 
-static int bd_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *bd_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576, mnt);
+       return mount_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576);
 }
 
 static struct file_system_type bd_type = {
        .name           = "bdev",
-       .get_sb         = bd_get_sb,
+       .mount          = bd_mount,
        .kill_sb        = kill_anon_super,
 };
 
index 144f8a5730f56991cda69558daadfaf1eb458081..ebe46c628748336eddee1e70502f2a8e08709f38 100644 (file)
@@ -560,8 +560,8 @@ static int btrfs_test_super(struct super_block *s, void *data)
  * Note:  This is based on get_sb_bdev from fs/super.c with a few additions
  *       for multiple device setup.  Make sure to keep it in sync.
  */
-static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
-               const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
+               const char *dev_name, void *data)
 {
        struct block_device *bdev = NULL;
        struct super_block *s;
@@ -580,7 +580,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
                                          &subvol_name, &subvol_objectid,
                                          &fs_devices);
        if (error)
-               return error;
+               return ERR_PTR(error);
 
        error = btrfs_scan_one_device(dev_name, mode, fs_type, &fs_devices);
        if (error)
@@ -656,11 +656,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
                root = new_root;
        }
 
-       mnt->mnt_sb = s;
-       mnt->mnt_root = root;
-
        kfree(subvol_name);
-       return 0;
+       return root;
 
 error_s:
        error = PTR_ERR(s);
@@ -669,7 +666,7 @@ error_close_devices:
 error_free_subvol_name:
        kfree(subvol_name);
 error:
-       return error;
+       return ERR_PTR(error);
 }
 
 static int btrfs_remount(struct super_block *sb, int *flags, char *data)
@@ -746,7 +743,7 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 static struct file_system_type btrfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "btrfs",
-       .get_sb         = btrfs_get_sb,
+       .mount          = btrfs_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index d6e0e042189184183b4ccf82da8787622e7f7d11..08b460ae05395311f833d54d39c2bf95c3c89667 100644 (file)
@@ -635,7 +635,7 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
 /*
  * mount: join the ceph cluster, and open root directory.
  */
-static int ceph_mount(struct ceph_fs_client *fsc, struct vfsmount *mnt,
+static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
                      const char *path)
 {
        int err;
@@ -678,16 +678,14 @@ static int ceph_mount(struct ceph_fs_client *fsc, struct vfsmount *mnt,
                }
        }
 
-       mnt->mnt_root = root;
-       mnt->mnt_sb = fsc->sb;
-
        fsc->mount_state = CEPH_MOUNT_MOUNTED;
        dout("mount success\n");
-       err = 0;
+       mutex_unlock(&fsc->client->mount_mutex);
+       return root;
 
 out:
        mutex_unlock(&fsc->client->mount_mutex);
-       return err;
+       return ERR_PTR(err);
 
 fail:
        if (first) {
@@ -777,41 +775,45 @@ static int ceph_register_bdi(struct super_block *sb,
        return err;
 }
 
-static int ceph_get_sb(struct file_system_type *fs_type,
-                      int flags, const char *dev_name, void *data,
-                      struct vfsmount *mnt)
+static struct dentry *ceph_mount(struct file_system_type *fs_type,
+                      int flags, const char *dev_name, void *data)
 {
        struct super_block *sb;
        struct ceph_fs_client *fsc;
+       struct dentry *res;
        int err;
        int (*compare_super)(struct super_block *, void *) = ceph_compare_super;
        const char *path = NULL;
        struct ceph_mount_options *fsopt = NULL;
        struct ceph_options *opt = NULL;
 
-       dout("ceph_get_sb\n");
+       dout("ceph_mount\n");
        err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path);
-       if (err < 0)
+       if (err < 0) {
+               res = ERR_PTR(err);
                goto out_final;
+       }
 
        /* create client (which we may/may not use) */
        fsc = create_fs_client(fsopt, opt);
        if (IS_ERR(fsc)) {
-               err = PTR_ERR(fsc);
+               res = ERR_CAST(fsc);
                kfree(fsopt);
                kfree(opt);
                goto out_final;
        }
 
        err = ceph_mdsc_init(fsc);
-       if (err < 0)
+       if (err < 0) {
+               res = ERR_PTR(err);
                goto out;
+       }
 
        if (ceph_test_opt(fsc->client, NOSHARE))
                compare_super = NULL;
        sb = sget(fs_type, compare_super, ceph_set_super, fsc);
        if (IS_ERR(sb)) {
-               err = PTR_ERR(sb);
+               res = ERR_CAST(sb);
                goto out;
        }
 
@@ -823,16 +825,18 @@ static int ceph_get_sb(struct file_system_type *fs_type,
        } else {
                dout("get_sb using new client %p\n", fsc);
                err = ceph_register_bdi(sb, fsc);
-               if (err < 0)
+               if (err < 0) {
+                       res = ERR_PTR(err);
                        goto out_splat;
+               }
        }
 
-       err = ceph_mount(fsc, mnt, path);
-       if (err < 0)
+       res = ceph_real_mount(fsc, path);
+       if (IS_ERR(res))
                goto out_splat;
-       dout("root %p inode %p ino %llx.%llx\n", mnt->mnt_root,
-            mnt->mnt_root->d_inode, ceph_vinop(mnt->mnt_root->d_inode));
-       return 0;
+       dout("root %p inode %p ino %llx.%llx\n", res,
+            res->d_inode, ceph_vinop(res->d_inode));
+       return res;
 
 out_splat:
        ceph_mdsc_close_sessions(fsc->mdsc);
@@ -843,8 +847,8 @@ out:
        ceph_mdsc_destroy(fsc);
        destroy_fs_client(fsc);
 out_final:
-       dout("ceph_get_sb fail %d\n", err);
-       return err;
+       dout("ceph_mount fail %ld\n", PTR_ERR(res));
+       return res;
 }
 
 static void ceph_kill_sb(struct super_block *s)
@@ -860,7 +864,7 @@ static void ceph_kill_sb(struct super_block *s)
 static struct file_system_type ceph_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ceph",
-       .get_sb         = ceph_get_sb,
+       .mount          = ceph_mount,
        .kill_sb        = ceph_kill_sb,
        .fs_flags       = FS_RENAME_DOES_D_MOVE,
 };
index 34371637f210b496d54e291863b23ee619db9b8f..8bd5c2c243a5829fe869856ce2ed7efdb1d7395f 100644 (file)
@@ -545,9 +545,9 @@ static const struct super_operations cifs_super_ops = {
 #endif
 };
 
-static int
-cifs_get_sb(struct file_system_type *fs_type,
-           int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *
+cifs_do_mount(struct file_system_type *fs_type,
+           int flags, const char *dev_name, void *data)
 {
        int rc;
        struct super_block *sb;
@@ -557,18 +557,17 @@ cifs_get_sb(struct file_system_type *fs_type,
        cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
 
        if (IS_ERR(sb))
-               return PTR_ERR(sb);
+               return ERR_CAST(sb);
 
        sb->s_flags = flags;
 
        rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
        if (rc) {
                deactivate_locked_super(sb);
-               return rc;
+               return ERR_PTR(rc);
        }
        sb->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 }
 
 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
@@ -634,7 +633,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
 struct file_system_type cifs_fs_type = {
        .owner = THIS_MODULE,
        .name = "cifs",
-       .get_sb = cifs_get_sb,
+       .mount = cifs_do_mount,
        .kill_sb = kill_anon_super,
        /*  .fs_flags */
 };
index 7993b96ca348cdf6910fc60e048b61847c8d7097..5ea57c8c7f97032abe286dc97c9e3b5dc041f4a6 100644 (file)
@@ -306,16 +306,16 @@ static int coda_statfs(struct dentry *dentry, struct kstatfs *buf)
 
 /* init_coda: used by filesystems.c to register coda */
 
-static int coda_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *coda_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, coda_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, coda_fill_super);
 }
 
 struct file_system_type coda_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "coda",
-       .get_sb         = coda_get_sb,
+       .mount          = coda_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = FS_BINARY_MOUNTDATA,
 };
index 8c8d64230c2d040d1946444eb33c6533288f6019..7d3607febe1c7f8878912ab3a389933cda932aaa 100644 (file)
@@ -104,16 +104,16 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int configfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *configfs_do_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, configfs_fill_super, mnt);
+       return mount_single(fs_type, flags, data, configfs_fill_super);
 }
 
 static struct file_system_type configfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "configfs",
-       .get_sb         = configfs_get_sb,
+       .mount          = configfs_do_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 1e7a33028d33908807d776d05840637cfd7e4f22..32fd5fe9ca0e5b8cd13a4a25c4c7a194e235bf1f 100644 (file)
@@ -533,17 +533,16 @@ static const struct super_operations cramfs_ops = {
        .statfs         = cramfs_statfs,
 };
 
-static int cramfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *cramfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, cramfs_fill_super);
 }
 
 static struct file_system_type cramfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "cramfs",
-       .get_sb         = cramfs_get_sb,
+       .mount          = cramfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index a4ed8380e98a630197edf4c556b8f4067a1c872f..37a8ca7c12228442022a75f6735bb65cb5930209 100644 (file)
@@ -135,17 +135,17 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent)
        return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);
 }
 
-static int debug_get_sb(struct file_system_type *fs_type,
+static struct dentry *debug_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data, struct vfsmount *mnt)
+                       void *data)
 {
-       return get_sb_single(fs_type, flags, data, debug_fill_super, mnt);
+       return mount_single(fs_type, flags, data, debug_fill_super);
 }
 
 static struct file_system_type debug_fs_type = {
        .owner =        THIS_MODULE,
        .name =         "debugfs",
-       .get_sb =       debug_get_sb,
+       .mount =        debug_mount,
        .kill_sb =      kill_litter_super,
 };
 
index 8b3ffd5b5235eebf6e5f711efa1673776f80e6e9..1bb547c9cad6d98d5c2816a3bf01d46481a72224 100644 (file)
@@ -331,7 +331,7 @@ static int compare_init_pts_sb(struct super_block *s, void *p)
 }
 
 /*
- * devpts_get_sb()
+ * devpts_mount()
  *
  *     If the '-o newinstance' mount option was specified, mount a new
  *     (private) instance of devpts.  PTYs created in this instance are
@@ -345,20 +345,20 @@ static int compare_init_pts_sb(struct super_block *s, void *p)
  *     semantics in devpts while preserving backward compatibility of the
  *     current 'single-namespace' semantics. i.e all mounts of devpts
  *     without the 'newinstance' mount option should bind to the initial
- *     kernel mount, like get_sb_single().
+ *     kernel mount, like mount_single().
  *
  *     Mounts with 'newinstance' option create a new, private namespace.
  *
  *     NOTE:
  *
- *     For single-mount semantics, devpts cannot use get_sb_single(),
- *     because get_sb_single()/sget() find and use the super-block from
+ *     For single-mount semantics, devpts cannot use mount_single(),
+ *     because mount_single()/sget() find and use the super-block from
  *     the most recent mount of devpts. But that recent mount may be a
- *     'newinstance' mount and get_sb_single() would pick the newinstance
+ *     'newinstance' mount and mount_single() would pick the newinstance
  *     super-block instead of the initial super-block.
  */
-static int devpts_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *devpts_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
        int error;
        struct pts_mount_opts opts;
@@ -366,7 +366,7 @@ static int devpts_get_sb(struct file_system_type *fs_type,
 
        error = parse_mount_options(data, PARSE_MOUNT, &opts);
        if (error)
-               return error;
+               return ERR_PTR(error);
 
        if (opts.newinstance)
                s = sget(fs_type, NULL, set_anon_super, NULL);
@@ -374,7 +374,7 @@ static int devpts_get_sb(struct file_system_type *fs_type,
                s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
 
        if (IS_ERR(s))
-               return PTR_ERR(s);
+               return ERR_CAST(s);
 
        if (!s->s_root) {
                s->s_flags = flags;
@@ -390,13 +390,11 @@ static int devpts_get_sb(struct file_system_type *fs_type,
        if (error)
                goto out_undo_sget;
 
-       simple_set_mnt(mnt, s);
-
-       return 0;
+       return dget(s->s_root);
 
 out_undo_sget:
        deactivate_locked_super(s);
-       return error;
+       return ERR_PTR(error);
 }
 
 #else
@@ -404,10 +402,10 @@ out_undo_sget:
  * This supports only the legacy single-instance semantics (no
  * multiple-instance semantics)
  */
-static int devpts_get_sb(struct file_system_type *fs_type, int flags,
-               const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *devpts_mount(struct file_system_type *fs_type, int flags,
+               const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, devpts_fill_super, mnt);
+       return mount_single(fs_type, flags, data, devpts_fill_super);
 }
 #endif
 
@@ -421,7 +419,7 @@ static void devpts_kill_sb(struct super_block *sb)
 
 static struct file_system_type devpts_fs_type = {
        .name           = "devpts",
-       .get_sb         = devpts_get_sb,
+       .mount          = devpts_mount,
        .kill_sb        = devpts_kill_sb,
 };
 
index cbd4e18adb204438d45b865469d38b7af97a9904..8585934712d447f122977b0eb4377f43e73c060d 100644 (file)
@@ -540,9 +540,8 @@ out:
  *                        ecryptfs_interpose to perform most of the linking
  * ecryptfs_interpose(): links the lower filesystem into ecryptfs (inode.c)
  */
-static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *raw_data,
-                       struct vfsmount *mnt)
+static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags,
+                       const char *dev_name, void *raw_data)
 {
        struct super_block *s;
        struct ecryptfs_sb_info *sbi;
@@ -607,8 +606,7 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
                err = "Reading sb failed";
                goto out;
        }
-       simple_set_mnt(mnt, s);
-       return 0;
+       return dget(s->s_root);
 
 out:
        if (sbi) {
@@ -616,7 +614,7 @@ out:
                kmem_cache_free(ecryptfs_sb_info_cache, sbi);
        }
        printk(KERN_ERR "%s; rc = [%d]\n", err, rc);
-       return rc;
+       return ERR_PTR(rc);
 }
 
 /**
@@ -639,7 +637,7 @@ static void ecryptfs_kill_block_super(struct super_block *sb)
 static struct file_system_type ecryptfs_fs_type = {
        .owner = THIS_MODULE,
        .name = "ecryptfs",
-       .get_sb = ecryptfs_get_sb,
+       .mount = ecryptfs_mount,
        .kill_sb = ecryptfs_kill_block_super,
        .fs_flags = 0
 };
index f04942810818ade709f8f7cfa416b21f87c6736a..5073a07652cc78724cfdd537bf365e17e139ac2f 100644 (file)
 static int efs_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int efs_fill_super(struct super_block *s, void *d, int silent);
 
-static int efs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *efs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super);
 }
 
 static struct file_system_type efs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "efs",
-       .get_sb         = efs_get_sb,
+       .mount          = efs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 047e92fa3af8aaf56350fbb2ca99fd56e45d7dd3..79c3ae6e045693ec5e7e8f91cf031309be175242 100644 (file)
@@ -659,19 +659,19 @@ free_bdi:
 /*
  * Set up the superblock (calls exofs_fill_super eventually)
  */
-static int exofs_get_sb(struct file_system_type *type,
+static struct dentry *exofs_mount(struct file_system_type *type,
                          int flags, const char *dev_name,
-                         void *data, struct vfsmount *mnt)
+                         void *data)
 {
        struct exofs_mountopt opts;
        int ret;
 
        ret = parse_options(data, &opts);
        if (ret)
-               return ret;
+               return ERR_PTR(ret);
 
        opts.dev_name = dev_name;
-       return get_sb_nodev(type, flags, &opts, exofs_fill_super, mnt);
+       return mount_nodev(type, flags, &opts, exofs_fill_super);
 }
 
 /*
@@ -809,7 +809,7 @@ static const struct export_operations exofs_export_ops = {
 static struct file_system_type exofs_type = {
        .owner          = THIS_MODULE,
        .name           = "exofs",
-       .get_sb         = exofs_get_sb,
+       .mount          = exofs_mount,
        .kill_sb        = generic_shutdown_super,
 };
 
index 0901320671da20631092a1cc57113e9a0ef46d8d..d89e0b6a2d78d86f7e74772b58b98291bba3aa4a 100644 (file)
@@ -1356,10 +1356,10 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
        return 0;
 }
 
-static int ext2_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ext2_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
 }
 
 #ifdef CONFIG_QUOTA
@@ -1473,7 +1473,7 @@ out:
 static struct file_system_type ext2_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ext2",
-       .get_sb         = ext2_get_sb,
+       .mount          = ext2_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index db87413d3479c15ecc36223ad4b02c8c6c06f07e..2fedaf8b50125bf65ad9b550537742de3109ecd4 100644 (file)
@@ -3020,16 +3020,16 @@ out:
 
 #endif
 
-static int ext3_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ext3_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ext3_fill_super);
 }
 
 static struct file_system_type ext3_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ext3",
-       .get_sb         = ext3_get_sb,
+       .mount          = ext3_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 0348ce0665929f45933bb04fa538d2c18fe863f8..40131b777af66c3112bb1df16265faadac435d0f 100644 (file)
@@ -73,8 +73,8 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int ext4_unfreeze(struct super_block *sb);
 static void ext4_write_super(struct super_block *sb);
 static int ext4_freeze(struct super_block *sb);
-static int ext4_get_sb(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data, struct vfsmount *mnt);
+static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
+                      const char *dev_name, void *data);
 static void ext4_destroy_lazyinit_thread(void);
 static void ext4_unregister_li_request(struct super_block *sb);
 
@@ -82,7 +82,7 @@ static void ext4_unregister_li_request(struct super_block *sb);
 static struct file_system_type ext3_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ext3",
-       .get_sb         = ext4_get_sb,
+       .mount          = ext4_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
@@ -4667,17 +4667,17 @@ out:
 
 #endif
 
-static int ext4_get_sb(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
+                      const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ext4_fill_super);
 }
 
 #if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23)
 static struct file_system_type ext2_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ext2",
-       .get_sb         = ext4_get_sb,
+       .mount          = ext4_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
@@ -4722,7 +4722,7 @@ static inline void unregister_as_ext3(void) { }
 static struct file_system_type ext4_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ext4",
-       .get_sb         = ext4_get_sb,
+       .mount          = ext4_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index bbca5c186ae7654d69025a2cbb214c1fc1f96a3d..3345aabd1dd7e32585b18956175265ec3fdda011 100644 (file)
@@ -675,18 +675,17 @@ static int msdos_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int msdos_get_sb(struct file_system_type *fs_type,
+static struct dentry *msdos_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data, struct vfsmount *mnt)
+                       void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, msdos_fill_super);
 }
 
 static struct file_system_type msdos_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "msdos",
-       .get_sb         = msdos_get_sb,
+       .mount          = msdos_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 6f0f6c9a0152263d61081e436641fb9a0300db6c..b936703b8924491a2671b8432c67570d18e9a810 100644 (file)
@@ -1071,18 +1071,17 @@ static int vfat_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int vfat_get_sb(struct file_system_type *fs_type,
+static struct dentry *vfat_mount(struct file_system_type *fs_type,
                       int flags, const char *dev_name,
-                      void *data, struct vfsmount *mnt)
+                      void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, vfat_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, vfat_fill_super);
 }
 
 static struct file_system_type vfat_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "vfat",
-       .get_sb         = vfat_get_sb,
+       .mount          = vfat_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 71b0148b878415795d984528c02679d45ee218e4..9d1c99558389dabd0b11329ddcb51bcd4d9711f6 100644 (file)
@@ -246,17 +246,16 @@ out:
 /*
  * The usual module blurb.
  */
-static int vxfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *vxfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
 }
 
 static struct file_system_type vxfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "vxfs",
-       .get_sb         = vxfs_get_sb,
+       .mount          = vxfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 4eba07661e5c562b50462d8feee6982e39fe2c4b..85542a7daf4012d2dffb7b7d4c86e0b6b917cb72 100644 (file)
@@ -322,12 +322,10 @@ static int fuse_ctl_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int fuse_ctl_get_sb(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *raw_data,
-                       struct vfsmount *mnt)
+static struct dentry *fuse_ctl_mount(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *raw_data)
 {
-       return get_sb_single(fs_type, flags, raw_data,
-                               fuse_ctl_fill_super, mnt);
+       return mount_single(fs_type, flags, raw_data, fuse_ctl_fill_super);
 }
 
 static void fuse_ctl_kill_sb(struct super_block *sb)
@@ -346,7 +344,7 @@ static void fuse_ctl_kill_sb(struct super_block *sb)
 static struct file_system_type fuse_ctl_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "fusectl",
-       .get_sb         = fuse_ctl_get_sb,
+       .mount          = fuse_ctl_mount,
        .kill_sb        = fuse_ctl_kill_sb,
 };
 
index da9e6e11374c402d63145dd2da7b0e8fdf72deca..cfce3ad86a9253c8f82f793da306979357f4df6f 100644 (file)
@@ -1041,11 +1041,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
        return err;
 }
 
-static int fuse_get_sb(struct file_system_type *fs_type,
+static struct dentry *fuse_mount(struct file_system_type *fs_type,
                       int flags, const char *dev_name,
-                      void *raw_data, struct vfsmount *mnt)
+                      void *raw_data)
 {
-       return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
+       return mount_nodev(fs_type, flags, raw_data, fuse_fill_super);
 }
 
 static void fuse_kill_sb_anon(struct super_block *sb)
@@ -1065,17 +1065,16 @@ static struct file_system_type fuse_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "fuse",
        .fs_flags       = FS_HAS_SUBTYPE,
-       .get_sb         = fuse_get_sb,
+       .mount          = fuse_mount,
        .kill_sb        = fuse_kill_sb_anon,
 };
 
 #ifdef CONFIG_BLOCK
-static int fuse_get_sb_blk(struct file_system_type *fs_type,
+static struct dentry *fuse_mount_blk(struct file_system_type *fs_type,
                           int flags, const char *dev_name,
-                          void *raw_data, struct vfsmount *mnt)
+                          void *raw_data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super);
 }
 
 static void fuse_kill_sb_blk(struct super_block *sb)
@@ -1094,7 +1093,7 @@ static void fuse_kill_sb_blk(struct super_block *sb)
 static struct file_system_type fuseblk_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "fuseblk",
-       .get_sb         = fuse_get_sb_blk,
+       .mount          = fuse_mount_blk,
        .kill_sb        = fuse_kill_sb_blk,
        .fs_flags       = FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
 };
index cade1acbcea9420dc7c69622888d820af24eea99..3eb1393f7b81ba80f0e56ff58a92748ca68b708e 100644 (file)
@@ -1250,12 +1250,11 @@ static int test_gfs2_super(struct super_block *s, void *ptr)
 }
 
 /**
- * gfs2_get_sb - Get the GFS2 superblock
+ * gfs2_mount - Get the GFS2 superblock
  * @fs_type: The GFS2 filesystem type
  * @flags: Mount flags
  * @dev_name: The name of the device
  * @data: The mount arguments
- * @mnt: The vfsmnt for this mount
  *
  * Q. Why not use get_sb_bdev() ?
  * A. We need to select one of two root directories to mount, independent
@@ -1264,8 +1263,8 @@ static int test_gfs2_super(struct super_block *s, void *ptr)
  * Returns: 0 or -ve on error
  */
 
-static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *gfs2_mount(struct file_system_type *fs_type, int flags,
+                      const char *dev_name, void *data)
 {
        struct block_device *bdev;
        struct super_block *s;
@@ -1279,7 +1278,7 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
 
        bdev = open_bdev_exclusive(dev_name, mode, fs_type);
        if (IS_ERR(bdev))
-               return PTR_ERR(bdev);
+               return ERR_CAST(bdev);
 
        /*
         * once the super is inserted into the list by sget, s_umount
@@ -1298,6 +1297,9 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
        if (IS_ERR(s))
                goto error_bdev;
 
+       if (s->s_root)
+               close_bdev_exclusive(bdev, mode);
+
        memset(&args, 0, sizeof(args));
        args.ar_quota = GFS2_QUOTA_DEFAULT;
        args.ar_data = GFS2_DATA_DEFAULT;
@@ -1309,17 +1311,13 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
        error = gfs2_mount_args(&args, data);
        if (error) {
                printk(KERN_WARNING "GFS2: can't parse mount arguments\n");
-               if (s->s_root)
-                       goto error_super;
-               deactivate_locked_super(s);
-               return error;
+               goto error_super;
        }
 
        if (s->s_root) {
                error = -EBUSY;
                if ((flags ^ s->s_flags) & MS_RDONLY)
                        goto error_super;
-               close_bdev_exclusive(bdev, mode);
        } else {
                char b[BDEVNAME_SIZE];
 
@@ -1328,27 +1326,24 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
                strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
                sb_set_blocksize(s, block_size(bdev));
                error = fill_super(s, &args, flags & MS_SILENT ? 1 : 0);
-               if (error) {
-                       deactivate_locked_super(s);
-                       return error;
-               }
+               if (error)
+                       goto error_super;
                s->s_flags |= MS_ACTIVE;
                bdev->bd_super = s;
        }
 
        sdp = s->s_fs_info;
-       mnt->mnt_sb = s;
        if (args.ar_meta)
-               mnt->mnt_root = dget(sdp->sd_master_dir);
+               return dget(sdp->sd_master_dir);
        else
-               mnt->mnt_root = dget(sdp->sd_root_dir);
-       return 0;
+               return dget(sdp->sd_root_dir);
 
 error_super:
        deactivate_locked_super(s);
+       return ERR_PTR(error);
 error_bdev:
        close_bdev_exclusive(bdev, mode);
-       return error;
+       return ERR_PTR(error);
 }
 
 static int set_meta_super(struct super_block *s, void *ptr)
@@ -1356,8 +1351,8 @@ static int set_meta_super(struct super_block *s, void *ptr)
        return -EINVAL;
 }
 
-static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
-                           const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *data)
 {
        struct super_block *s;
        struct gfs2_sbd *sdp;
@@ -1368,23 +1363,21 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
        if (error) {
                printk(KERN_WARNING "GFS2: path_lookup on %s returned error %d\n",
                       dev_name, error);
-               return error;
+               return ERR_PTR(error);
        }
        s = sget(&gfs2_fs_type, test_gfs2_super, set_meta_super,
                 path.dentry->d_inode->i_sb->s_bdev);
        path_put(&path);
        if (IS_ERR(s)) {
                printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n");
-               return PTR_ERR(s);
+               return ERR_CAST(s);
        }
        if ((flags ^ s->s_flags) & MS_RDONLY) {
                deactivate_locked_super(s);
-               return -EBUSY;
+               return ERR_PTR(-EBUSY);
        }
        sdp = s->s_fs_info;
-       mnt->mnt_sb = s;
-       mnt->mnt_root = dget(sdp->sd_master_dir);
-       return 0;
+       return dget(sdp->sd_master_dir);
 }
 
 static void gfs2_kill_sb(struct super_block *sb)
@@ -1410,7 +1403,7 @@ static void gfs2_kill_sb(struct super_block *sb)
 struct file_system_type gfs2_fs_type = {
        .name = "gfs2",
        .fs_flags = FS_REQUIRES_DEV,
-       .get_sb = gfs2_get_sb,
+       .mount = gfs2_mount,
        .kill_sb = gfs2_kill_sb,
        .owner = THIS_MODULE,
 };
@@ -1418,7 +1411,7 @@ struct file_system_type gfs2_fs_type = {
 struct file_system_type gfs2meta_fs_type = {
        .name = "gfs2meta",
        .fs_flags = FS_REQUIRES_DEV,
-       .get_sb = gfs2_get_sb_meta,
+       .mount = gfs2_mount_meta,
        .owner = THIS_MODULE,
 };
 
index 6ee1586f2334f0c05be1dd8a5305dc96be12674a..4824c27cebb8c2e49aa61edc33f2ec94f984ceab 100644 (file)
@@ -441,17 +441,16 @@ bail:
        return res;
 }
 
-static int hfs_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data,
-                     struct vfsmount *mnt)
+static struct dentry *hfs_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, hfs_fill_super);
 }
 
 static struct file_system_type hfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "hfs",
-       .get_sb         = hfs_get_sb,
+       .mount          = hfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 9a88d7536103e2c1c70f3824b42d367d3eac848f..52cc746d3ba36dd7a6ae8c2ab366d8469131456f 100644 (file)
@@ -495,18 +495,16 @@ static void hfsplus_destroy_inode(struct inode *inode)
 
 #define HFSPLUS_INODE_SIZE     sizeof(struct hfsplus_inode_info)
 
-static int hfsplus_get_sb(struct file_system_type *fs_type,
-                         int flags, const char *dev_name, void *data,
-                         struct vfsmount *mnt)
+static struct dentry *hfsplus_mount(struct file_system_type *fs_type,
+                         int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super);
 }
 
 static struct file_system_type hfsplus_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "hfsplus",
-       .get_sb         = hfsplus_get_sb,
+       .mount          = hfsplus_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index cd7c93917cc7c29636ee7c87a8846177e4098d23..2c0f148a49e65e9cb01016249a76dfd7985aeb25 100644 (file)
@@ -962,11 +962,11 @@ out:
        return err;
 }
 
-static int hostfs_read_sb(struct file_system_type *type,
+static struct dentry *hostfs_read_sb(struct file_system_type *type,
                          int flags, const char *dev_name,
-                         void *data, struct vfsmount *mnt)
+                         void *data)
 {
-       return get_sb_nodev(type, flags, data, hostfs_fill_sb_common, mnt);
+       return mount_nodev(type, flags, data, hostfs_fill_sb_common);
 }
 
 static void hostfs_kill_sb(struct super_block *s)
@@ -978,7 +978,7 @@ static void hostfs_kill_sb(struct super_block *s)
 static struct file_system_type hostfs_type = {
        .owner          = THIS_MODULE,
        .name           = "hostfs",
-       .get_sb         = hostfs_read_sb,
+       .mount          = hostfs_read_sb,
        .kill_sb        = hostfs_kill_sb,
        .fs_flags       = 0,
 };
index c969a1aa163a7cd3fb0b48094edf1ac90f63816c..bb69389972eb33148dfdc4176ea87b7003cb39f0 100644 (file)
@@ -686,17 +686,16 @@ bail0:
        return -EINVAL;
 }
 
-static int hpfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *hpfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
 }
 
 static struct file_system_type hpfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "hpfs",
-       .get_sb         = hpfs_get_sb,
+       .mount          = hpfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 4e2a45ea6140ddde677446d52f022eadbe020395..f702b5f713fc40805a37ce173c505ea569d04628 100644 (file)
@@ -748,17 +748,17 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
        return(err);
 }
 
-static int hppfs_read_super(struct file_system_type *type,
+static struct dentry *hppfs_read_super(struct file_system_type *type,
                            int flags, const char *dev_name,
-                           void *data, struct vfsmount *mnt)
+                           void *data)
 {
-       return get_sb_nodev(type, flags, data, hppfs_fill_super, mnt);
+       return mount_nodev(type, flags, data, hppfs_fill_super);
 }
 
 static struct file_system_type hppfs_type = {
        .owner          = THIS_MODULE,
        .name           = "hppfs",
-       .get_sb         = hppfs_read_super,
+       .mount          = hppfs_read_super,
        .kill_sb        = kill_anon_super,
        .fs_flags       = 0,
 };
index b14be3f781c714129d4fafbd17a7ff9874193b3f..d6cfac1f0a40cc20357961bd7895f6985440dee7 100644 (file)
@@ -896,15 +896,15 @@ void hugetlb_put_quota(struct address_space *mapping, long delta)
        }
 }
 
-static int hugetlbfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *hugetlbfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, hugetlbfs_fill_super);
 }
 
 static struct file_system_type hugetlbfs_fs_type = {
        .name           = "hugetlbfs",
-       .get_sb         = hugetlbfs_get_sb,
+       .mount          = hugetlbfs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index ebad3b90752dae0b37838734293ee36864af2c02..e43b9a4dbf4e602e39f9ca4e85a77f364798980b 100644 (file)
@@ -106,5 +106,5 @@ extern void release_open_intent(struct nameidata *);
  * inode.c
  */
 extern int get_nr_dirty_inodes(void);
-extern int evict_inodes(struct super_block *);
+extern void evict_inodes(struct super_block *);
 extern int invalidate_inodes(struct super_block *);
index 79cf7f616bbe8fdb9f84a90e92bf4f6717ae22cb..bfdeb82a53be09e848a74b75bbb3178a9881b352 100644 (file)
@@ -1507,17 +1507,16 @@ struct inode *isofs_iget(struct super_block *sb,
        return inode;
 }
 
-static int isofs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *isofs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super,
-                               mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
 }
 
 static struct file_system_type iso9660_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "iso9660",
-       .get_sb         = isofs_get_sb,
+       .mount          = isofs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index d1ae5dfc22b97cd04c29fa9c901ac88ba31f0670..c86041b866a4810d4ebb66f16dd137521470294f 100644 (file)
@@ -179,12 +179,11 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
        return ret;
 }
 
-static int jffs2_get_sb(struct file_system_type *fs_type,
+static struct dentry *jffs2_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data, struct vfsmount *mnt)
+                       void *data)
 {
-       return get_sb_mtd(fs_type, flags, dev_name, data, jffs2_fill_super,
-                         mnt);
+       return mount_mtd(fs_type, flags, dev_name, data, jffs2_fill_super);
 }
 
 static void jffs2_put_super (struct super_block *sb)
@@ -229,7 +228,7 @@ static void jffs2_kill_sb(struct super_block *sb)
 static struct file_system_type jffs2_fs_type = {
        .owner =        THIS_MODULE,
        .name =         "jffs2",
-       .get_sb =       jffs2_get_sb,
+       .mount =        jffs2_mount,
        .kill_sb =      jffs2_kill_sb,
 };
 
index 68eee2bf629ee4ba6d5d6ad326012aca03d09c4f..0669fc1cc3bf25b69121cb2c34cd216e1a7a9966 100644 (file)
@@ -583,11 +583,10 @@ static int jfs_unfreeze(struct super_block *sb)
        return 0;
 }
 
-static int jfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
 }
 
 static int jfs_sync_fs(struct super_block *sb, int wait)
@@ -770,7 +769,7 @@ static const struct export_operations jfs_export_operations = {
 static struct file_system_type jfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "jfs",
-       .get_sb         = jfs_get_sb,
+       .mount          = jfs_do_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 304a5132ca270d018799d3003170bd813c23dd9b..a3accdf528add9161bd6dccfb84f7c08ccb28437 100644 (file)
@@ -201,9 +201,8 @@ static const struct super_operations simple_super_operations = {
  * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
  * will never be mountable)
  */
-int get_sb_pseudo(struct file_system_type *fs_type, char *name,
-       const struct super_operations *ops, unsigned long magic,
-       struct vfsmount *mnt)
+struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
+       const struct super_operations *ops, unsigned long magic)
 {
        struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
        struct dentry *dentry;
@@ -211,7 +210,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        struct qstr d_name = {.name = name, .len = strlen(name)};
 
        if (IS_ERR(s))
-               return PTR_ERR(s);
+               return ERR_CAST(s);
 
        s->s_flags = MS_NOUSER;
        s->s_maxbytes = MAX_LFS_FILESIZE;
@@ -241,12 +240,11 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        d_instantiate(dentry, root);
        s->s_root = dentry;
        s->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, s);
-       return 0;
+       return dget(s->s_root);
 
 Enomem:
        deactivate_locked_super(s);
-       return -ENOMEM;
+       return ERR_PTR(-ENOMEM);
 }
 
 int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
@@ -951,7 +949,7 @@ EXPORT_SYMBOL(dcache_dir_lseek);
 EXPORT_SYMBOL(dcache_dir_open);
 EXPORT_SYMBOL(dcache_readdir);
 EXPORT_SYMBOL(generic_read_dir);
-EXPORT_SYMBOL(get_sb_pseudo);
+EXPORT_SYMBOL(mount_pseudo);
 EXPORT_SYMBOL(simple_write_begin);
 EXPORT_SYMBOL(simple_write_end);
 EXPORT_SYMBOL(simple_dir_inode_operations);
index 9bd2ce2a30407897557b32a2fa9f97708695593e..92ca6fbe09bd2254eb9cbbd3d23b487ee4d4f9a8 100644 (file)
@@ -298,9 +298,9 @@ static int bdev_write_sb(struct super_block *sb, struct page *page)
        return sync_request(page, bdev, WRITE);
 }
 
-static void bdev_put_device(struct super_block *sb)
+static void bdev_put_device(struct logfs_super *s)
 {
-       close_bdev_exclusive(logfs_super(sb)->s_bdev, FMODE_READ|FMODE_WRITE);
+       close_bdev_exclusive(s->s_bdev, FMODE_READ|FMODE_WRITE);
 }
 
 static int bdev_can_write_buf(struct super_block *sb, u64 ofs)
@@ -320,8 +320,8 @@ static const struct logfs_device_ops bd_devops = {
        .put_device     = bdev_put_device,
 };
 
-int logfs_get_sb_bdev(struct file_system_type *type, int flags,
-               const char *devname, struct vfsmount *mnt)
+int logfs_get_sb_bdev(struct logfs_super *p, struct file_system_type *type,
+               const char *devname)
 {
        struct block_device *bdev;
 
@@ -332,8 +332,11 @@ int logfs_get_sb_bdev(struct file_system_type *type, int flags,
        if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) {
                int mtdnr = MINOR(bdev->bd_dev);
                close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
-               return logfs_get_sb_mtd(type, flags, mtdnr, mnt);
+               return logfs_get_sb_mtd(p, mtdnr);
        }
 
-       return logfs_get_sb_device(type, flags, NULL, bdev, &bd_devops, mnt);
+       p->s_bdev = bdev;
+       p->s_mtd = NULL;
+       p->s_devops = &bd_devops;
+       return 0;
 }
index a85d47d13e4b04623dff3d873c66cc107b7f8599..7466e9dcc8c537c532b92241bd9684bfd3b26481 100644 (file)
@@ -230,9 +230,9 @@ static void mtd_writeseg(struct super_block *sb, u64 ofs, size_t len)
        __mtd_writeseg(sb, ofs, ofs >> PAGE_SHIFT, len >> PAGE_SHIFT);
 }
 
-static void mtd_put_device(struct super_block *sb)
+static void mtd_put_device(struct logfs_super *s)
 {
-       put_mtd_device(logfs_super(sb)->s_mtd);
+       put_mtd_device(s->s_mtd);
 }
 
 static int mtd_can_write_buf(struct super_block *sb, u64 ofs)
@@ -265,14 +265,14 @@ static const struct logfs_device_ops mtd_devops = {
        .put_device     = mtd_put_device,
 };
 
-int logfs_get_sb_mtd(struct file_system_type *type, int flags,
-               int mtdnr, struct vfsmount *mnt)
+int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
 {
-       struct mtd_info *mtd;
-       const struct logfs_device_ops *devops = &mtd_devops;
-
-       mtd = get_mtd_device(NULL, mtdnr);
+       struct mtd_info *mtd = get_mtd_device(NULL, mtdnr);
        if (IS_ERR(mtd))
                return PTR_ERR(mtd);
-       return logfs_get_sb_device(type, flags, mtd, NULL, devops, mnt);
+
+       s->s_bdev = NULL;
+       s->s_mtd = mtd;
+       s->s_devops = &mtd_devops;
+       return 0;
 }
index b8786264d243fcd49d31f9d3fe670657264e46d4..cd51a36b37f0956bf7eafde8ced983d5ae437b05 100644 (file)
@@ -136,6 +136,7 @@ struct logfs_area_ops {
        int     (*erase_segment)(struct logfs_area *area);
 };
 
+struct logfs_super;    /* forward */
 /**
  * struct logfs_device_ops - device access operations
  *
@@ -156,7 +157,7 @@ struct logfs_device_ops {
                        int ensure_write);
        int (*can_write_buf)(struct super_block *sb, u64 ofs);
        void (*sync)(struct super_block *sb);
-       void (*put_device)(struct super_block *sb);
+       void (*put_device)(struct logfs_super *s);
 };
 
 /**
@@ -471,11 +472,13 @@ void logfs_compr_exit(void);
 
 /* dev_bdev.c */
 #ifdef CONFIG_BLOCK
-int logfs_get_sb_bdev(struct file_system_type *type, int flags,
-               const char *devname, struct vfsmount *mnt);
+int logfs_get_sb_bdev(struct logfs_super *s,
+               struct file_system_type *type,
+               const char *devname);
 #else
-static inline int logfs_get_sb_bdev(struct file_system_type *type, int flags,
-               const char *devname, struct vfsmount *mnt)
+static inline int logfs_get_sb_bdev(struct logfs_super *s,
+               struct file_system_type *type,
+               const char *devname)
 {
        return -ENODEV;
 }
@@ -483,11 +486,9 @@ static inline int logfs_get_sb_bdev(struct file_system_type *type, int flags,
 
 /* dev_mtd.c */
 #ifdef CONFIG_MTD
-int logfs_get_sb_mtd(struct file_system_type *type, int flags,
-               int mtdnr, struct vfsmount *mnt);
+int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
 #else
-static inline int logfs_get_sb_mtd(struct file_system_type *type, int flags,
-               int mtdnr, struct vfsmount *mnt)
+static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
 {
        return -ENODEV;
 }
@@ -619,9 +620,6 @@ void emergency_read_end(struct page *page);
 void logfs_crash_dump(struct super_block *sb);
 void *memchr_inv(const void *s, int c, size_t n);
 int logfs_statfs(struct dentry *dentry, struct kstatfs *stats);
-int logfs_get_sb_device(struct file_system_type *type, int flags,
-               struct mtd_info *mtd, struct block_device *bdev,
-               const struct logfs_device_ops *devops, struct vfsmount *mnt);
 int logfs_check_ds(struct logfs_disk_super *ds);
 int logfs_write_sb(struct super_block *sb);
 
index 5336155c5d8189c2d6f4f78d73bd1abb3056ff36..33435e4b14d24aaad89bfab57da526870bbfa797 100644 (file)
@@ -325,7 +325,7 @@ static int logfs_make_writeable(struct super_block *sb)
        return 0;
 }
 
-static int logfs_get_sb_final(struct super_block *sb, struct vfsmount *mnt)
+static int logfs_get_sb_final(struct super_block *sb)
 {
        struct logfs_super *super = logfs_super(sb);
        struct inode *rootdir;
@@ -356,7 +356,6 @@ static int logfs_get_sb_final(struct super_block *sb, struct vfsmount *mnt)
        }
 
        log_super("LogFS: Finished mounting\n");
-       simple_set_mnt(mnt, sb);
        return 0;
 
 fail:
@@ -529,43 +528,37 @@ static void logfs_kill_sb(struct super_block *sb)
        logfs_cleanup_rw(sb);
        if (super->s_erase_page)
                __free_page(super->s_erase_page);
-       super->s_devops->put_device(sb);
+       super->s_devops->put_device(super);
        logfs_mempool_destroy(super->s_btree_pool);
        logfs_mempool_destroy(super->s_alias_pool);
        kfree(super);
        log_super("LogFS: Finished unmounting\n");
 }
 
-int logfs_get_sb_device(struct file_system_type *type, int flags,
-               struct mtd_info *mtd, struct block_device *bdev,
-               const struct logfs_device_ops *devops, struct vfsmount *mnt)
+static struct dentry *logfs_get_sb_device(struct logfs_super *super,
+               struct file_system_type *type, int flags)
 {
-       struct logfs_super *super;
        struct super_block *sb;
        int err = -ENOMEM;
        static int mount_count;
 
        log_super("LogFS: Start mount %x\n", mount_count++);
-       super = kzalloc(sizeof(*super), GFP_KERNEL);
-       if (!super)
-               goto err0;
 
-       super->s_mtd    = mtd;
-       super->s_bdev   = bdev;
        err = -EINVAL;
        sb = sget(type, logfs_sb_test, logfs_sb_set, super);
-       if (IS_ERR(sb))
-               goto err0;
+       if (IS_ERR(sb)) {
+               super->s_devops->put_device(super);
+               kfree(super);
+               return ERR_CAST(sb);
+       }
 
        if (sb->s_root) {
                /* Device is already in use */
-               err = 0;
-               simple_set_mnt(mnt, sb);
-               goto err0;
+               super->s_devops->put_device(super);
+               kfree(super);
+               return dget(sb->s_root);
        }
 
-       super->s_devops = devops;
-
        /*
         * sb->s_maxbytes is limited to 8TB.  On 32bit systems, the page cache
         * only covers 16TB and the upper 8TB are used for indirect blocks.
@@ -581,10 +574,12 @@ int logfs_get_sb_device(struct file_system_type *type, int flags,
                goto err1;
 
        sb->s_flags |= MS_ACTIVE;
-       err = logfs_get_sb_final(sb, mnt);
-       if (err)
+       err = logfs_get_sb_final(sb);
+       if (err) {
                deactivate_locked_super(sb);
-       return err;
+               return ERR_PTR(err);
+       }
+       return dget(sb->s_root);
 
 err1:
        /* no ->s_root, no ->put_super() */
@@ -592,37 +587,45 @@ err1:
        iput(super->s_segfile_inode);
        iput(super->s_mapping_inode);
        deactivate_locked_super(sb);
-       return err;
-err0:
-       kfree(super);
-       //devops->put_device(sb);
-       return err;
+       return ERR_PTR(err);
 }
 
-static int logfs_get_sb(struct file_system_type *type, int flags,
-               const char *devname, void *data, struct vfsmount *mnt)
+static struct dentry *logfs_mount(struct file_system_type *type, int flags,
+               const char *devname, void *data)
 {
        ulong mtdnr;
+       struct logfs_super *super;
+       int err;
 
-       if (!devname)
-               return logfs_get_sb_bdev(type, flags, devname, mnt);
-       if (strncmp(devname, "mtd", 3))
-               return logfs_get_sb_bdev(type, flags, devname, mnt);
+       super = kzalloc(sizeof(*super), GFP_KERNEL);
+       if (!super)
+               return ERR_PTR(-ENOMEM);
 
-       {
+       if (!devname)
+               err = logfs_get_sb_bdev(super, type, devname);
+       else if (strncmp(devname, "mtd", 3))
+               err = logfs_get_sb_bdev(super, type, devname);
+       else {
                char *garbage;
                mtdnr = simple_strtoul(devname+3, &garbage, 0);
                if (*garbage)
-                       return -EINVAL;
+                       err = -EINVAL;
+               else
+                       err = logfs_get_sb_mtd(super, mtdnr);
+       }
+
+       if (err) {
+               kfree(super);
+               return ERR_PTR(err);
        }
 
-       return logfs_get_sb_mtd(type, flags, mtdnr, mnt);
+       return logfs_get_sb_device(super, type, flags);
 }
 
 static struct file_system_type logfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "logfs",
-       .get_sb         = logfs_get_sb,
+       .mount          = logfs_mount,
        .kill_sb        = logfs_kill_sb,
        .fs_flags       = FS_REQUIRES_DEV,
 
index e39d6bf2e8fbcf3ccbc36117aca4fd03a67c862e..fb2020858a34cfde663938f5c42503c952d01d48 100644 (file)
@@ -614,17 +614,16 @@ void minix_truncate(struct inode * inode)
                V2_minix_truncate(inode);
 }
 
-static int minix_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *minix_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, minix_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, minix_fill_super);
 }
 
 static struct file_system_type minix_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "minix",
-       .get_sb         = minix_get_sb,
+       .mount          = minix_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index f7dbc06857abfe6e1959654f7fd66b393dd161d0..5362af9b73729905817a76b5c24a5b33c48d5ce7 100644 (file)
@@ -1574,6 +1574,7 @@ static struct file *finish_open(struct nameidata *nd,
         */
        if (will_truncate)
                mnt_drop_write(nd->path.mnt);
+       path_put(&nd->path);
        return filp;
 
 exit:
@@ -1675,6 +1676,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
                }
                filp = nameidata_to_filp(nd);
                mnt_drop_write(nd->path.mnt);
+               path_put(&nd->path);
                if (!IS_ERR(filp)) {
                        error = ima_file_check(filp, acc_mode);
                        if (error) {
index 985fabb26aca44edcacc889af0a8d2c5c47e8f04..d290545aa0c4b98c932e316c7dd4fcf3961b1126 100644 (file)
@@ -1020,16 +1020,16 @@ out:
        return result;
 }
 
-static int ncp_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ncp_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, ncp_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, ncp_fill_super);
 }
 
 static struct file_system_type ncp_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ncpfs",
-       .get_sb         = ncp_get_sb,
+       .mount          = ncp_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = FS_BINARY_MOUNTDATA,
 };
index 3600ec700d583356d7e765db1c3a7035d3b2355c..0a42e8f4adcbc1723b57a7dac93c78b0a34b975e 100644 (file)
@@ -260,8 +260,8 @@ static int  nfs_statfs(struct dentry *, struct kstatfs *);
 static int  nfs_show_options(struct seq_file *, struct vfsmount *);
 static int  nfs_show_stats(struct seq_file *, struct vfsmount *);
 static int nfs_get_sb(struct file_system_type *, int, const char *, void *, struct vfsmount *);
-static int nfs_xdev_get_sb(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
+static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type,
+               int flags, const char *dev_name, void *raw_data);
 static void nfs_put_super(struct super_block *);
 static void nfs_kill_super(struct super_block *);
 static int nfs_remount(struct super_block *sb, int *flags, char *raw_data);
@@ -277,7 +277,7 @@ static struct file_system_type nfs_fs_type = {
 struct file_system_type nfs_xdev_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "nfs",
-       .get_sb         = nfs_xdev_get_sb,
+       .mount          = nfs_xdev_mount,
        .kill_sb        = nfs_kill_super,
        .fs_flags       = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
 };
@@ -302,14 +302,14 @@ static int nfs4_try_mount(int flags, const char *dev_name,
        struct nfs_parsed_mount_data *data, struct vfsmount *mnt);
 static int nfs4_get_sb(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
-static int nfs4_remote_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
-static int nfs4_xdev_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
+static struct dentry *nfs4_remote_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *raw_data);
+static struct dentry *nfs4_xdev_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *raw_data);
 static int nfs4_referral_get_sb(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
-static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
+static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *raw_data);
 static void nfs4_kill_super(struct super_block *sb);
 
 static struct file_system_type nfs4_fs_type = {
@@ -323,7 +323,7 @@ static struct file_system_type nfs4_fs_type = {
 static struct file_system_type nfs4_remote_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "nfs4",
-       .get_sb         = nfs4_remote_get_sb,
+       .mount          = nfs4_remote_mount,
        .kill_sb        = nfs4_kill_super,
        .fs_flags       = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
 };
@@ -331,7 +331,7 @@ static struct file_system_type nfs4_remote_fs_type = {
 struct file_system_type nfs4_xdev_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "nfs4",
-       .get_sb         = nfs4_xdev_get_sb,
+       .mount          = nfs4_xdev_mount,
        .kill_sb        = nfs4_kill_super,
        .fs_flags       = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
 };
@@ -339,7 +339,7 @@ struct file_system_type nfs4_xdev_fs_type = {
 static struct file_system_type nfs4_remote_referral_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "nfs4",
-       .get_sb         = nfs4_remote_referral_get_sb,
+       .mount          = nfs4_remote_referral_mount,
        .kill_sb        = nfs4_kill_super,
        .fs_flags       = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
 };
@@ -2397,9 +2397,9 @@ static void nfs_kill_super(struct super_block *s)
 /*
  * Clone an NFS2/3 server record on xdev traversal (FSID-change)
  */
-static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
-                          const char *dev_name, void *raw_data,
-                          struct vfsmount *mnt)
+static struct dentry *
+nfs_xdev_mount(struct file_system_type *fs_type, int flags,
+               const char *dev_name, void *raw_data)
 {
        struct nfs_clone_mount *data = raw_data;
        struct super_block *s;
@@ -2411,7 +2411,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
        };
        int error;
 
-       dprintk("--> nfs_xdev_get_sb()\n");
+       dprintk("--> nfs_xdev_mount()\n");
 
        /* create a new volume representation */
        server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr);
@@ -2458,28 +2458,26 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
        }
 
        s->s_flags |= MS_ACTIVE;
-       mnt->mnt_sb = s;
-       mnt->mnt_root = mntroot;
 
        /* clone any lsm security options from the parent to the new sb */
        security_sb_clone_mnt_opts(data->sb, s);
 
-       dprintk("<-- nfs_xdev_get_sb() = 0\n");
-       return 0;
+       dprintk("<-- nfs_xdev_mount() = 0\n");
+       return mntroot;
 
 out_err_nosb:
        nfs_free_server(server);
 out_err_noserver:
-       dprintk("<-- nfs_xdev_get_sb() = %d [error]\n", error);
-       return error;
+       dprintk("<-- nfs_xdev_mount() = %d [error]\n", error);
+       return ERR_PTR(error);
 
 error_splat_super:
        if (server && !s->s_root)
                bdi_unregister(&server->backing_dev_info);
 error_splat_bdi:
        deactivate_locked_super(s);
-       dprintk("<-- nfs_xdev_get_sb() = %d [splat]\n", error);
-       return error;
+       dprintk("<-- nfs_xdev_mount() = %d [splat]\n", error);
+       return ERR_PTR(error);
 }
 
 #ifdef CONFIG_NFS_V4
@@ -2649,8 +2647,9 @@ out_no_address:
 /*
  * Get the superblock for the NFS4 root partition
  */
-static int nfs4_remote_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt)
+static struct dentry *
+nfs4_remote_mount(struct file_system_type *fs_type, int flags,
+                 const char *dev_name, void *raw_data)
 {
        struct nfs_parsed_mount_data *data = raw_data;
        struct super_block *s;
@@ -2714,15 +2713,16 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
                goto error_splat_root;
 
        s->s_flags |= MS_ACTIVE;
-       mnt->mnt_sb = s;
-       mnt->mnt_root = mntroot;
-       error = 0;
+
+       security_free_mnt_opts(&data->lsm_opts);
+       nfs_free_fhandle(mntfh);
+       return mntroot;
 
 out:
        security_free_mnt_opts(&data->lsm_opts);
 out_free_fh:
        nfs_free_fhandle(mntfh);
-       return error;
+       return ERR_PTR(error);
 
 out_free:
        nfs_free_server(server);
@@ -2968,9 +2968,9 @@ static void nfs4_kill_super(struct super_block *sb)
 /*
  * Clone an NFS4 server record on xdev traversal (FSID-change)
  */
-static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
-                           const char *dev_name, void *raw_data,
-                           struct vfsmount *mnt)
+static struct dentry *
+nfs4_xdev_mount(struct file_system_type *fs_type, int flags,
+                const char *dev_name, void *raw_data)
 {
        struct nfs_clone_mount *data = raw_data;
        struct super_block *s;
@@ -2982,7 +2982,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
        };
        int error;
 
-       dprintk("--> nfs4_xdev_get_sb()\n");
+       dprintk("--> nfs4_xdev_mount()\n");
 
        /* create a new volume representation */
        server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr);
@@ -3029,32 +3029,30 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
        }
 
        s->s_flags |= MS_ACTIVE;
-       mnt->mnt_sb = s;
-       mnt->mnt_root = mntroot;
 
        security_sb_clone_mnt_opts(data->sb, s);
 
-       dprintk("<-- nfs4_xdev_get_sb() = 0\n");
-       return 0;
+       dprintk("<-- nfs4_xdev_mount() = 0\n");
+       return mntroot;
 
 out_err_nosb:
        nfs_free_server(server);
 out_err_noserver:
-       dprintk("<-- nfs4_xdev_get_sb() = %d [error]\n", error);
-       return error;
+       dprintk("<-- nfs4_xdev_mount() = %d [error]\n", error);
+       return ERR_PTR(error);
 
 error_splat_super:
        if (server && !s->s_root)
                bdi_unregister(&server->backing_dev_info);
 error_splat_bdi:
        deactivate_locked_super(s);
-       dprintk("<-- nfs4_xdev_get_sb() = %d [splat]\n", error);
-       return error;
+       dprintk("<-- nfs4_xdev_mount() = %d [splat]\n", error);
+       return ERR_PTR(error);
 }
 
-static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *raw_data,
-               struct vfsmount *mnt)
+static struct dentry *
+nfs4_remote_referral_mount(struct file_system_type *fs_type, int flags,
+                          const char *dev_name, void *raw_data)
 {
        struct nfs_clone_mount *data = raw_data;
        struct super_block *s;
@@ -3118,14 +3116,12 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
        }
 
        s->s_flags |= MS_ACTIVE;
-       mnt->mnt_sb = s;
-       mnt->mnt_root = mntroot;
 
        security_sb_clone_mnt_opts(data->sb, s);
 
        nfs_free_fhandle(mntfh);
        dprintk("<-- nfs4_referral_get_sb() = 0\n");
-       return 0;
+       return mntroot;
 
 out_err_nosb:
        nfs_free_server(server);
@@ -3133,7 +3129,7 @@ out_err_noserver:
        nfs_free_fhandle(mntfh);
 out_err_nofh:
        dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error);
-       return error;
+       return ERR_PTR(error);
 
 error_splat_super:
        if (server && !s->s_root)
@@ -3142,7 +3138,7 @@ error_splat_bdi:
        deactivate_locked_super(s);
        nfs_free_fhandle(mntfh);
        dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error);
-       return error;
+       return ERR_PTR(error);
 }
 
 /*
index 9a16bad5d2eaf4dad7d99e8b89d83576a3f163a1..7bdec8531400a8955d2292221debb83004bcd29f 100644 (file)
@@ -444,9 +444,9 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir,
 
        /* set up nfs_renamedata */
        data->old_dir = old_dir;
-       atomic_inc(&old_dir->i_count);
+       ihold(old_dir);
        data->new_dir = new_dir;
-       atomic_inc(&new_dir->i_count);
+       ihold(new_dir);
        data->old_dentry = dget(old_dentry);
        data->new_dentry = dget(new_dentry);
        nfs_fattr_init(&data->old_fattr);
index d6dc3f61f8bafdd77e3a592b26a543e42ae7d1a9..4514ebbee4d6246aac28086ecbb90a0568a01d16 100644 (file)
@@ -1405,16 +1405,16 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent)
        return simple_fill_super(sb, 0x6e667364, nfsd_files);
 }
 
-static int nfsd_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *nfsd_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, nfsd_fill_super, mnt);
+       return mount_single(fs_type, flags, data, nfsd_fill_super);
 }
 
 static struct file_system_type nfsd_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "nfsd",
-       .get_sb         = nfsd_get_sb,
+       .mount          = nfsd_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 35ae03c0db8601a2709d71b8ed29b42cb1f211e6..f804d41ec9d3b2e253972beed4ecda1fc2daf2b9 100644 (file)
@@ -1141,9 +1141,9 @@ static int nilfs_test_bdev_super(struct super_block *s, void *data)
        return (void *)s->s_bdev == data;
 }
 
-static int
-nilfs_get_sb(struct file_system_type *fs_type, int flags,
-            const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *
+nilfs_mount(struct file_system_type *fs_type, int flags,
+            const char *dev_name, void *data)
 {
        struct nilfs_super_data sd;
        struct super_block *s;
@@ -1156,7 +1156,7 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
 
        sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type);
        if (IS_ERR(sd.bdev))
-               return PTR_ERR(sd.bdev);
+               return ERR_CAST(sd.bdev);
 
        sd.cno = 0;
        sd.flags = flags;
@@ -1235,9 +1235,7 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
        if (!s_new)
                close_bdev_exclusive(sd.bdev, mode);
 
-       mnt->mnt_sb = s;
-       mnt->mnt_root = root_dentry;
-       return 0;
+       return root_dentry;
 
  failed_super:
        deactivate_locked_super(s);
@@ -1245,13 +1243,13 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
  failed:
        if (!s_new)
                close_bdev_exclusive(sd.bdev, mode);
-       return err;
+       return ERR_PTR(err);
 }
 
 struct file_system_type nilfs_fs_type = {
        .owner    = THIS_MODULE,
        .name     = "nilfs2",
-       .get_sb   = nilfs_get_sb,
+       .mount    = nilfs_mount,
        .kill_sb  = kill_block_super,
        .fs_flags = FS_REQUIRES_DEV,
 };
index d3fbe5730bfc1bb1c1264e9e3923c9425321fea0..a30ecacc01f2b1e45323517e3a01b1bbada8c05e 100644 (file)
@@ -3059,17 +3059,16 @@ struct kmem_cache *ntfs_index_ctx_cache;
 /* Driver wide mutex. */
 DEFINE_MUTEX(ntfs_lock);
 
-static int ntfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ntfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ntfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ntfs_fill_super);
 }
 
 static struct file_system_type ntfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ntfs",
-       .get_sb         = ntfs_get_sb,
+       .mount          = ntfs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 75e115f1bd730d2b12d4e1d924d203a5864d5150..b2df490a19edda212a399891a7402060dbdcaf7b 100644 (file)
@@ -643,16 +643,16 @@ static const struct inode_operations dlmfs_file_inode_operations = {
        .setattr        = dlmfs_file_setattr,
 };
 
-static int dlmfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, dlmfs_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
 }
 
 static struct file_system_type dlmfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ocfs2_dlmfs",
-       .get_sb         = dlmfs_get_sb,
+       .mount          = dlmfs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 56f0cb3958209b944ecb07a3a8262efc3b9aa75d..f02c0ef315788427e1f8b51e964f9b9dec513a10 100644 (file)
@@ -1236,14 +1236,12 @@ read_super_error:
        return status;
 }
 
-static int ocfs2_get_sb(struct file_system_type *fs_type,
+static struct dentry *ocfs2_mount(struct file_system_type *fs_type,
                        int flags,
                        const char *dev_name,
-                       void *data,
-                       struct vfsmount *mnt)
+                       void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
 }
 
 static void ocfs2_kill_sb(struct super_block *sb)
@@ -1267,8 +1265,7 @@ out:
 static struct file_system_type ocfs2_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ocfs2",
-       .get_sb         = ocfs2_get_sb, /* is this called when we mount
-                                       * the fs? */
+       .mount          = ocfs2_mount,
        .kill_sb        = ocfs2_kill_sb,
 
        .fs_flags       = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE,
index 14a22863291a6dedb60336d571c2d1b2dc069561..e043c4cb9a9729895bfd2561105f622dba9966c8 100644 (file)
@@ -557,17 +557,16 @@ end:
        return ret;
 }
 
-static int omfs_get_sb(struct file_system_type *fs_type,
-                       int flags, const char *dev_name,
-                       void *data, struct vfsmount *m)
+static struct dentry *omfs_mount(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, omfs_fill_super, m);
+       return mount_bdev(fs_type, flags, dev_name, data, omfs_fill_super);
 }
 
 static struct file_system_type omfs_fs_type = {
        .owner = THIS_MODULE,
        .name = "omfs",
-       .get_sb = omfs_get_sb,
+       .mount = omfs_mount,
        .kill_sb = kill_block_super,
        .fs_flags = FS_REQUIRES_DEV,
 };
index d74e1983e8dc478145dc8da369c0479bb947d8c2..4197b9ed023d8d1b1831ddf8f706d2a34a934aa6 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -786,11 +786,11 @@ struct file *nameidata_to_filp(struct nameidata *nd)
        /* Pick up the filp from the open intent */
        filp = nd->intent.open.file;
        /* Has the filesystem initialised the file for us? */
-       if (filp->f_path.dentry == NULL)
+       if (filp->f_path.dentry == NULL) {
+               path_get(&nd->path);
                filp = __dentry_open(nd->path.dentry, nd->path.mnt, filp,
                                     NULL, cred);
-       else
-               path_put(&nd->path);
+       }
        return filp;
 }
 
index ffcd04f0012c6aa67dcf2fa5990d4d162f835f5a..ddb1f41376e532060da94bdbcf5f12502012ed95 100644 (file)
@@ -415,16 +415,16 @@ out_no_root:
        return ret;
 }
 
-static int openprom_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *openprom_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, openprom_fill_super, mnt);
+       return mount_single(fs_type, flags, data, openprom_fill_super)
 }
 
 static struct file_system_type openprom_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "openpromfs",
-       .get_sb         = openprom_get_sb,
+       .mount          = openprom_mount,
        .kill_sb        = kill_anon_super,
 };
 
index d2d7566ce68e5cb4fc9713e531670d8f05d52d02..a8012a955720418eb059b237ac68bd98760891bb 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1247,16 +1247,15 @@ out:
  * any operations on the root directory. However, we need a non-trivial
  * d_name - pipe: will go nicely and kill the special-casing in procfs.
  */
-static int pipefs_get_sb(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data,
-                        struct vfsmount *mnt)
+static struct dentry *pipefs_mount(struct file_system_type *fs_type,
+                        int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC, mnt);
+       return mount_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC);
 }
 
 static struct file_system_type pipe_fs_type = {
        .name           = "pipefs",
-       .get_sb         = pipefs_get_sb,
+       .mount          = pipefs_mount,
        .kill_sb        = kill_anon_super,
 };
 
index 93d99b316325164758ed1d48a740f65ef9a59e9b..ef9fa8e24ad65f9b13a2a4cb989a14466ac3db8b 100644 (file)
@@ -35,8 +35,8 @@ static int proc_set_super(struct super_block *sb, void *data)
        return set_anon_super(sb, NULL);
 }
 
-static int proc_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *proc_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
        int err;
        struct super_block *sb;
@@ -61,14 +61,14 @@ static int proc_get_sb(struct file_system_type *fs_type,
 
        sb = sget(fs_type, proc_test_super, proc_set_super, ns);
        if (IS_ERR(sb))
-               return PTR_ERR(sb);
+               return ERR_CAST(sb);
 
        if (!sb->s_root) {
                sb->s_flags = flags;
                err = proc_fill_super(sb);
                if (err) {
                        deactivate_locked_super(sb);
-                       return err;
+                       return ERR_PTR(err);
                }
 
                ei = PROC_I(sb->s_root->d_inode);
@@ -79,11 +79,9 @@ static int proc_get_sb(struct file_system_type *fs_type,
                }
 
                sb->s_flags |= MS_ACTIVE;
-               ns->proc_mnt = mnt;
        }
 
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 }
 
 static void proc_kill_sb(struct super_block *sb)
@@ -97,7 +95,7 @@ static void proc_kill_sb(struct super_block *sb)
 
 static struct file_system_type proc_fs_type = {
        .name           = "proc",
-       .get_sb         = proc_get_sb,
+       .mount          = proc_mount,
        .kill_sb        = proc_kill_sb,
 };
 
@@ -115,6 +113,7 @@ void __init proc_root_init(void)
                return;
        }
 
+       init_pid_ns.proc_mnt = proc_mnt;
        proc_symlink("mounts", NULL, "self/mounts");
 
        proc_net_init();
@@ -213,6 +212,7 @@ int pid_ns_prepare_proc(struct pid_namespace *ns)
        if (IS_ERR(mnt))
                return PTR_ERR(mnt);
 
+       ns->proc_mnt = mnt;
        return 0;
 }
 
index 01bad30026fc7ea1026da00bba7bd3f507e1d468..fcada42f1aa35ad472daeb910cf8b5f0ffe2ea13 100644 (file)
@@ -454,17 +454,16 @@ static void destroy_inodecache(void)
        kmem_cache_destroy(qnx4_inode_cachep);
 }
 
-static int qnx4_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *qnx4_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, qnx4_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, qnx4_fill_super);
 }
 
 static struct file_system_type qnx4_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "qnx4",
-       .get_sb         = qnx4_get_sb,
+       .mount          = qnx4_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 67fadb1ad2c11a6428480aad801ee616d90eebac..eacb166fb25916eb1f460e99f2ad1b67f15ac4ea 100644 (file)
@@ -255,17 +255,16 @@ fail:
        return err;
 }
 
-int ramfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+struct dentry *ramfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, ramfs_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, ramfs_fill_super);
 }
 
-static int rootfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *rootfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super,
-                           mnt);
+       return mount_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super);
 }
 
 static void ramfs_kill_sb(struct super_block *sb)
@@ -276,12 +275,12 @@ static void ramfs_kill_sb(struct super_block *sb)
 
 static struct file_system_type ramfs_fs_type = {
        .name           = "ramfs",
-       .get_sb         = ramfs_get_sb,
+       .mount          = ramfs_mount,
        .kill_sb        = ramfs_kill_sb,
 };
 static struct file_system_type rootfs_fs_type = {
        .name           = "rootfs",
-       .get_sb         = rootfs_get_sb,
+       .mount          = rootfs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index e15ff612002d314ee0191d5f718bc1686a80ef3d..3bf7a6457f4d3f021db9d561a34ab7fb07bf1e01 100644 (file)
@@ -2213,12 +2213,11 @@ out:
 
 #endif
 
-static int get_super_block(struct file_system_type *fs_type,
+static struct dentry *get_super_block(struct file_system_type *fs_type,
                           int flags, const char *dev_name,
-                          void *data, struct vfsmount *mnt)
+                          void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super);
 }
 
 static int __init init_reiserfs_fs(void)
@@ -2253,7 +2252,7 @@ static void __exit exit_reiserfs_fs(void)
 struct file_system_type reiserfs_fs_type = {
        .owner = THIS_MODULE,
        .name = "reiserfs",
-       .get_sb = get_super_block,
+       .mount = get_super_block,
        .kill_sb = reiserfs_kill_sb,
        .fs_flags = FS_REQUIRES_DEV,
 };
index 268580535c92ba462a1af5983618ab0d11a321a7..6647f90e55cdcb7b96fdc41f9d63ae86a3f5e00c 100644 (file)
@@ -552,20 +552,19 @@ error_rsb:
 /*
  * get a superblock for mounting
  */
-static int romfs_get_sb(struct file_system_type *fs_type,
+static struct dentry *romfs_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data, struct vfsmount *mnt)
+                       void *data)
 {
-       int ret = -EINVAL;
+       struct dentry *ret = ERR_PTR(-EINVAL);
 
 #ifdef CONFIG_ROMFS_ON_MTD
-       ret = get_sb_mtd(fs_type, flags, dev_name, data, romfs_fill_super,
-                        mnt);
+       ret = mount_mtd(fs_type, flags, dev_name, data, romfs_fill_super);
 #endif
 #ifdef CONFIG_ROMFS_ON_BLOCK
-       if (ret == -EINVAL)
-               ret = get_sb_bdev(fs_type, flags, dev_name, data,
-                                 romfs_fill_super, mnt);
+       if (ret == ERR_PTR(-EINVAL))
+               ret = mount_bdev(fs_type, flags, dev_name, data,
+                                 romfs_fill_super);
 #endif
        return ret;
 }
@@ -592,7 +591,7 @@ static void romfs_kill_sb(struct super_block *sb)
 static struct file_system_type romfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "romfs",
-       .get_sb         = romfs_get_sb,
+       .mount          = romfs_mount,
        .kill_sb        = romfs_kill_sb,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 07a4f115604850d77191baed3a7fd96c7d161661..24de30ba34c18ba4b194ff030a4ec591f25aa75d 100644 (file)
@@ -370,12 +370,10 @@ static void squashfs_put_super(struct super_block *sb)
 }
 
 
-static int squashfs_get_sb(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *data,
-                               struct vfsmount *mnt)
+static struct dentry *squashfs_mount(struct file_system_type *fs_type, int flags,
+                               const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super,
-                               mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, squashfs_fill_super);
 }
 
 
@@ -451,7 +449,7 @@ static void squashfs_destroy_inode(struct inode *inode)
 static struct file_system_type squashfs_fs_type = {
        .owner = THIS_MODULE,
        .name = "squashfs",
-       .get_sb = squashfs_get_sb,
+       .mount = squashfs_mount,
        .kill_sb = kill_block_super,
        .fs_flags = FS_REQUIRES_DEV
 };
index b9c9869165db359d018134e99e0a39e2738e6dba..ca696155cd9aea65d527af3e8d25a8bdc9cc40f0 100644 (file)
@@ -715,15 +715,14 @@ static int ns_set_super(struct super_block *sb, void *data)
        return set_anon_super(sb, NULL);
 }
 
-int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int),
-       struct vfsmount *mnt)
+struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
+       void *data, int (*fill_super)(struct super_block *, void *, int))
 {
        struct super_block *sb;
 
        sb = sget(fs_type, ns_test_super, ns_set_super, data);
        if (IS_ERR(sb))
-               return PTR_ERR(sb);
+               return ERR_CAST(sb);
 
        if (!sb->s_root) {
                int err;
@@ -731,17 +730,16 @@ int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
                err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
                if (err) {
                        deactivate_locked_super(sb);
-                       return err;
+                       return ERR_PTR(err);
                }
 
                sb->s_flags |= MS_ACTIVE;
        }
 
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 }
 
-EXPORT_SYMBOL(get_sb_ns);
+EXPORT_SYMBOL(mount_ns);
 
 #ifdef CONFIG_BLOCK
 static int set_bdev_super(struct super_block *s, void *data)
@@ -762,10 +760,9 @@ static int test_bdev_super(struct super_block *s, void *data)
        return (void *)s->s_bdev == data;
 }
 
-int get_sb_bdev(struct file_system_type *fs_type,
+struct dentry *mount_bdev(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data,
-       int (*fill_super)(struct super_block *, void *, int),
-       struct vfsmount *mnt)
+       int (*fill_super)(struct super_block *, void *, int))
 {
        struct block_device *bdev;
        struct super_block *s;
@@ -777,7 +774,7 @@ int get_sb_bdev(struct file_system_type *fs_type,
 
        bdev = open_bdev_exclusive(dev_name, mode, fs_type);
        if (IS_ERR(bdev))
-               return PTR_ERR(bdev);
+               return ERR_CAST(bdev);
 
        /*
         * once the super is inserted into the list by sget, s_umount
@@ -829,15 +826,30 @@ int get_sb_bdev(struct file_system_type *fs_type,
                bdev->bd_super = s;
        }
 
-       simple_set_mnt(mnt, s);
-       return 0;
+       return dget(s->s_root);
 
 error_s:
        error = PTR_ERR(s);
 error_bdev:
        close_bdev_exclusive(bdev, mode);
 error:
-       return error;
+       return ERR_PTR(error);
+}
+EXPORT_SYMBOL(mount_bdev);
+
+int get_sb_bdev(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data,
+       int (*fill_super)(struct super_block *, void *, int),
+       struct vfsmount *mnt)
+{
+       struct dentry *root;
+
+       root = mount_bdev(fs_type, flags, dev_name, 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_bdev);
@@ -856,29 +868,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)
@@ -886,29 +911,42 @@ static int compare_single(struct super_block *s, void *p)
        return 1;
 }
 
-int get_sb_single(struct file_system_type *fs_type,
+struct dentry *mount_single(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))
 {
        struct super_block *s;
        int error;
 
        s = sget(fs_type, compare_single, set_anon_super, NULL);
        if (IS_ERR(s))
-               return PTR_ERR(s);
+               return ERR_CAST(s);
        if (!s->s_root) {
                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;
        } else {
                do_remount_sb(s, flags, data, 0);
        }
-       simple_set_mnt(mnt, s);
+       return dget(s->s_root);
+}
+EXPORT_SYMBOL(mount_single);
+
+int get_sb_single(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_single(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;
 }
 
@@ -918,6 +956,7 @@ struct vfsmount *
 vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
 {
        struct vfsmount *mnt;
+       struct dentry *root;
        char *secdata = NULL;
        int error;
 
@@ -942,9 +981,19 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
                        goto out_free_secdata;
        }
 
-       error = type->get_sb(type, flags, name, data, mnt);
-       if (error < 0)
-               goto out_free_secdata;
+       if (type->mount) {
+               root = type->mount(type, flags, name, data);
+               if (IS_ERR(root)) {
+                       error = PTR_ERR(root);
+                       goto out_free_secdata;
+               }
+               mnt->mnt_root = root;
+               mnt->mnt_sb = root->d_sb;
+       } else {
+               error = type->get_sb(type, flags, name, data, mnt);
+               if (error < 0)
+                       goto out_free_secdata;
+       }
        BUG_ON(!mnt->mnt_sb);
        WARN_ON(!mnt->mnt_sb->s_bdi);
        mnt->mnt_sb->s_flags |= MS_BORN;
index f2af22574c50978865afc939d6d9a3a853ebdf3c..266895783b477a94e64248217483ec52f02c75fb 100644 (file)
@@ -23,7 +23,7 @@
 #include "sysfs.h"
 
 
-static struct vfsmount *sysfs_mount;
+static struct vfsmount *sysfs_mnt;
 struct kmem_cache *sysfs_dir_cachep;
 
 static const struct super_operations sysfs_ops = {
@@ -95,18 +95,17 @@ static int sysfs_set_super(struct super_block *sb, void *data)
        return error;
 }
 
-static int sysfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *sysfs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
        struct sysfs_super_info *info;
        enum kobj_ns_type type;
        struct super_block *sb;
        int error;
 
-       error = -ENOMEM;
        info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
-               goto out;
+               return ERR_PTR(-ENOMEM);
 
        for (type = KOBJ_NS_TYPE_NONE; type < KOBJ_NS_TYPES; type++)
                info->ns[type] = kobj_ns_current(type);
@@ -114,24 +113,19 @@ static int sysfs_get_sb(struct file_system_type *fs_type,
        sb = sget(fs_type, sysfs_test_super, sysfs_set_super, info);
        if (IS_ERR(sb) || sb->s_fs_info != info)
                kfree(info);
-       if (IS_ERR(sb)) {
-               error = PTR_ERR(sb);
-               goto out;
-       }
+       if (IS_ERR(sb))
+               return ERR_CAST(sb);
        if (!sb->s_root) {
                sb->s_flags = flags;
                error = sysfs_fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
                if (error) {
                        deactivate_locked_super(sb);
-                       goto out;
+                       return ERR_PTR(error);
                }
                sb->s_flags |= MS_ACTIVE;
        }
 
-       simple_set_mnt(mnt, sb);
-       error = 0;
-out:
-       return error;
+       return dget(sb->s_root);
 }
 
 static void sysfs_kill_sb(struct super_block *sb)
@@ -147,7 +141,7 @@ static void sysfs_kill_sb(struct super_block *sb)
 
 static struct file_system_type sysfs_fs_type = {
        .name           = "sysfs",
-       .get_sb         = sysfs_get_sb,
+       .mount          = sysfs_mount,
        .kill_sb        = sysfs_kill_sb,
 };
 
@@ -189,11 +183,11 @@ int __init sysfs_init(void)
 
        err = register_filesystem(&sysfs_fs_type);
        if (!err) {
-               sysfs_mount = kern_mount(&sysfs_fs_type);
-               if (IS_ERR(sysfs_mount)) {
+               sysfs_mnt = kern_mount(&sysfs_fs_type);
+               if (IS_ERR(sysfs_mnt)) {
                        printk(KERN_ERR "sysfs: could not mount!\n");
-                       err = PTR_ERR(sysfs_mount);
-                       sysfs_mount = NULL;
+                       err = PTR_ERR(sysfs_mnt);
+                       sysfs_mnt = NULL;
                        unregister_filesystem(&sysfs_fs_type);
                        goto out_err;
                }
index a0b0cda6927ea467a7ccf73c94bbe9b80a04d004..3d9c62be0c10ebc051d64951836ba366a3586018 100644 (file)
@@ -526,23 +526,22 @@ failed:
 
 /* Every kernel module contains stuff like this. */
 
-static int sysv_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *sysv_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, sysv_fill_super);
 }
 
-static int v7_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *v7_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, v7_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, v7_fill_super);
 }
 
 static struct file_system_type sysv_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "sysv",
-       .get_sb         = sysv_get_sb,
+       .mount          = sysv_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
@@ -550,7 +549,7 @@ static struct file_system_type sysv_fs_type = {
 static struct file_system_type v7_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "v7",
-       .get_sb         = v7_get_sb,
+       .mount          = v7_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 9a47c9f0ad07e69fddc57f5debc488982aab9429..91fac54c70e32b3a304c5060fbaa3de68995f5e4 100644 (file)
@@ -2038,8 +2038,8 @@ static int sb_test(struct super_block *sb, void *data)
        return c->vi.cdev == *dev;
 }
 
-static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
-                       const char *name, void *data, struct vfsmount *mnt)
+static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
+                       const char *name, void *data)
 {
        struct ubi_volume_desc *ubi;
        struct ubi_volume_info vi;
@@ -2057,7 +2057,7 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
        if (IS_ERR(ubi)) {
                dbg_err("cannot open \"%s\", error %d",
                        name, (int)PTR_ERR(ubi));
-               return PTR_ERR(ubi);
+               return ERR_CAST(ubi);
        }
        ubi_get_volume_info(ubi, &vi);
 
@@ -2095,20 +2095,19 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
        /* 'fill_super()' opens ubi again so we must close it here */
        ubi_close_volume(ubi);
 
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 
 out_deact:
        deactivate_locked_super(sb);
 out_close:
        ubi_close_volume(ubi);
-       return err;
+       return ERR_PTR(err);
 }
 
 static struct file_system_type ubifs_fs_type = {
        .name    = "ubifs",
        .owner   = THIS_MODULE,
-       .get_sb  = ubifs_get_sb,
+       .mount   = ubifs_mount,
        .kill_sb = kill_anon_super,
 };
 
index 76f3d6d97b402ea14c391c46b8a924af9888cc6c..4a5c7c61836aaf6a1224740eefe607b886929c9e 100644 (file)
@@ -107,17 +107,16 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
 }
 
 /* UDF filesystem type */
-static int udf_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data,
-                     struct vfsmount *mnt)
+static struct dentry *udf_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, udf_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, udf_fill_super);
 }
 
 static struct file_system_type udf_fstype = {
        .owner          = THIS_MODULE,
        .name           = "udf",
-       .get_sb         = udf_get_sb,
+       .mount          = udf_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index 6b9be90dae7dd7affc1ccba35c02bd9fac193570..2c47daed56dac7f2ad789a41a2d1e19fc929a49b 100644 (file)
@@ -1454,16 +1454,16 @@ static const struct super_operations ufs_super_ops = {
        .show_options   = ufs_show_options,
 };
 
-static int ufs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *ufs_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, ufs_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, ufs_fill_super);
 }
 
 static struct file_system_type ufs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ufs",
-       .get_sb         = ufs_get_sb,
+       .mount          = ufs_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
index cf808782c0650d86e967e149a8fac2baf80dd093..9f3a78fe6ae4e1f8463129d0d8ef5967bdde2408 100644 (file)
@@ -1609,16 +1609,14 @@ xfs_fs_fill_super(
        goto out_free_sb;
 }
 
-STATIC int
-xfs_fs_get_sb(
+STATIC struct dentry *
+xfs_fs_mount(
        struct file_system_type *fs_type,
        int                     flags,
        const char              *dev_name,
-       void                    *data,
-       struct vfsmount         *mnt)
+       void                    *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super,
-                          mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super);
 }
 
 static const struct super_operations xfs_super_operations = {
@@ -1639,7 +1637,7 @@ static const struct super_operations xfs_super_operations = {
 static struct file_system_type xfs_fs_type = {
        .owner                  = THIS_MODULE,
        .name                   = "xfs",
-       .get_sb                 = xfs_fs_get_sb,
+       .mount                  = xfs_fs_mount,
        .kill_sb                = kill_block_super,
        .fs_flags               = FS_REQUIRES_DEV,
 };
index 1c73b50e81ffbb2f67014e93fdbc0143a414b7ff..4d07902bc50c0e11dff997ffa16c4aa6e449c214 100644 (file)
@@ -1772,6 +1772,8 @@ struct file_system_type {
        int fs_flags;
        int (*get_sb) (struct file_system_type *, int,
                       const char *, void *, struct vfsmount *);
+       struct dentry *(*mount) (struct file_system_type *, int,
+                      const char *, void *);
        void (*kill_sb) (struct super_block *);
        struct module *owner;
        struct file_system_type * next;
@@ -1787,17 +1789,25 @@ struct file_system_type {
        struct lock_class_key i_alloc_sem_key;
 };
 
-extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int),
-       struct vfsmount *mnt);
+extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
+       void *data, int (*fill_super)(struct super_block *, void *, int));
+extern struct dentry *mount_bdev(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data,
+       int (*fill_super)(struct super_block *, void *, int));
 extern int get_sb_bdev(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data,
        int (*fill_super)(struct super_block *, void *, int),
        struct vfsmount *mnt);
+extern struct dentry *mount_single(struct file_system_type *fs_type,
+       int flags, void *data,
+       int (*fill_super)(struct super_block *, void *, int));
 extern int get_sb_single(struct file_system_type *fs_type,
        int flags, void *data,
        int (*fill_super)(struct super_block *, void *, int),
        struct vfsmount *mnt);
+extern struct dentry *mount_nodev(struct file_system_type *fs_type,
+       int flags, void *data,
+       int (*fill_super)(struct super_block *, void *, int));
 extern int get_sb_nodev(struct file_system_type *fs_type,
        int flags, void *data,
        int (*fill_super)(struct super_block *, void *, int),
@@ -1813,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
                        void *data);
-extern int get_sb_pseudo(struct file_system_type *, char *,
-       const struct super_operations *ops, unsigned long,
-       struct vfsmount *mnt);
+extern struct dentry *mount_pseudo(struct file_system_type *, char *,
+       const struct super_operations *ops, unsigned long);
 extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
 
 static inline void sb_mark_dirty(struct super_block *sb)
index 4016dd6fe336dfd0fbd81f371649f80b573ac851..f456230f9330b0c5bef26a4010e8f524eb38dbc2 100644 (file)
 #include <linux/fs.h>
 #include <linux/mount.h>
 
-extern int get_sb_mtd(struct file_system_type *fs_type, int flags,
+extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
                      const char *dev_name, void *data,
-                     int (*fill_super)(struct super_block *, void *, int),
-                     struct vfsmount *mnt);
+                     int (*fill_super)(struct super_block *, void *, int));
 extern void kill_mtd_super(struct super_block *sb);
 
 
index e7320b5e82fb4ac956f1cd0951488ddf1bc44637..3a8f0c9b29336f09acbd70ec1bbb01ce3ac5dfb1 100644 (file)
@@ -3,8 +3,8 @@
 
 struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
         int mode, dev_t dev);
-extern int ramfs_get_sb(struct file_system_type *fs_type,
-        int flags, const char *dev_name, void *data, struct vfsmount *mnt);
+extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
+        int flags, const char *dev_name, void *data);
 
 #ifndef CONFIG_MMU
 extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
index 3a61ffefe88472af269e0bc218d6f8eb2959a1c9..035f4399edbcb8fd277285ac283db95c4188f8d5 100644 (file)
@@ -211,13 +211,13 @@ out:
        return error;
 }
 
-static int mqueue_get_sb(struct file_system_type *fs_type,
+static struct dentry *mqueue_mount(struct file_system_type *fs_type,
                         int flags, const char *dev_name,
-                        void *data, struct vfsmount *mnt)
+                        void *data)
 {
        if (!(flags & MS_KERNMOUNT))
                data = current->nsproxy->ipc_ns;
-       return get_sb_ns(fs_type, flags, data, mqueue_fill_super, mnt);
+       return mount_ns(fs_type, flags, data, mqueue_fill_super);
 }
 
 static void init_once(void *foo)
@@ -1232,7 +1232,7 @@ static const struct super_operations mqueue_super_ops = {
 
 static struct file_system_type mqueue_fs_type = {
        .name = "mqueue",
-       .get_sb = mqueue_get_sb,
+       .mount = mqueue_mount,
        .kill_sb = kill_litter_super,
 };
 
index 5cf366965d0ca5ec8766781367135838f3b2eac0..66a416b42c18bf01aaa61fecbad64c965c530e45 100644 (file)
@@ -1460,9 +1460,9 @@ static int cgroup_get_rootdir(struct super_block *sb)
        return 0;
 }
 
-static int cgroup_get_sb(struct file_system_type *fs_type,
+static struct dentry *cgroup_mount(struct file_system_type *fs_type,
                         int flags, const char *unused_dev_name,
-                        void *data, struct vfsmount *mnt)
+                        void *data)
 {
        struct cgroup_sb_opts opts;
        struct cgroupfs_root *root;
@@ -1596,10 +1596,9 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
                drop_parsed_module_refcounts(opts.subsys_bits);
        }
 
-       simple_set_mnt(mnt, sb);
        kfree(opts.release_agent);
        kfree(opts.name);
-       return 0;
+       return dget(sb->s_root);
 
  drop_new_super:
        deactivate_locked_super(sb);
@@ -1608,7 +1607,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
  out_err:
        kfree(opts.release_agent);
        kfree(opts.name);
-       return ret;
+       return ERR_PTR(ret);
 }
 
 static void cgroup_kill_sb(struct super_block *sb) {
@@ -1658,7 +1657,7 @@ static void cgroup_kill_sb(struct super_block *sb) {
 
 static struct file_system_type cgroup_fs_type = {
        .name = "cgroup",
-       .get_sb = cgroup_get_sb,
+       .mount = cgroup_mount,
        .kill_sb = cgroup_kill_sb,
 };
 
index 51b143e2a07a49603d9aa462728f6a45032c01d9..4349935c2ad8b1a252e18ce18a2be8b638a6a075 100644 (file)
@@ -231,18 +231,17 @@ static DEFINE_SPINLOCK(cpuset_buffer_lock);
  * users. If someone tries to mount the "cpuset" filesystem, we
  * silently switch it to mount "cgroup" instead
  */
-static int cpuset_get_sb(struct file_system_type *fs_type,
-                        int flags, const char *unused_dev_name,
-                        void *data, struct vfsmount *mnt)
+static struct dentry *cpuset_mount(struct file_system_type *fs_type,
+                        int flags, const char *unused_dev_name, void *data)
 {
        struct file_system_type *cgroup_fs = get_fs_type("cgroup");
-       int ret = -ENODEV;
+       struct dentry *ret = ERR_PTR(-ENODEV);
        if (cgroup_fs) {
                char mountopts[] =
                        "cpuset,noprefix,"
                        "release_agent=/sbin/cpuset_release_agent";
-               ret = cgroup_fs->get_sb(cgroup_fs, flags,
-                                          unused_dev_name, mountopts, mnt);
+               ret = cgroup_fs->mount(cgroup_fs, flags,
+                                          unused_dev_name, mountopts);
                put_filesystem(cgroup_fs);
        }
        return ret;
@@ -250,7 +249,7 @@ static int cpuset_get_sb(struct file_system_type *fs_type,
 
 static struct file_system_type cpuset_fs_type = {
        .name = "cpuset",
-       .get_sb = cpuset_get_sb,
+       .mount = cpuset_mount,
 };
 
 /*
index f6d350e8adc56da67313a782569e81c34af27286..47fdeeb9d63685e708d2775216768dfc49f735dc 100644 (file)
@@ -2538,16 +2538,16 @@ static const struct vm_operations_struct shmem_vm_ops = {
 };
 
 
-static int shmem_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *shmem_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, shmem_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, shmem_fill_super);
 }
 
 static struct file_system_type tmpfs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "tmpfs",
-       .get_sb         = shmem_get_sb,
+       .mount          = shmem_mount,
        .kill_sb        = kill_litter_super,
 };
 
@@ -2643,7 +2643,7 @@ out:
 
 static struct file_system_type tmpfs_fs_type = {
        .name           = "tmpfs",
-       .get_sb         = ramfs_get_sb,
+       .mount          = ramfs_mount,
        .kill_sb        = kill_litter_super,
 };
 
index ee3cd280c76e9cfb58024fa22f3017352f0467bc..5247ae10f374e9a9fe2331d8e1ad0c83f0da6f32 100644 (file)
@@ -305,19 +305,17 @@ static const struct super_operations sockfs_ops = {
        .statfs         = simple_statfs,
 };
 
-static int sockfs_get_sb(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data,
-                        struct vfsmount *mnt)
+static struct dentry *sockfs_mount(struct file_system_type *fs_type,
+                        int flags, const char *dev_name, void *data)
 {
-       return get_sb_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC,
-                            mnt);
+       return mount_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC);
 }
 
 static struct vfsmount *sock_mnt __read_mostly;
 
 static struct file_system_type sock_fs_type = {
        .name =         "sockfs",
-       .get_sb =       sockfs_get_sb,
+       .mount =        sockfs_mount,
        .kill_sb =      kill_anon_super,
 };
 
index 7df92d237cb8103171a892f49a98aaca1cd05e49..10a17a37ec4e90c683588de990670288136cc793 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/sunrpc/rpc_pipe_fs.h>
 #include <linux/sunrpc/cache.h>
 
-static struct vfsmount *rpc_mount __read_mostly;
+static struct vfsmount *rpc_mnt __read_mostly;
 static int rpc_mount_count;
 
 static struct file_system_type rpc_pipe_fs_type;
@@ -417,16 +417,16 @@ struct vfsmount *rpc_get_mount(void)
 {
        int err;
 
-       err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count);
+       err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mnt, &rpc_mount_count);
        if (err != 0)
                return ERR_PTR(err);
-       return rpc_mount;
+       return rpc_mnt;
 }
 EXPORT_SYMBOL_GPL(rpc_get_mount);
 
 void rpc_put_mount(void)
 {
-       simple_release_fs(&rpc_mount, &rpc_mount_count);
+       simple_release_fs(&rpc_mnt, &rpc_mount_count);
 }
 EXPORT_SYMBOL_GPL(rpc_put_mount);
 
@@ -1018,17 +1018,17 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int
-rpc_get_sb(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *
+rpc_mount(struct file_system_type *fs_type,
+               int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, rpc_fill_super, mnt);
+       return mount_single(fs_type, flags, data, rpc_fill_super);
 }
 
 static struct file_system_type rpc_pipe_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "rpc_pipefs",
-       .get_sb         = rpc_get_sb,
+       .mount          = rpc_mount,
        .kill_sb        = kill_litter_super,
 };
 
index cb8f47c66a58bb7eb11c0a75319f378261393f14..c4df2fbebe6b34aa1789bd6a82450196f8ebf365 100644 (file)
@@ -131,17 +131,17 @@ static int fill_super(struct super_block *sb, void *data, int silent)
        return simple_fill_super(sb, SECURITYFS_MAGIC, files);
 }
 
-static int get_sb(struct file_system_type *fs_type,
+static struct dentry *get_sb(struct file_system_type *fs_type,
                  int flags, const char *dev_name,
-                 void *data, struct vfsmount *mnt)
+                 void *data)
 {
-       return get_sb_single(fs_type, flags, data, fill_super, mnt);
+       return mount_single(fs_type, flags, data, fill_super);
 }
 
 static struct file_system_type fs_type = {
        .owner =        THIS_MODULE,
        .name =         "securityfs",
-       .get_sb =       get_sb,
+       .mount =        get_sb,
        .kill_sb =      kill_litter_super,
 };
 
index 55a755c1a1bd9546a4655e83351cc93bc92cf655..073fd5b0a53ad3cc7324e83bfaec6275633977f4 100644 (file)
@@ -1909,16 +1909,15 @@ err:
        goto out;
 }
 
-static int sel_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data,
-                     struct vfsmount *mnt)
+static struct dentry *sel_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, sel_fill_super, mnt);
+       return mount_single(fs_type, flags, data, sel_fill_super);
 }
 
 static struct file_system_type sel_fs_type = {
        .name           = "selinuxfs",
-       .get_sb         = sel_get_sb,
+       .mount          = sel_mount,
        .kill_sb        = kill_litter_super,
 };
 
index 7512502d0162b6be0afc54f874e88f407b8470c6..dc1fd6239f243ad1f4e254db0ead6707a1d7c077 100644 (file)
@@ -1310,27 +1310,25 @@ static int smk_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 /**
- * smk_get_sb - get the smackfs superblock
+ * smk_mount - get the smackfs superblock
  * @fs_type: passed along without comment
  * @flags: passed along without comment
  * @dev_name: passed along without comment
  * @data: passed along without comment
- * @mnt: passed along without comment
  *
  * Just passes everything along.
  *
  * Returns what the lower level code does.
  */
-static int smk_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data,
-                     struct vfsmount *mnt)
+static struct dentry *smk_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, smk_fill_super, mnt);
+       return mount_single(fs_type, flags, data, smk_fill_super);
 }
 
 static struct file_system_type smk_fs_type = {
        .name           = "smackfs",
-       .get_sb         = smk_get_sb,
+       .mount          = smk_mount,
        .kill_sb        = kill_litter_super,
 };