Skip to content

Commit ceefda6

Browse files
author
Al Viro
committed
switch get_sb_ns() users
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent aed1d84 commit ceefda6

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

‎fs/super.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,33 +715,31 @@ static int ns_set_super(struct super_block *sb, void *data)
715715
return set_anon_super(sb, NULL);
716716
}
717717

718-
int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
719-
int (*fill_super)(struct super_block *, void *, int),
720-
struct vfsmount *mnt)
718+
struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
719+
void *data, int (*fill_super)(struct super_block *, void *, int))
721720
{
722721
struct super_block *sb;
723722

724723
sb = sget(fs_type, ns_test_super, ns_set_super, data);
725724
if (IS_ERR(sb))
726-
return PTR_ERR(sb);
725+
return ERR_CAST(sb);
727726

728727
if (!sb->s_root) {
729728
int err;
730729
sb->s_flags = flags;
731730
err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
732731
if (err) {
733732
deactivate_locked_super(sb);
734-
return err;
733+
return ERR_PTR(err);
735734
}
736735

737736
sb->s_flags |= MS_ACTIVE;
738737
}
739738

740-
simple_set_mnt(mnt, sb);
741-
return 0;
739+
return dget(sb->s_root);
742740
}
743741

744-
EXPORT_SYMBOL(get_sb_ns);
742+
EXPORT_SYMBOL(mount_ns);
745743

746744
#ifdef CONFIG_BLOCK
747745
static int set_bdev_super(struct super_block *s, void *data)

‎include/linux/fs.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,9 +1789,8 @@ struct file_system_type {
17891789
struct lock_class_key i_alloc_sem_key;
17901790
};
17911791

1792-
extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
1793-
int (*fill_super)(struct super_block *, void *, int),
1794-
struct vfsmount *mnt);
1792+
extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
1793+
void *data, int (*fill_super)(struct super_block *, void *, int));
17951794
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
17961795
int flags, const char *dev_name, void *data,
17971796
int (*fill_super)(struct super_block *, void *, int));

‎ipc/mqueue.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
211211
return error;
212212
}
213213

214-
static int mqueue_get_sb(struct file_system_type *fs_type,
214+
static struct dentry *mqueue_mount(struct file_system_type *fs_type,
215215
int flags, const char *dev_name,
216-
void *data, struct vfsmount *mnt)
216+
void *data)
217217
{
218218
if (!(flags & MS_KERNMOUNT))
219219
data = current->nsproxy->ipc_ns;
220-
return get_sb_ns(fs_type, flags, data, mqueue_fill_super, mnt);
220+
return mount_ns(fs_type, flags, data, mqueue_fill_super);
221221
}
222222

223223
static void init_once(void *foo)
@@ -1232,7 +1232,7 @@ static const struct super_operations mqueue_super_ops = {
12321232

12331233
static struct file_system_type mqueue_fs_type = {
12341234
.name = "mqueue",
1235-
.get_sb = mqueue_get_sb,
1235+
.mount = mqueue_mount,
12361236
.kill_sb = kill_litter_super,
12371237
};
12381238

0 commit comments

Comments
 (0)