aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-24 16:17:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-29 04:15:06 -0400
commitc96e41e92b4aaf11e1f9775ecf0d1c8cbff829ed (patch)
tree5c24ad8aa541018a51e1704dccfc370116bb932f /fs/super.c
parentd893f1bc2a9f0f7dcb4b433452c59f9bedac0d7d (diff)
beginning of transtion: ->mount()
eventual replacement for ->get_sb() - does *not* get vfsmount, return ERR_PTR(error) or root of subtree to be mounted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/super.c b/fs/super.c
index b9c9869165db..00a2c9662b55 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -918,6 +918,7 @@ struct vfsmount *
918vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data) 918vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
919{ 919{
920 struct vfsmount *mnt; 920 struct vfsmount *mnt;
921 struct dentry *root;
921 char *secdata = NULL; 922 char *secdata = NULL;
922 int error; 923 int error;
923 924
@@ -942,9 +943,19 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
942 goto out_free_secdata; 943 goto out_free_secdata;
943 } 944 }
944 945
945 error = type->get_sb(type, flags, name, data, mnt); 946 if (type->mount) {
946 if (error < 0) 947 root = type->mount(type, flags, name, data);
947 goto out_free_secdata; 948 if (IS_ERR(root)) {
949 error = PTR_ERR(root);
950 goto out_free_secdata;
951 }
952 mnt->mnt_root = root;
953 mnt->mnt_sb = root->d_sb;
954 } else {
955 error = type->get_sb(type, flags, name, data, mnt);
956 if (error < 0)
957 goto out_free_secdata;
958 }
948 BUG_ON(!mnt->mnt_sb); 959 BUG_ON(!mnt->mnt_sb);
949 WARN_ON(!mnt->mnt_sb->s_bdi); 960 WARN_ON(!mnt->mnt_sb->s_bdi);
950 mnt->mnt_sb->s_flags |= MS_BORN; 961 mnt->mnt_sb->s_flags |= MS_BORN;