Commit c96e41e92b4aaf11e1f9775ecf0d1c8cbff829ed
1 parent
d893f1bc2a
Exists in
master
and in
4 other branches
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>
Showing 2 changed files with 16 additions and 3 deletions Side-by-side Diff
fs/super.c
... | ... | @@ -918,6 +918,7 @@ |
918 | 918 | vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data) |
919 | 919 | { |
920 | 920 | struct vfsmount *mnt; |
921 | + struct dentry *root; | |
921 | 922 | char *secdata = NULL; |
922 | 923 | int error; |
923 | 924 | |
... | ... | @@ -942,9 +943,19 @@ |
942 | 943 | goto out_free_secdata; |
943 | 944 | } |
944 | 945 | |
945 | - error = type->get_sb(type, flags, name, data, mnt); | |
946 | - if (error < 0) | |
947 | - goto out_free_secdata; | |
946 | + if (type->mount) { | |
947 | + root = type->mount(type, flags, name, data); | |
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 | 959 | BUG_ON(!mnt->mnt_sb); |
949 | 960 | WARN_ON(!mnt->mnt_sb->s_bdi); |
950 | 961 | mnt->mnt_sb->s_flags |= MS_BORN; |
include/linux/fs.h
... | ... | @@ -1772,6 +1772,8 @@ |
1772 | 1772 | int fs_flags; |
1773 | 1773 | int (*get_sb) (struct file_system_type *, int, |
1774 | 1774 | const char *, void *, struct vfsmount *); |
1775 | + struct dentry *(*mount) (struct file_system_type *, int, | |
1776 | + const char *, void *); | |
1775 | 1777 | void (*kill_sb) (struct super_block *); |
1776 | 1778 | struct module *owner; |
1777 | 1779 | struct file_system_type * next; |