diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-12 12:01:18 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-12 12:01:18 -0400 |
commit | 7518a238ea0152dc849d1ed76d3cae8b44e12f46 (patch) | |
tree | 97e5c285f10bdb2576046e7bb15d239471815c28 /fs/btrfs/disk-io.c | |
parent | 83e15a28e046dbb4534dd263d1d3dc867a8994a2 (diff) | |
download | lwn-7518a238ea0152dc849d1ed76d3cae8b44e12f46.tar.gz lwn-7518a238ea0152dc849d1ed76d3cae8b44e12f46.zip |
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.c | 7 |
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; static int check_tree_block(struct ctree_root *root, struct tree_buffer *buf) { - if (buf->blocknr != buf->node.header.blocknr) + if (buf->blocknr != btrfs_header_blocknr(&buf->node.header)) BUG(); - if (root->node && buf->node.header.parentid != root->node->node.header.parentid) + if (root->node && btrfs_header_parentid(&buf->node.header) != + btrfs_header_parentid(&root->node->node.header)) BUG(); return 0; } @@ -129,7 +130,7 @@ int write_tree_block(struct ctree_root *root, struct tree_buffer *buf) loff_t offset = blocknr * CTREE_BLOCKSIZE; int ret; - if (buf->blocknr != buf->node.header.blocknr) + if (buf->blocknr != btrfs_header_blocknr(&buf->node.header)) BUG(); ret = pwrite(root->fp, &buf->node, CTREE_BLOCKSIZE, offset); if (ret != CTREE_BLOCKSIZE) |