btrfs-tests.c (1f58bb18f6f28d1df0b7144d90bc90ee5672416d) btrfs-tests.c (389e22fb46eb1f48b089060c30030790e7a41033)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2013 Fusion IO. All rights reserved.
4 */
5
6#include <linux/fs.h>
7#include <linux/mount.h>
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2013 Fusion IO. All rights reserved.
4 */
5
6#include <linux/fs.h>
7#include <linux/mount.h>
8#include <linux/pseudo_fs.h>
8#include <linux/magic.h>
9#include "btrfs-tests.h"
10#include "../ctree.h"
11#include "../free-space-cache.h"
12#include "../free-space-tree.h"
13#include "../transaction.h"
14#include "../volumes.h"
15#include "../disk-io.h"

--- 11 unchanged lines hidden (view full) ---

27 [TEST_ALLOC_EXTENT_MAP] = "cannot allocate extent map",
28};
29
30static const struct super_operations btrfs_test_super_ops = {
31 .alloc_inode = btrfs_alloc_inode,
32 .destroy_inode = btrfs_test_destroy_inode,
33};
34
9#include <linux/magic.h>
10#include "btrfs-tests.h"
11#include "../ctree.h"
12#include "../free-space-cache.h"
13#include "../free-space-tree.h"
14#include "../transaction.h"
15#include "../volumes.h"
16#include "../disk-io.h"

--- 11 unchanged lines hidden (view full) ---

28 [TEST_ALLOC_EXTENT_MAP] = "cannot allocate extent map",
29};
30
31static const struct super_operations btrfs_test_super_ops = {
32 .alloc_inode = btrfs_alloc_inode,
33 .destroy_inode = btrfs_test_destroy_inode,
34};
35
35static struct dentry *btrfs_test_mount(struct file_system_type *fs_type,
36 int flags, const char *dev_name,
37 void *data)
36
37static int btrfs_test_init_fs_context(struct fs_context *fc)
38{
38{
39 return mount_pseudo(fs_type, &btrfs_test_super_ops,
40 NULL, BTRFS_TEST_MAGIC);
39 struct pseudo_fs_context *ctx = init_pseudo(fc, BTRFS_TEST_MAGIC);
40 if (!ctx)
41 return -ENOMEM;
42 ctx->ops = &btrfs_test_super_ops;
43 return 0;
41}
42
43static struct file_system_type test_type = {
44 .name = "btrfs_test_fs",
44}
45
46static struct file_system_type test_type = {
47 .name = "btrfs_test_fs",
45 .mount = btrfs_test_mount,
48 .init_fs_context = btrfs_test_init_fs_context,
46 .kill_sb = kill_anon_super,
47};
48
49struct inode *btrfs_new_test_inode(void)
50{
51 return new_inode(test_mnt->mnt_sb);
52}
53

--- 234 unchanged lines hidden ---
49 .kill_sb = kill_anon_super,
50};
51
52struct inode *btrfs_new_test_inode(void)
53{
54 return new_inode(test_mnt->mnt_sb);
55}
56

--- 234 unchanged lines hidden ---