aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c9201ec81fef..065e888d2c0b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -15,9 +15,10 @@ int cache_max = 10000;
15 15
16static int check_tree_block(struct ctree_root *root, struct tree_buffer *buf) 16static int check_tree_block(struct ctree_root *root, struct tree_buffer *buf)
17{ 17{
18 if (buf->blocknr != buf->node.header.blocknr) 18 if (buf->blocknr != btrfs_header_blocknr(&buf->node.header))
19 BUG(); 19 BUG();
20 if (root->node && buf->node.header.parentid != root->node->node.header.parentid) 20 if (root->node && btrfs_header_parentid(&buf->node.header) !=
21 btrfs_header_parentid(&root->node->node.header))
21 BUG(); 22 BUG();
22 return 0; 23 return 0;
23} 24}
@@ -129,7 +130,7 @@ int write_tree_block(struct ctree_root *root, struct tree_buffer *buf)
129 loff_t offset = blocknr * CTREE_BLOCKSIZE; 130 loff_t offset = blocknr * CTREE_BLOCKSIZE;
130 int ret; 131 int ret;
131 132
132 if (buf->blocknr != buf->node.header.blocknr) 133 if (buf->blocknr != btrfs_header_blocknr(&buf->node.header))
133 BUG(); 134 BUG();
134 ret = pwrite(root->fp, &buf->node, CTREE_BLOCKSIZE, offset); 135 ret = pwrite(root->fp, &buf->node, CTREE_BLOCKSIZE, offset);
135 if (ret != CTREE_BLOCKSIZE) 136 if (ret != CTREE_BLOCKSIZE)