aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-12 20:12:07 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-12 20:12:07 -0400
commit0783fcfc4dc19b8bb99bd51b7afa669ba4cbd377 (patch)
tree0d7d68c33e8ff954e7614395f05d01d47d107f05 /fs/btrfs/extent-tree.c
parente2fa7227cdf132d72e7410dd0679dc573a1c2618 (diff)
Btrfs: struct item endian fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 475e72215964..fdf95bd07f90 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -40,8 +40,8 @@ static int inc_block_ref(struct ctree_root *root, u64 blocknr)
40 BUG(); 40 BUG();
41 BUG_ON(ret != 0); 41 BUG_ON(ret != 0);
42 l = &path.nodes[0]->leaf; 42 l = &path.nodes[0]->leaf;
43 item = (struct extent_item *)(l->data + 43 item = (struct extent_item *)(l->data + btrfs_item_offset(l->items +
44 l->items[path.slots[0]].offset); 44 path.slots[0]));
45 item->refs++; 45 item->refs++;
46 46
47 BUG_ON(list_empty(&path.nodes[0]->dirty)); 47 BUG_ON(list_empty(&path.nodes[0]->dirty));
@@ -67,7 +67,8 @@ static int lookup_block_ref(struct ctree_root *root, u64 blocknr, u32 *refs)
67 BUG(); 67 BUG();
68 l = &path.nodes[0]->leaf; 68 l = &path.nodes[0]->leaf;
69 item = (struct extent_item *)(l->data + 69 item = (struct extent_item *)(l->data +
70 l->items[path.slots[0]].offset); 70 btrfs_item_offset(l->items +
71 path.slots[0]));
71 *refs = item->refs; 72 *refs = item->refs;
72 release_path(root->extent_root, &path); 73 release_path(root->extent_root, &path);
73 return 0; 74 return 0;
@@ -144,7 +145,7 @@ int __free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
144 struct btrfs_key key; 145 struct btrfs_key key;
145 struct ctree_root *extent_root = root->extent_root; 146 struct ctree_root *extent_root = root->extent_root;
146 int ret; 147 int ret;
147 struct item *item; 148 struct btrfs_item *item;
148 struct extent_item *ei; 149 struct extent_item *ei;
149 struct btrfs_key ins; 150 struct btrfs_key ins;
150 151
@@ -162,7 +163,8 @@ int __free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
162 BUG(); 163 BUG();
163 } 164 }
164 item = path.nodes[0]->leaf.items + path.slots[0]; 165 item = path.nodes[0]->leaf.items + path.slots[0];
165 ei = (struct extent_item *)(path.nodes[0]->leaf.data + item->offset); 166 ei = (struct extent_item *)(path.nodes[0]->leaf.data +
167 btrfs_item_offset(item));
166 BUG_ON(ei->refs == 0); 168 BUG_ON(ei->refs == 0);
167 ei->refs--; 169 ei->refs--;
168 if (ei->refs == 0) { 170 if (ei->refs == 0) {