]> code.ossystems Code Review - openembedded-core.git/blob
54123f729db7d377a30c30bfb5224405ce2eb1b7
[openembedded-core.git] /
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
6
7 Signed-off-by: Chris Mason <chris.mason@oracle.com>
8 ---
9  btrfsck.c |    3 +++
10  disk-io.c |   16 ++++++++--------
11  2 files changed, 11 insertions(+), 8 deletions(-)
12
13 diff --git a/btrfsck.c b/btrfsck.c
14 index f760706..cb3dee0 100644
15 --- a/btrfsck.c
16 +++ b/btrfsck.c
17 @@ -855,6 +855,7 @@ static u64 count_csum_range(struct btrfs_root *root, u64 start, u64 len)
18         u64 csum_end;
19         u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy);
20  
21 +       return 0;
22         btrfs_init_path(&path);
23  
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)
28  {
29 +       if (root_key->objectid == 7)
30 +               return 0;
31         if (btrfs_header_level(buf) > 0)
32                 add_pending(nodes, seen, buf->start, buf->len);
33         else
34 diff --git a/disk-io.c b/disk-io.c
35 index dc100b0..c242364 100644
36 --- a/disk-io.c
37 +++ b/disk-io.c
38 @@ -614,12 +614,12 @@ struct btrfs_fs_info *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
39         u32 stripesize;
40         u64 generation;
41         struct btrfs_key key;
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);
54         int ret;
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,
58                 goto fail;
59  
60         dev_root->track_dirty = 1;
61 -
62 +#if 0
63         ret = find_and_setup_root(tree_root, fs_info,
64                                   BTRFS_CSUM_TREE_OBJECTID, csum_root);
65         if (ret)
66                 goto fail;
67         csum_root->track_dirty = 1;
68 -
69 +#endif
70         ret = find_and_setup_log_root(tree_root, fs_info, disk_super);
71         if (ret)
72                 goto fail;
73 -- 
74 1.7.2.3
75