summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/ctree.h b/ctree.h
index b03df154..a8454c40 100644
--- a/ctree.h
+++ b/ctree.h
@@ -128,7 +128,7 @@ struct leaf {
struct node {
struct btrfs_header header;
struct btrfs_disk_key keys[NODEPTRS_PER_BLOCK];
- u64 blockptrs[NODEPTRS_PER_BLOCK];
+ __le64 blockptrs[NODEPTRS_PER_BLOCK];
} __attribute__ ((__packed__));
/*
@@ -153,6 +153,16 @@ struct ctree_path {
int slots[MAX_LEVEL];
};
+static inline u64 btrfs_node_blockptr(struct node *n, int nr)
+{
+ return le64_to_cpu(n->blockptrs[nr]);
+}
+
+static inline void btrfs_set_node_blockptr(struct node *n, int nr, u64 val)
+{
+ n->blockptrs[nr] = cpu_to_le64(val);
+}
+
static inline u16 btrfs_item_offset(struct btrfs_item *item)
{
return le16_to_cpu(item->offset);