Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
return set_anon_super(sb, NULL);
}
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))
{
struct super_block *sb;
sb = sget(fs_type, ns_test_super, ns_set_super, data);
if (IS_ERR(sb))
if (!sb->s_root) {
int err;
if (!sb->s_root) {
int err;
err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
if (err) {
deactivate_locked_super(sb);
err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
if (err) {
deactivate_locked_super(sb);
}
sb->s_flags |= MS_ACTIVE;
}
}
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)
#ifdef CONFIG_BLOCK
static int set_bdev_super(struct super_block *s, void *data)
struct lock_class_key i_alloc_sem_key;
};
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 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));
-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,
int flags, const char *dev_name,
- void *data, struct vfsmount *mnt)
{
if (!(flags & MS_KERNMOUNT))
data = current->nsproxy->ipc_ns;
{
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)
}
static void init_once(void *foo)
static struct file_system_type mqueue_fs_type = {
.name = "mqueue",
static struct file_system_type mqueue_fs_type = {
.name = "mqueue",
- .get_sb = mqueue_get_sb,
.kill_sb = kill_litter_super,
};
.kill_sb = kill_litter_super,
};