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) | |
download | lwn-cf27e1eec063fa68a89c57ae0a83f93aa38851d6.tar.gz lwn-cf27e1eec063fa68a89c57ae0a83f93aa38851d6.zip |
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 { * owner of the block and the number of references */ struct extent_item { - u32 refs; - u64 owner; + __le32 refs; + __le64 owner; } __attribute__ ((__packed__)); /* @@ -153,6 +153,26 @@ struct ctree_path { int slots[MAX_LEVEL]; }; +static inline u64 btrfs_extent_owner(struct extent_item *ei) +{ + return le64_to_cpu(ei->owner); +} + +static inline void btrfs_set_extent_owner(struct extent_item *ei, u64 val) +{ + ei->owner = cpu_to_le64(val); +} + +static inline u32 btrfs_extent_refs(struct extent_item *ei) +{ + return le32_to_cpu(ei->refs); +} + +static inline void btrfs_set_extent_refs(struct extent_item *ei, u32 val) +{ + ei->refs = cpu_to_le32(val); +} + static inline u64 btrfs_node_blockptr(struct node *n, int nr) { return le64_to_cpu(n->blockptrs[nr]); |