Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c96e41e9 authored by Al Viro's avatar Al Viro
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent d893f1bc
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -918,6 +918,7 @@ struct vfsmount *
vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
{
{
	struct vfsmount *mnt;
	struct vfsmount *mnt;
	struct dentry *root;
	char *secdata = NULL;
	char *secdata = NULL;
	int error;
	int error;


@@ -942,9 +943,19 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
			goto out_free_secdata;
			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);
		error = type->get_sb(type, flags, name, data, mnt);
		if (error < 0)
		if (error < 0)
			goto out_free_secdata;
			goto out_free_secdata;
	}
	BUG_ON(!mnt->mnt_sb);
	BUG_ON(!mnt->mnt_sb);
	WARN_ON(!mnt->mnt_sb->s_bdi);
	WARN_ON(!mnt->mnt_sb->s_bdi);
	mnt->mnt_sb->s_flags |= MS_BORN;
	mnt->mnt_sb->s_flags |= MS_BORN;
+2 −0
Original line number Original line Diff line number Diff line
@@ -1772,6 +1772,8 @@ struct file_system_type {
	int fs_flags;
	int fs_flags;
	int (*get_sb) (struct file_system_type *, int,
	int (*get_sb) (struct file_system_type *, int,
		       const char *, void *, struct vfsmount *);
		       const char *, void *, struct vfsmount *);
	struct dentry *(*mount) (struct file_system_type *, int,
		       const char *, void *);
	void (*kill_sb) (struct super_block *);
	void (*kill_sb) (struct super_block *);
	struct module *owner;
	struct module *owner;
	struct file_system_type * next;
	struct file_system_type * next;