Skip to content

Commit 7ab2fa7

Browse files
dhowellsAl Viro
authored andcommitted
vfs: Convert openpromfs to use the new mount API
Convert the openpromfs 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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 2345771 commit 7ab2fa7

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

‎fs/openpromfs/inode.c‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/types.h>
99
#include <linux/string.h>
1010
#include <linux/fs.h>
11+
#include <linux/fs_context.h>
1112
#include <linux/init.h>
1213
#include <linux/slab.h>
1314
#include <linux/seq_file.h>
@@ -374,7 +375,7 @@ static const struct super_operations openprom_sops = {
374375
.remount_fs = openprom_remount,
375376
};
376377

377-
static int openprom_fill_super(struct super_block *s, void *data, int silent)
378+
static int openprom_fill_super(struct super_block *s, struct fs_context *fc)
378379
{
379380
struct inode *root_inode;
380381
struct op_inode_info *oi;
@@ -408,16 +409,25 @@ static int openprom_fill_super(struct super_block *s, void *data, int silent)
408409
return ret;
409410
}
410411

411-
static struct dentry *openprom_mount(struct file_system_type *fs_type,
412-
int flags, const char *dev_name, void *data)
412+
static int openpromfs_get_tree(struct fs_context *fc)
413413
{
414-
return mount_single(fs_type, flags, data, openprom_fill_super);
414+
return get_tree_single(fc, openprom_fill_super);
415+
}
416+
417+
static const struct fs_context_operations openpromfs_context_ops = {
418+
.get_tree = openpromfs_get_tree,
419+
};
420+
421+
static int openpromfs_init_fs_context(struct fs_context *fc)
422+
{
423+
fc->ops = &openpromfs_context_ops;
424+
return 0;
415425
}
416426

417427
static struct file_system_type openprom_fs_type = {
418428
.owner = THIS_MODULE,
419429
.name = "openpromfs",
420-
.mount = openprom_mount,
430+
.init_fs_context = openpromfs_init_fs_context,
421431
.kill_sb = kill_anon_super,
422432
};
423433
MODULE_ALIAS_FS("openpromfs");

0 commit comments

Comments
 (0)