diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 489019a..1055564 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -76,7 +76,7 @@
 	u32 nr = btrfs_header_nritems(&leaf->header);
 	if (nr == 0)
 		return sizeof(leaf->data);
-	return leaf->items[nr-1].offset;
+	return btrfs_item_offset(leaf->items + nr - 1);
 }
 
 /*
@@ -174,11 +174,12 @@
 		btrfs_disk_key_to_cpu(&cpukey, &leaf->items[i + 1].key);
 		BUG_ON(comp_keys(&leaf->items[i].key,
 		                 &cpukey) >= 0);
-		BUG_ON(leaf->items[i].offset != leaf->items[i + 1].offset +
-		    leaf->items[i + 1].size);
+		BUG_ON(btrfs_item_offset(leaf->items + i) !=
+			btrfs_item_end(leaf->items + i + 1));
 		if (i == 0) {
-			BUG_ON(leaf->items[i].offset + leaf->items[i].size !=
-				LEAF_DATA_SIZE);
+			BUG_ON(btrfs_item_offset(leaf->items + i) +
+			       btrfs_item_size(leaf->items + i) !=
+			       LEAF_DATA_SIZE);
 		}
 	}
 	return 0;
@@ -235,7 +236,8 @@
 {
 	if (btrfs_is_leaf(c)) {
 		struct leaf *l = (struct leaf *)c;
-		return generic_bin_search((void *)l->items, sizeof(struct item),
+		return generic_bin_search((void *)l->items,
+					  sizeof(struct btrfs_item),
 					  key, btrfs_header_nritems(&c->header),
 					  slot);
 	} else {
@@ -485,7 +487,7 @@
 			struct leaf *l = (struct leaf *)c;
 			p->slots[level] = slot;
 			if (ins_len > 0 && leaf_free_space(l) <
-			    sizeof(struct item) + ins_len) {
+			    sizeof(struct btrfs_item) + ins_len) {
 				int sret = split_leaf(root, p, ins_len);
 				BUG_ON(sret > 0);
 				if (sret)
@@ -780,9 +782,9 @@
 
 	if (!nr)
 		return 0;
-	data_len = l->items[start].offset + l->items[start].size;
-	data_len = data_len - l->items[end].offset;
-	data_len += sizeof(struct item) * nr;
+	data_len = btrfs_item_end(l->items + start);
+	data_len = data_len - btrfs_item_offset(l->items + end);
+	data_len += sizeof(struct btrfs_item) * nr;
 	return data_len;
 }
 
@@ -806,7 +808,7 @@
 	int free_space;
 	int push_space = 0;
 	int push_items = 0;
-	struct item *item;
+	struct btrfs_item *item;
 	u32 left_nritems;
 	u32 right_nritems;
 
@@ -821,7 +823,7 @@
 	right_buf = read_tree_block(root, upper->node.blockptrs[slot + 1]);
 	right = &right_buf->leaf;
 	free_space = leaf_free_space(right);
-	if (free_space < data_size + sizeof(struct item)) {
+	if (free_space < data_size + sizeof(struct btrfs_item)) {
 		tree_block_release(root, right_buf);
 		return 1;
 	}
@@ -829,7 +831,7 @@
 	btrfs_cow_block(root, right_buf, upper, slot + 1, &right_buf);
 	right = &right_buf->leaf;
 	free_space = leaf_free_space(right);
-	if (free_space < data_size + sizeof(struct item)) {
+	if (free_space < data_size + sizeof(struct btrfs_item)) {
 		tree_block_release(root, right_buf);
 		return 1;
 	}
@@ -839,10 +841,11 @@
 		item = left->items + i;
 		if (path->slots[0] == i)
 			push_space += data_size + sizeof(*item);
-		if (item->size + sizeof(*item) + push_space > free_space)
+		if (btrfs_item_size(item) + sizeof(*item) + push_space >
+		    free_space)
 			break;
 		push_items++;
-		push_space += item->size + sizeof(*item);
+		push_space += btrfs_item_size(item) + sizeof(*item);
 	}
 	if (push_items == 0) {
 		tree_block_release(root, right_buf);
@@ -850,8 +853,7 @@
 	}
 	right_nritems = btrfs_header_nritems(&right->header);
 	/* push left to right */
