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 | 942050de0e7cd8ba5fbe312659a8824e0b8ee9ba (patch) | |
tree | 798044542e3c5defee8169905f90f99d6f1f0df9 /ctree.h | |
parent | 0975c87bcefbc7e3a6c52af13c604ea3b3f3bb10 (diff) |
add leaf data casting helper
Diffstat (limited to 'ctree.h')
-rw-r--r-- | ctree.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -401,6 +401,10 @@ static inline void btrfs_set_super_blocksize(struct btrfs_super_block *s, s->blocksize = cpu_to_le16(val); } +/* helper function to cast into the data area of the leaf. */ +#define btrfs_item_ptr(leaf, slot, type) \ + ((type *)((leaf)->data + btrfs_item_offset((leaf)->items + (slot)))) + struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root); int btrfs_inc_ref(struct btrfs_root *root, struct btrfs_buffer *buf); int btrfs_free_extent(struct btrfs_root *root, u64 blocknr, u64 num_blocks); |