Skip to content

Commit 5c86d7e

Browse files
dhowellsAl Viro
authored andcommitted
vfs: Convert securityfs to use the new mount API
Convert the securityfs 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: linux-security-module@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b0ecc9d commit 5c86d7e

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

‎security/inode.c‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/sysfs.h>
1717
#include <linux/kobject.h>
1818
#include <linux/fs.h>
19+
#include <linux/fs_context.h>
1920
#include <linux/mount.h>
2021
#include <linux/pagemap.h>
2122
#include <linux/init.h>
@@ -39,7 +40,7 @@ static const struct super_operations securityfs_super_operations = {
3940
.free_inode = securityfs_free_inode,
4041
};
4142

42-
static int fill_super(struct super_block *sb, void *data, int silent)
43+
static int securityfs_fill_super(struct super_block *sb, struct fs_context *fc)
4344
{
4445
static const struct tree_descr files[] = {{""}};
4546
int error;
@@ -53,17 +54,25 @@ static int fill_super(struct super_block *sb, void *data, int silent)
5354
return 0;
5455
}
5556

56-
static struct dentry *get_sb(struct file_system_type *fs_type,
57-
int flags, const char *dev_name,
58-
void *data)
57+
static int securityfs_get_tree(struct fs_context *fc)
5958
{
60-
return mount_single(fs_type, flags, data, fill_super);
59+
return get_tree_single(fc, securityfs_fill_super);
60+
}
61+
62+
static const struct fs_context_operations securityfs_context_ops = {
63+
.get_tree = securityfs_get_tree,
64+
};
65+
66+
static int securityfs_init_fs_context(struct fs_context *fc)
67+
{
68+
fc->ops = &securityfs_context_ops;
69+
return 0;
6170
}
6271

6372
static struct file_system_type fs_type = {
6473
.owner = THIS_MODULE,
6574
.name = "securityfs",
66-
.mount = get_sb,
75+
.init_fs_context = securityfs_init_fs_context,
6776
.kill_sb = kill_litter_super,
6877
};
6978

0 commit comments

Comments
 (0)