-	push_space = left->items[left_nritems - push_items].offset +
-		     left->items[left_nritems - push_items].size;
+	push_space = btrfs_item_end(left->items + left_nritems - push_items);
 	push_space -= leaf_data_end(left);
 	/* make room in the right data area */
 	memmove(right->data + leaf_data_end(right) - push_space,
@@ -862,18 +864,19 @@
 		left->data + leaf_data_end(left),
 		push_space);
 	memmove(right->items + push_items, right->items,
-		right_nritems * sizeof(struct item));
+		right_nritems * sizeof(struct btrfs_item));
 	/* copy the items from left to right */
 	memcpy(right->items, left->items + left_nritems - push_items,
-		push_items * sizeof(struct item));
+		push_items * sizeof(struct btrfs_item));
 
 	/* update the item pointers */
 	right_nritems += push_items;
 	btrfs_set_header_nritems(&right->header, right_nritems);
 	push_space = LEAF_DATA_SIZE;
 	for (i = 0; i < right_nritems; i++) {
-		right->items[i].offset = push_space - right->items[i].size;
-		push_space = right->items[i].offset;
+		btrfs_set_item_offset(right->items + i, push_space -
+				      btrfs_item_size(right->items + i));
+		push_space = btrfs_item_offset(right->items + i);
 	}
 	left_nritems -= push_items;
 	btrfs_set_header_nritems(&left->header, left_nritems);
@@ -911,7 +914,7 @@
 	int free_space;
 	int push_space = 0;
 	int push_items = 0;
-	struct item *item;
+	struct btrfs_item *item;
 	u32 old_left_nritems;
 	int ret = 0;
 	int wret;
@@ -926,7 +929,7 @@
 	t = read_tree_block(root, path->nodes[1]->node.blockptrs[slot - 1]);
 	left = &t->leaf;
 	free_space = leaf_free_space(left);
-	if (free_space < data_size + sizeof(struct item)) {
+	if (free_space < data_size + sizeof(struct btrfs_item)) {
 		tree_block_release(root, t);
 		return 1;
 	}
@@ -935,7 +938,7 @@
 	btrfs_cow_block(root, t, path->nodes[1], slot - 1, &t);
 	left = &t->leaf;
 	free_space = leaf_free_space(left);
-	if (free_space < data_size + sizeof(struct item)) {
+	if (free_space < data_size + sizeof(struct btrfs_item)) {
 		tree_block_release(root, t);
 		return 1;
 	}
@@ -944,10 +947,11 @@
 		item = right->items + i;
 		if (path->slots[0] == i)
 			push_space += data_size + sizeof(*item);
-		if (item->size + sizeof(*item) + push_space > free_space)
+		if (btrfs_item_size(item) + sizeof(*item) + push_space >
+		    free_space)
 			break;
 		push_items++;
-		push_space += item->size + sizeof(*item);
+		push_space += btrfs_item_size(item) + sizeof(*item);
 	}
 	if (push_items == 0) {
 		tree_block_release(root, t);
@@ -955,35 +959,40 @@
 	}
 	/* push data from right to left */
 	memcpy(left->items + btrfs_header_nritems(&left->header),
-		right->items, push_items * sizeof(struct item));
-	push_space = LEAF_DATA_SIZE - right->items[push_items -1].offset;
+		right->items, push_items * sizeof(struct btrfs_item));
+	push_space = LEAF_DATA_SIZE -
+		     btrfs_item_offset(right->items + push_items -1);
 	memcpy(left->data + leaf_data_end(left) - push_space,
-		right->data + right->items[push_items - 1].offset,
+		right->data + btrfs_item_offset(right->items + push_items - 1),
 		push_space);
 	old_left_nritems = btrfs_header_nritems(&left->header);
 	BUG_ON(old_left_nritems < 0);
 
