diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-13 09:49:06 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-13 09:49:06 -0400 |
commit | cf27e1eec063fa68a89c57ae0a83f93aa38851d6 (patch) | |
tree | 230f1f887d5dad72501ed0826cf3d6e9a9d0f6fc /fs/btrfs/ctree.h | |
parent | 1d4f8a0c1eca5586134b56a4114a7cd5e85e3560 (diff) |
Btrfs: struct extent_item endian
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index a8454c401cee..90cc2c9bd79e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -136,8 +136,8 @@ struct node { | |||
136 | * owner of the block and the number of references | 136 | * owner of the block and the number of references |
137 | */ | 137 | */ |
138 | struct extent_item { | 138 | struct extent_item { |
139 | u32 refs; | 139 | __le32 refs; |
140 | u64 owner; | 140 | __le64 owner; |
141 | } __attribute__ ((__packed__)); | 141 | } __attribute__ ((__packed__)); |
142 | 142 | ||
143 | /* | 143 | /* |
@@ -153,6 +153,26 @@ struct ctree_path { | |||
153 | int slots[MAX_LEVEL]; | 153 | int slots[MAX_LEVEL]; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | static inline u64 btrfs_extent_owner(struct extent_item *ei) | ||
157 | { | ||
158 | return le64_to_cpu(ei->owner); | ||
159 | } | ||
160 | |||
161 | static inline void btrfs_set_extent_owner(struct extent_item *ei, u64 val) | ||
162 | { | ||
163 | ei->owner = cpu_to_le64(val); | ||
164 | } | ||
165 | |||
166 | static inline u32 btrfs_extent_refs(struct extent_item *ei) | ||
167 | { | ||
168 | return le32_to_cpu(ei->refs); | ||
169 | } | ||
170 | |||
171 | static inline void btrfs_set_extent_refs(struct extent_item *ei, u32 val) | ||
172 | { | ||
173 | ei->refs = cpu_to_le32(val); | ||
174 | } | ||
175 | |||
156 | static inline u64 btrfs_node_blockptr(struct node *n, int nr) | 176 | static inline u64 btrfs_node_blockptr(struct node *n, int nr) |
157 | { | 177 | { |
158 | return le64_to_cpu(n->blockptrs[nr]); | 178 | return le64_to_cpu(n->blockptrs[nr]); |