aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-13 09:28:32 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-13 09:28:32 -0400
commit1d4f8a0c1eca5586134b56a4114a7cd5e85e3560 (patch)
tree602ec189899092f0f61b1b857937cdf9d1799590 /fs/btrfs/ctree.h
parent0783fcfc4dc19b8bb99bd51b7afa669ba4cbd377 (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.h12
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 {
128struct node { 128struct 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
156static inline u64 btrfs_node_blockptr(struct node *n, int nr)
157{
158 return le64_to_cpu(n->blockptrs[nr]);
159}
160
161static inline void btrfs_set_node_blockptr(struct node *n, int nr, u64 val)
162{
163 n->blockptrs[nr] = cpu_to_le64(val);
164}
165
156static inline u16 btrfs_item_offset(struct btrfs_item *item) 166static 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);