summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-06-02 03:48:55 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2019-07-05 05:01:58 +0300
commit2ac295d4f0c095310addbcb03d91d2a4c9f7d435 (patch)
tree62163f9641929535b05fc9e7ad0c7ebccb807f58
parent023d066a0d0a87696c04b0de2ceae53063d0b655 (diff)
downloadlinux-2ac295d4f0c095310addbcb03d91d2a4c9f7d435.tar.xz
convenience helper get_tree_nodev()
counterpart of mount_nodev(). Switch hugetlb and pseudo to it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/libfs.c2
-rw-r--r--fs/super.c8
-rw-r--r--include/linux/fs_context.h3
4 files changed, 13 insertions, 2 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 1dcc57189382..a478df035651 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -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)
diff --git a/fs/libfs.c b/fs/libfs.c
index 7e6811ba4edd..c9463dc6a5d4 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -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)
diff --git a/fs/super.c b/fs/super.c
index ca2302501d32..3318225b0878 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -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)
{
diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h
index c995b852ba40..38b1ec918a4e 100644
--- a/include/linux/fs_context.h
+++ b/include/linux/fs_context.h
@@ -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;