diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-14 10:31:29 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-14 10:31:29 -0400 |
commit | 4beb1b8b75a86373f6020103ab840448d14c8880 (patch) | |
tree | 944e80ccd6764afd16b4e31d5595d2decf36dabc /fs/btrfs/ctree.h | |
parent | 710874947aa0f81c3b348b052e81cb9075113c49 (diff) |
Btrfs: add leaf data casting helper
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0968899fb7f9..05c7707263f5 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -401,6 +401,10 @@ static inline void btrfs_set_super_blocksize(struct btrfs_super_block *s, | |||
401 | s->blocksize = cpu_to_le16(val); | 401 | s->blocksize = cpu_to_le16(val); |
402 | } | 402 | } |
403 | 403 | ||
404 | /* helper function to cast into the data area of the leaf. */ | ||
405 | #define btrfs_item_ptr(leaf, slot, type) \ | ||
406 | ((type *)((leaf)->data + btrfs_item_offset((leaf)->items + (slot)))) | ||
407 | |||
404 | struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root); | 408 | struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root); |
405 | int btrfs_inc_ref(struct btrfs_root *root, struct btrfs_buffer *buf); | 409 | int btrfs_inc_ref(struct btrfs_root *root, struct btrfs_buffer *buf); |
406 | int btrfs_free_extent(struct btrfs_root *root, u64 blocknr, u64 num_blocks); | 410 | int btrfs_free_extent(struct btrfs_root *root, u64 blocknr, u64 num_blocks); |