Skip to content

Commit

Permalink
convenience helper get_tree_nodev()
Browse files Browse the repository at this point in the history
counterpart of mount_nodev().  Switch hugetlb and pseudo to it.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jul 5, 2019
1 parent 023d066 commit 2ac295d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ static int hugetlbfs_get_tree(struct fs_context *fc)
int err = hugetlbfs_validate(fc);
if (err)
return err;
return vfs_get_super(fc, vfs_get_independent_super, hugetlbfs_fill_super);
return get_tree_nodev(fc, hugetlbfs_fill_super);
}

static void hugetlbfs_fs_context_free(struct fs_context *fc)
Expand Down
2 changes: 1 addition & 1 deletion fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static int pseudo_fs_fill_super(struct super_block *s, struct fs_context *fc)

static int pseudo_fs_get_tree(struct fs_context *fc)
{
return vfs_get_super(fc, vfs_get_independent_super, pseudo_fs_fill_super);
return get_tree_nodev(fc, pseudo_fs_fill_super);
}

static void pseudo_fs_free(struct fs_context *fc)
Expand Down
8 changes: 8 additions & 0 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,14 @@ int vfs_get_super(struct fs_context *fc,
}
EXPORT_SYMBOL(vfs_get_super);

int get_tree_nodev(struct fs_context *fc,
int (*fill_super)(struct super_block *sb,
struct fs_context *fc))
{
return vfs_get_super(fc, vfs_get_independent_super, fill_super);
}
EXPORT_SYMBOL(get_tree_nodev);

#ifdef CONFIG_BLOCK
static int set_bdev_super(struct super_block *s, void *data)
{
Expand Down
3 changes: 3 additions & 0 deletions include/linux/fs_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ extern int vfs_get_super(struct fs_context *fc,
enum vfs_get_super_keying keying,
int (*fill_super)(struct super_block *sb,
struct fs_context *fc));
extern int get_tree_nodev(struct fs_context *fc,
int (*fill_super)(struct super_block *sb,
struct fs_context *fc));

extern const struct file_operations fscontext_fops;

Expand Down

0 comments on commit 2ac295d

Please sign in to comment.