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.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b03df154dcd..a8454c401ce 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/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);