aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-12 12:01:18 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-12 12:01:18 -0400
commit7518a238ea0152dc849d1ed76d3cae8b44e12f46 (patch)
tree97e5c285f10bdb2576046e7bb15d239471815c28 /fs/btrfs/disk-io.c
parent83e15a28e046dbb4534dd263d1d3dc867a8994a2 (diff)
Btrfs: get/set for struct header fields
Signed-off-by: Chris Mason <chris.mason@oracle.com>
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)