Commit 389e22fb authored by David Howells's avatar David Howells Committed by Al Viro

vfs: Convert btrfs_test to use the new mount API

Convert the btrfs_test 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: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarDavid Sterba <dsterba@suse.com>
cc: Chris Mason <clm@fb.com>
cc: Josef Bacik <josef@toxicpanda.com>
cc: linux-btrfs@vger.kernel.org
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 99558d20
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <linux/magic.h> #include <linux/magic.h>
#include "btrfs-tests.h" #include "btrfs-tests.h"
#include "../ctree.h" #include "../ctree.h"
...@@ -32,17 +33,19 @@ static const struct super_operations btrfs_test_super_ops = { ...@@ -32,17 +33,19 @@ static const struct super_operations btrfs_test_super_ops = {
.destroy_inode = btrfs_test_destroy_inode, .destroy_inode = btrfs_test_destroy_inode,
}; };
static struct dentry *btrfs_test_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, static int btrfs_test_init_fs_context(struct fs_context *fc)
void *data)
{ {
return mount_pseudo(fs_type, &btrfs_test_super_ops, struct pseudo_fs_context *ctx = init_pseudo(fc, BTRFS_TEST_MAGIC);
NULL, BTRFS_TEST_MAGIC); if (!ctx)
return -ENOMEM;
ctx->ops = &btrfs_test_super_ops;
return 0;
} }
static struct file_system_type test_type = { static struct file_system_type test_type = {
.name = "btrfs_test_fs", .name = "btrfs_test_fs",
.mount = btrfs_test_mount, .init_fs_context = btrfs_test_init_fs_context,
.kill_sb = kill_anon_super, .kill_sb = kill_anon_super,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment