diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-13 09:28:32 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-13 09:28:32 -0400 |
commit | 1d4f8a0c1eca5586134b56a4114a7cd5e85e3560 (patch) | |
tree | 602ec189899092f0f61b1b857937cdf9d1799590 /fs/btrfs/ctree.h | |
parent | 0783fcfc4dc19b8bb99bd51b7afa669ba4cbd377 (diff) |
Btrfs: node->blockptrs endian fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index b03df154dcdb..a8454c401cee 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -128,7 +128,7 @@ struct leaf { | |||
128 | struct node { | 128 | struct node { |
129 | struct btrfs_header header; | 129 | struct btrfs_header header; |
130 | struct btrfs_disk_key keys[NODEPTRS_PER_BLOCK]; | 130 | struct btrfs_disk_key keys[NODEPTRS_PER_BLOCK]; |
131 | u64 blockptrs[NODEPTRS_PER_BLOCK]; | 131 | __le64 blockptrs[NODEPTRS_PER_BLOCK]; |
132 | } __attribute__ ((__packed__)); | 132 | } __attribute__ ((__packed__)); |
133 | 133 | ||
134 | /* | 134 | /* |
@@ -153,6 +153,16 @@ struct ctree_path { | |||
153 | int slots[MAX_LEVEL]; | 153 | int slots[MAX_LEVEL]; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | static inline u64 btrfs_node_blockptr(struct node *n, int nr) | ||
157 | { | ||
158 | return le64_to_cpu(n->blockptrs[nr]); | ||
159 | } | ||
160 | |||
161 | static inline void btrfs_set_node_blockptr(struct node *n, int nr, u64 val) | ||
162 | { | ||
163 | n->blockptrs[nr] = cpu_to_le64(val); | ||
164 | } | ||
165 | |||
156 | static inline u16 btrfs_item_offset(struct btrfs_item *item) | 166 | static inline u16 btrfs_item_offset(struct btrfs_item *item) |
157 | { | 167 | { |
158 | return le16_to_cpu(item->offset); | 168 | return le16_to_cpu(item->offset); |