From df02450217c98e01b8b22f805314470df71f2b9b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 1 Jun 2019 18:51:15 -0400 Subject: make ramfs_fill_super() static all users should just call ramfs_mount() Signed-off-by: Al Viro --- init/do_mounts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'init/do_mounts.c') diff --git a/init/do_mounts.c b/init/do_mounts.c index 53cb37b66227..baedc2ef579e 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -630,12 +630,10 @@ static bool is_tmpfs; static struct dentry *rootfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { - void *fill = ramfs_fill_super; - if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs) - fill = shmem_fill_super; + return mount_nodev(fs_type, flags, data, shmem_fill_super); - return mount_nodev(fs_type, flags, data, fill); + return ramfs_mount(fs_type, flags, dev_name, data); } struct file_system_type rootfs_fs_type = { -- cgit v1.2.2 From 7e30d2a5eb0b2d5853f06cb8a2d44937d80a6bd6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 1 Jun 2019 18:56:53 -0400 Subject: make shmem_fill_super() static ... have callers use shmem_mount() Signed-off-by: Al Viro --- init/do_mounts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'init/do_mounts.c') diff --git a/init/do_mounts.c b/init/do_mounts.c index baedc2ef579e..16c29e57f224 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -631,7 +631,7 @@ static struct dentry *rootfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs) - return mount_nodev(fs_type, flags, data, shmem_fill_super); + return shmem_mount(fs_type, flags, dev_name, data); return ramfs_mount(fs_type, flags, dev_name, data); } -- cgit v1.2.2 From f32356261d44d580649a7abce1156d15d49cf20f Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 25 Mar 2019 16:38:31 +0000 Subject: vfs: Convert ramfs, shmem, tmpfs, devtmpfs, rootfs to use the new mount API Convert the ramfs, shmem, tmpfs, devtmpfs and rootfs filesystems to the new internal mount API as the old one will be obsoleted and removed. This allows greater flexibility in communication of mount parameters between userspace, the VFS and the filesystem. See Documentation/filesystems/mount_api.txt for more information. Note that tmpfs is slightly tricky as it can contain embedded commas, so it can't be trivially split up using strsep() to break on commas in generic_parse_monolithic(). Instead, tmpfs has to supply its own generic parser. However, if tmpfs changes, then devtmpfs and rootfs, which are wrappers around tmpfs or ramfs, must change too - and thus so must ramfs, so these had to be converted also. [AV: rewritten] Signed-off-by: David Howells cc: Hugh Dickins cc: linux-mm@kvack.org Signed-off-by: Al Viro --- init/do_mounts.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'init/do_mounts.c') diff --git a/init/do_mounts.c b/init/do_mounts.c index 16c29e57f224..9634ecf3743d 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -627,18 +627,17 @@ out: } static bool is_tmpfs; -static struct dentry *rootfs_mount(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) +static int rootfs_init_fs_context(struct fs_context *fc) { if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs) - return shmem_mount(fs_type, flags, dev_name, data); + return shmem_init_fs_context(fc); - return ramfs_mount(fs_type, flags, dev_name, data); + return ramfs_init_fs_context(fc); } struct file_system_type rootfs_fs_type = { .name = "rootfs", - .mount = rootfs_mount, + .init_fs_context = rootfs_init_fs_context, .kill_sb = kill_litter_super, }; -- cgit v1.2.2