-	for(i = old_left_nritems; i < old_left_nritems + push_items; i++) {
-		left->items[i].offset -= LEAF_DATA_SIZE -
-			left->items[old_left_nritems -1].offset;
+	for (i = old_left_nritems; i < old_left_nritems + push_items; i++) {
+		u16 ioff = btrfs_item_offset(left->items + i);
+		btrfs_set_item_offset(left->items + i, ioff - (LEAF_DATA_SIZE -
+				      btrfs_item_offset(left->items +
+						        old_left_nritems - 1)));
 	}
 	btrfs_set_header_nritems(&left->header, old_left_nritems + push_items);
 
 	/* fixup right node */
-	push_space = right->items[push_items-1].offset - leaf_data_end(right);
+	push_space = btrfs_item_offset(right->items + push_items - 1) -
+		     leaf_data_end(right);
 	memmove(right->data + LEAF_DATA_SIZE - push_space, right->data +
 		leaf_data_end(right), push_space);
 	memmove(right->items, right->items + push_items,
 		(btrfs_header_nritems(&right->header) - push_items) *
-		sizeof(struct item));
+		sizeof(struct btrfs_item));
 	btrfs_set_header_nritems(&right->header,
 				 btrfs_header_nritems(&right->header) -
 				 push_items);
 	push_space = LEAF_DATA_SIZE;
 
 	for (i = 0; i < btrfs_header_nritems(&right->header); i++) {
-		right->items[i].offset = push_space - right->items[i].size;
-		push_space = right->items[i].offset;
+		btrfs_set_item_offset(right->items + i, push_space -
+				      btrfs_item_size(right->items + i));
+		push_space = btrfs_item_offset(right->items + i);
 	}
 
 	BUG_ON(list_empty(&t->dirty));
@@ -1023,7 +1032,7 @@
 	int slot;
 	struct leaf *right;
 	struct tree_buffer *right_buffer;
-	int space_needed = data_size + sizeof(struct item);
+	int space_needed = data_size + sizeof(struct btrfs_item);
 	int data_copy_size;
 	int rt_data_off;
 	int i;
@@ -1034,7 +1043,7 @@
 	l = &l_buf->leaf;
 
 	/* did the pushes work? */
-	if (leaf_free_space(l) >= sizeof(struct item) + data_size)
+	if (leaf_free_space(l) >= sizeof(struct btrfs_item) + data_size)
 		return 0;
 
 	if (!path->nodes[1]) {
@@ -1066,17 +1075,17 @@
 	btrfs_set_header_level(&right->header, 0);
 	btrfs_set_header_parentid(&right->header,
 	                       btrfs_header_parentid(&root->node->node.header));
-	data_copy_size = l->items[mid].offset + l->items[mid].size -
-			 leaf_data_end(l);
+	data_copy_size = btrfs_item_end(l->items + mid) - leaf_data_end(l);
 	memcpy(right->items, l->items + mid,
-	       (nritems - mid) * sizeof(struct item));
+	       (nritems - mid) * sizeof(struct btrfs_item));
 	memcpy(right->data + LEAF_DATA_SIZE - data_copy_size,
 	       l->data + leaf_data_end(l), data_copy_size);
-	rt_data_off = LEAF_DATA_SIZE -
-		     (l->items[mid].offset + l->items[mid].size);
+	rt_data_off = LEAF_DATA_SIZE - btrfs_item_end(l->items + mid);
 
-	for (i = 0; i < btrfs_header_nritems(&right->header); i++)
-		right->items[i].offset += rt_data_off;
+	for (i = 0; i < btrfs_header_nritems(&right->header); i++) {
+		u16 ioff = btrfs_item_offset(right->items + i);
+		btrfs_set_item_offset(right->items + i, ioff + rt_data_off);
+	}
 
 	btrfs_set_header_nritems(&l->header, mid);
 	ret = 0;
@@ -1136,26 +1145,28 @@
 	nritems = btrfs_header_nritems(&leaf->header);
 	data_end = leaf_data_end(leaf);
 
