1 Upstream-Status: Inappropriate [Backport]
2 From e3064e90cfd0be823b2da3edff64f97756fcc245 Mon Sep 17 00:00:00 2001
3 From: Chris Mason <chris.mason@oracle.com>
4 Date: Mon, 25 Apr 2011 16:31:40 -0400
5 Subject: [PATCH 5/5] Temporary debugging for dragonn
7 Signed-off-by: Chris Mason <chris.mason@oracle.com>
10 disk-io.c | 16 ++++++++--------
11 2 files changed, 11 insertions(+), 8 deletions(-)
13 diff --git a/btrfsck.c b/btrfsck.c
14 index f760706..cb3dee0 100644
17 @@ -855,6 +855,7 @@ static u64 count_csum_range(struct btrfs_root *root, u64 start, u64 len)
19 u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy);
22 btrfs_init_path(&path);
24 key.objectid = BTRFS_EXTENT_CSUM_OBJECTID;
25 @@ -2666,6 +2667,8 @@ static int add_root_to_pending(struct extent_buffer *buf,
26 struct cache_tree *nodes,
27 struct btrfs_key *root_key)
29 + if (root_key->objectid == 7)
31 if (btrfs_header_level(buf) > 0)
32 add_pending(nodes, seen, buf->start, buf->len);
34 diff --git a/disk-io.c b/disk-io.c
35 index dc100b0..c242364 100644
38 @@ -614,12 +614,12 @@ struct btrfs_fs_info *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
42 - struct btrfs_root *tree_root = malloc(sizeof(struct btrfs_root));
43 - struct btrfs_root *extent_root = malloc(sizeof(struct btrfs_root));
44 - struct btrfs_root *chunk_root = malloc(sizeof(struct btrfs_root));
45 - struct btrfs_root *dev_root = malloc(sizeof(struct btrfs_root));
46 - struct btrfs_root *csum_root = malloc(sizeof(struct btrfs_root));
47 - struct btrfs_fs_info *fs_info = malloc(sizeof(*fs_info));
48 + struct btrfs_root *tree_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
49 + struct btrfs_root *extent_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
50 + struct btrfs_root *chunk_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
51 + struct btrfs_root *dev_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
52 + struct btrfs_root *csum_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
53 + struct btrfs_fs_info *fs_info = kzalloc(sizeof(*fs_info), GFP_NOFS);
55 struct btrfs_super_block *disk_super;
56 struct btrfs_fs_devices *fs_devices = NULL;
57 @@ -767,13 +767,13 @@ struct btrfs_fs_info *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
60 dev_root->track_dirty = 1;
63 ret = find_and_setup_root(tree_root, fs_info,
64 BTRFS_CSUM_TREE_OBJECTID, csum_root);
67 csum_root->track_dirty = 1;
70 ret = find_and_setup_log_root(tree_root, fs_info, disk_super);