Skip to content

Commit bc99a66

Browse files
dhowellsAl Viro
authored andcommitted
vfs: Convert binfmt_misc to use the new mount API
Convert the binfmt_misc filesystem 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. Signed-off-by: David Howells <dhowells@redhat.com> cc: Alexander Viro <viro@zeniv.linux.org.uk> cc: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent c23a0bb commit bc99a66

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

fs/binfmt_misc.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/pagemap.h>
2323
#include <linux/namei.h>
2424
#include <linux/mount.h>
25+
#include <linux/fs_context.h>
2526
#include <linux/syscalls.h>
2627
#include <linux/fs.h>
2728
#include <linux/uaccess.h>
@@ -820,7 +821,7 @@ static const struct super_operations s_ops = {
820821
.evict_inode = bm_evict_inode,
821822
};
822823

823-
static int bm_fill_super(struct super_block *sb, void *data, int silent)
824+
static int bm_fill_super(struct super_block *sb, struct fs_context *fc)
824825
{
825826
int err;
826827
static const struct tree_descr bm_files[] = {
@@ -835,10 +836,19 @@ static int bm_fill_super(struct super_block *sb, void *data, int silent)
835836
return err;
836837
}
837838

838-
static struct dentry *bm_mount(struct file_system_type *fs_type,
839-
int flags, const char *dev_name, void *data)
839+
static int bm_get_tree(struct fs_context *fc)
840840
{
841-
return mount_single(fs_type, flags, data, bm_fill_super);
841+
return get_tree_single(fc, bm_fill_super);
842+
}
843+
844+
static const struct fs_context_operations bm_context_ops = {
845+
.get_tree = bm_get_tree,
846+
};
847+
848+
static int bm_init_fs_context(struct fs_context *fc)
849+
{
850+
fc->ops = &bm_context_ops;
851+
return 0;
842852
}
843853

844854
static struct linux_binfmt misc_format = {
@@ -849,7 +859,7 @@ static struct linux_binfmt misc_format = {
849859
static struct file_system_type bm_fs_type = {
850860
.owner = THIS_MODULE,
851861
.name = "binfmt_misc",
852-
.mount = bm_mount,
862+
.init_fs_context = bm_init_fs_context,
853863
.kill_sb = kill_litter_super,
854864
};
855865
MODULE_ALIAS_FS("binfmt_misc");

0 commit comments

Comments
 (0)