summaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-25 00: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)
downloadop-kernel-dev-c96e41e92b4aaf11e1f9775ecf0d1c8cbff829ed.zip
op-kernel-dev-c96e41e92b4aaf11e1f9775ecf0d1c8cbff829ed.tar.gz
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 b9c9869..00a2c96 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -918,6 +918,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 +943,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;
OpenPOWER on IntegriCloud