summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-03-25 12:38:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-07-04 22:01:59 -0400
commitc6a2c720d206d37e67e533af898c45d62fb07505 (patch)
tree2bce514c2f77d1e2d71500c9e20e7dc52ef34b5a
parent129f809d2aa9c02cd1ab9714b265d828db3691ec (diff)
vfs: Convert oprofilefs to use the new mount API
Convert the oprofilefs 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: Robert Richter <rric@kernel.org> cc: oprofile-list@lists.sf.net Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/oprofile/oprofilefs.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 4ea08979312c..0875f2f122b3 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -14,6 +14,7 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/oprofile.h> 15#include <linux/oprofile.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/fs_context.h>
17#include <linux/pagemap.h> 18#include <linux/pagemap.h>
18#include <linux/uaccess.h> 19#include <linux/uaccess.h>
19 20
@@ -238,7 +239,7 @@ struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name)
238} 239}
239 240
240 241
241static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) 242static int oprofilefs_fill_super(struct super_block *sb, struct fs_context *fc)
242{ 243{
243 struct inode *root_inode; 244 struct inode *root_inode;
244 245
@@ -263,18 +264,25 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent)
263 return 0; 264 return 0;
264} 265}
265 266
266 267static int oprofilefs_get_tree(struct fs_context *fc)
267static struct dentry *oprofilefs_mount(struct file_system_type *fs_type,
268 int flags, const char *dev_name, void *data)
269{ 268{
270 return mount_single(fs_type, flags, data, oprofilefs_fill_super); 269 return get_tree_single(fc, oprofilefs_fill_super);
271} 270}
272 271
272static const struct fs_context_operations oprofilefs_context_ops = {
273 .get_tree = oprofilefs_get_tree,
274};
275
276static int oprofilefs_init_fs_context(struct fs_context *fc)
277{
278 fc->ops = &oprofilefs_context_ops;
279 return 0;
280}
273 281
274static struct file_system_type oprofilefs_type = { 282static struct file_system_type oprofilefs_type = {
275 .owner = THIS_MODULE, 283 .owner = THIS_MODULE,
276 .name = "oprofilefs", 284 .name = "oprofilefs",
277 .mount = oprofilefs_mount, 285 .init_fs_context = oprofilefs_init_fs_context,
278 .kill_sb = kill_litter_super, 286 .kill_sb = kill_litter_super,
279}; 287};
280MODULE_ALIAS_FS("oprofilefs"); 288MODULE_ALIAS_FS("oprofilefs");