Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Howells and committed by
Al Viro
c6a2c720 129f809d

+14 -6
+14 -6
drivers/oprofile/oprofilefs.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/oprofile.h> 16 16 #include <linux/fs.h> 17 + #include <linux/fs_context.h> 17 18 #include <linux/pagemap.h> 18 19 #include <linux/uaccess.h> 19 20 ··· 239 238 } 240 239 241 240 242 - static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) 241 + static int oprofilefs_fill_super(struct super_block *sb, struct fs_context *fc) 243 242 { 244 243 struct inode *root_inode; 245 244 ··· 264 263 return 0; 265 264 } 266 265 267 - 268 - static struct dentry *oprofilefs_mount(struct file_system_type *fs_type, 269 - int flags, const char *dev_name, void *data) 266 + static int oprofilefs_get_tree(struct fs_context *fc) 270 267 { 271 - return mount_single(fs_type, flags, data, oprofilefs_fill_super); 268 + return get_tree_single(fc, oprofilefs_fill_super); 272 269 } 273 270 271 + static const struct fs_context_operations oprofilefs_context_ops = { 272 + .get_tree = oprofilefs_get_tree, 273 + }; 274 + 275 + static int oprofilefs_init_fs_context(struct fs_context *fc) 276 + { 277 + fc->ops = &oprofilefs_context_ops; 278 + return 0; 279 + } 274 280 275 281 static struct file_system_type oprofilefs_type = { 276 282 .owner = THIS_MODULE, 277 283 .name = "oprofilefs", 278 - .mount = oprofilefs_mount, 284 + .init_fs_context = oprofilefs_init_fs_context, 279 285 .kill_sb = kill_litter_super, 280 286 }; 281 287 MODULE_ALIAS_FS("oprofilefs");