-	if (leaf_free_space(leaf) <  sizeof(struct item) + data_size)
+	if (leaf_free_space(leaf) <  sizeof(struct btrfs_item) + data_size)
 		BUG();
 
 	slot = path.slots[0];
 	BUG_ON(slot < 0);
 	if (slot != nritems) {
 		int i;
-		unsigned int old_data = leaf->items[slot].offset +
-					leaf->items[slot].size;
+		unsigned int old_data = btrfs_item_end(leaf->items + slot);
 
 		/*
 		 * item0..itemN ... dataN.offset..dataN.size .. data0.size
 		 */
 		/* first correct the data pointers */
-		for (i = slot; i < nritems; i++)
-			leaf->items[i].offset -= data_size;
+		for (i = slot; i < nritems; i++) {
+			u16 ioff = btrfs_item_offset(leaf->items + i);
+			btrfs_set_item_offset(leaf->items + i,
+					      ioff - data_size);
+		}
 
 		/* shift the items */
 		memmove(leaf->items + slot + 1, leaf->items + slot,
-		        (nritems - slot) * sizeof(struct item));
+		        (nritems - slot) * sizeof(struct btrfs_item));
 
 		/* shift the data */
 		memmove(leaf->data + data_end - data_size, leaf->data +
@@ -1165,8 +1176,8 @@
 	/* copy the new data in */
 	memcpy(&leaf->items[slot].key, &disk_key,
 		sizeof(struct btrfs_disk_key));
-	leaf->items[slot].offset = data_end - data_size;
-	leaf->items[slot].size = data_size;
+	btrfs_set_item_offset(leaf->items + slot, data_end - data_size);
+	btrfs_set_item_size(leaf->items + slot, data_size);
 	memcpy(leaf->data + data_end - data_size, data, data_size);
 	btrfs_set_header_nritems(&leaf->header, nritems + 1);
 
@@ -1241,8 +1252,8 @@
 	leaf_buf = path->nodes[0];
 	leaf = &leaf_buf->leaf;
 	slot = path->slots[0];
-	doff = leaf->items[slot].offset;
-	dsize = leaf->items[slot].size;
+	doff = btrfs_item_offset(leaf->items + slot);
+	dsize = btrfs_item_size(leaf->items + slot);
 	nritems = btrfs_header_nritems(&leaf->header);
 
 	if (slot != nritems - 1) {
@@ -1251,10 +1262,12 @@
 		memmove(leaf->data + data_end + dsize,
 			leaf->data + data_end,
 			doff - data_end);
-		for (i = slot + 1; i < nritems; i++)
-			leaf->items[i].offset += dsize;
+		for (i = slot + 1; i < nritems; i++) {
+			u16 ioff = btrfs_item_offset(leaf->items + i);
+			btrfs_set_item_offset(leaf->items + i, ioff + dsize);
+		}
 		memmove(leaf->items + slot, leaf->items + slot + 1,
-			sizeof(struct item) *
+			sizeof(struct btrfs_item) *
 			(nritems - slot - 1));
 	}
 	btrfs_set_header_nritems(&leaf->header, nritems - 1);
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 58e03e9..b03df15 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -98,10 +98,10 @@
  * the key flags parameter.  offset and size tell us where to find
  * the item in the leaf (relative to the start of the data area)
  */
-struct item {
+struct btrfs_item {
 	struct btrfs_disk_key key;
-	u16 offset;
-	u16 size;
+	__le16 offset;
+	__le16 size;
 } __attribute__ ((__packed__));
 
 /*
@@ -115,7 +115,8 @@
 struct leaf {
 	struct btrfs_header header;
 	union {
-		struct item items[LEAF_DATA_SIZE/sizeof(struct item)];
+		struct btrfs_item items[LEAF_DATA_SIZE/
+				        sizeof(struct btrfs_item)];
 		u8 data[CTREE_BLOCKSIZE-sizeof(struct btrfs_header)];
 	};
 } __attribute__ ((__packed__));
@@ -152,6 +153,31 @@
 	int slots[MAX_LEVEL];
 };
 
+static inline u16 btrfs_item_offset(struct btrfs_item *item)
+{
+	return le16_to_cpu(item->offset);
+}
+
+static inline void btrfs_set_item_offset(struct btrfs_item *item, u16 val)
+{
+	item->offset = cpu_to_le16(val);
+}
+
+static inline u16 btrfs_item_end(struct btrfs_item *item)
+{
+	return le16_to_cpu(item->offset) + le16_to_cpu(item->size);
+}
+
+static inline u16 btrfs_item_size(struct btrfs_item *item)
+{
+	return le16_to_cpu(item->size);
+}
+
+static inline void btrfs_set_item_size(struct btrfs_item *item, u16 val)
+{
+	item->size = cpu_to_le16(val);
+}
+
 static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu,
 					 struct btrfs_disk_key *disk)
 {
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 475e722..fdf95bd 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -40,8 +40,8 @@
 		BUG();
 	BUG_ON(ret != 0);
 	l = &path.nodes[0]->leaf;
-	item = (struct extent_item *)(l->data +
-				      l->items[path.slots[0]].offset);
+	item = (struct extent_item *)(l->data + btrfs_item_offset(l->items +
+								path.slots[0]));
 	item->refs++;
 
 	BUG_ON(list_empty(&path.nodes[0]->dirty));
@@ -67,7 +67,8 @@
 		BUG();
 	l = &path.nodes[0]->leaf;
 	item = (struct extent_item *)(l->data +
-				      l->items[path.slots[0]].offset);
+				      btrfs_item_offset(l->items +
+							path.slots[0]));
 	*refs = item->refs;
 	release_path(root->extent_root, &path);
 	return 0;
@@ -144,7 +145,7 @@
 	struct btrfs_key key;
 	struct ctree_root *extent_root = root->extent_root;
 	int ret;
-	struct item *item;
+	struct btrfs_item *item;
 	struct extent_item *ei;
 	struct btrfs_key ins;
 
@@ -162,7 +163,8 @@
 		BUG();
 	}
 	item = path.nodes[0]->leaf.items + path.slots[0];
-	ei = (struct extent_item *)(path.nodes[0]->leaf.data + item->offset);
+	ei = (struct extent_item *)(path.nodes[0]->leaf.data +
+				    btrfs_item_offset(item));
 	BUG_ON(ei->refs == 0);
 	ei->refs--;
 	if (ei->refs == 0) {
diff --git a/fs/btrfs/mkfs.c b/fs/btrfs/mkfs.c
index 5290423..0f77bab 100644
--- a/fs/btrfs/mkfs.c
+++ b/fs/btrfs/mkfs.c
@@ -14,7 +14,7 @@
 {
 	struct ctree_root_info info[2];
 	struct leaf empty_leaf;
-	struct item item;
+	struct btrfs_item item;
 	struct extent_item extent_item;
 	int ret;
 
@@ -45,31 +45,37 @@
 	btrfs_set_header_nritems(&empty_leaf.header, 3);
 
 	/* item1, reserve blocks 0-16 */
-	item.key.objectid = cpu_to_le64(0);
-	item.key.offset = cpu_to_le64(17);
-	item.key.flags = cpu_to_le32(0);
-	item.offset = LEAF_DATA_SIZE - sizeof(struct extent_item);
-	item.size = sizeof(struct extent_item);
+	btrfs_set_key_objectid(&item.key, 0);
+	btrfs_set_key_offset(&item.key, 17);
+	btrfs_set_key_flags(&item.key, 0);
+	btrfs_set_item_offset(&item,
+			      LEAF_DATA_SIZE - sizeof(struct extent_item));
+	btrfs_set_item_size(&item, sizeof(struct extent_item));
 	extent_item.refs = 1;
 	extent_item.owner = 0;
 	memcpy(empty_leaf.items, &item, sizeof(item));
-	memcpy(empty_leaf.data + item.offset, &extent_item, item.size);
+	memcpy(empty_leaf.data + btrfs_item_offset(&item), &extent_item,
+		btrfs_item_size(&item));
 
 	/* item2, give block 17 to the root */
-	item.key.objectid = cpu_to_le64(17);
-	item.key.offset = cpu_to_le64(1);
-	item.offset = LEAF_DATA_SIZE - sizeof(struct extent_item) * 2;
+	btrfs_set_key_objectid(&item.key, 17);
+	btrfs_set_key_offset(&item.key, 1);
+	btrfs_set_item_offset(&item,
+			      LEAF_DATA_SIZE - sizeof(struct extent_item) * 2);
 	extent_item.owner = 1;
 	memcpy(empty_leaf.items + 1, &item, sizeof(item));
-	memcpy(empty_leaf.data + item.offset, &extent_item, item.size);
+	memcpy(empty_leaf.data + btrfs_item_offset(&item), &extent_item,
+		btrfs_item_size(&item));
 
 	/* item3, give block 18 for the extent root */
-	item.key.objectid = cpu_to_le64(18);
-	item.key.offset = cpu_to_le64(1);
-	item.offset = LEAF_DATA_SIZE - sizeof(struct extent_item) * 3;
+	btrfs_set_key_objectid(&item.key, 18);
+	btrfs_set_key_offset(&item.key, 1);
+	btrfs_set_item_offset(&item,
+			      LEAF_DATA_SIZE - sizeof(struct extent_item) * 3);
 	extent_item.owner = 2;
 	memcpy(empty_leaf.items + 2, &item, sizeof(item));
-	memcpy(empty_leaf.data + item.offset, &extent_item, item.size);
+	memcpy(empty_leaf.data + btrfs_item_offset(&item), &extent_item,
+		btrfs_item_size(&item));
 	ret = pwrite(fd, &empty_leaf, sizeof(empty_leaf), 18 * CTREE_BLOCKSIZE);
 	if (ret != sizeof(empty_leaf))
 		return -1;
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 7df16b1..33f5ee4 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -9,7 +9,7 @@
 {
 	int i;
 	u32 nr = btrfs_header_nritems(&l->header);
-	struct item *item;
+	struct btrfs_item *item;
 	struct extent_item *ei;
 	printf("leaf %Lu total ptrs %d free space %d\n",
 		btrfs_header_blocknr(&l->header), nr, leaf_free_space(l));
@@ -18,12 +18,15 @@
 		item = l->items + i;
 		printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
 			i,
-			item->key.objectid, item->key.flags, item->key.offset,
-			item->offset, item->size);
+			btrfs_key_objectid(&item->key),
+			btrfs_key_flags(&item->key),
+			btrfs_key_offset(&item->key),
+			btrfs_item_offset(item),
+			btrfs_item_size(item));
 		fflush(stdout);
-		printf("\t\titem data %.*s\n", item->size,
-			l->data+item->offset);
-		ei = (struct extent_item *)(l->data + item->offset);
+		printf("\t\titem data %.*s\n", btrfs_item_size(item),
+			l->data + btrfs_item_offset(item));
+		ei = (struct extent_item *)(l->data + btrfs_item_offset(item));
 		printf("\t\textent data refs %u owner %Lu\n", ei->refs,
 			ei->owner);
 		fflush(stdout);
diff --git a/fs/btrfs/random-test.c b/fs/btrfs/random-test.c
index 34a1584..e767528 100644
--- a/fs/btrfs/random-test.c
+++ b/fs/btrfs/random-test.c
@@ -173,7 +173,7 @@
 			path.slots[0] -= 1;
 		}
 		slot = path.slots[0];
-		found = path.nodes[0]->leaf.items[slot].key.objectid;
+		found=btrfs_key_objectid(&path.nodes[0]->leaf.items[slot].key);
 		ret = del_item(root, &path);
 		count++;
 		if (ret) {
@@ -274,7 +274,8 @@
 			slot -= 1;
 		}
 		for (i = slot; i >= 0; i--) {
-			found = path.nodes[0]->leaf.items[i].key.objectid;
+			found = btrfs_key_objectid(&path.nodes[0]->
+						   leaf.items[i].key);
 			radix_tree_preload(GFP_KERNEL);
 			ret = radix_tree_insert(radix, found, (void *)found);
 			if (ret) {
