summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a8454c401ce..90cc2c9bd79 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]);