Btrfs: add owner and type fields to the extents aand block headers

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b2faad3..49f7cd6 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -460,9 +460,10 @@
  *
  * returns 0 if everything worked, non-zero otherwise.
  */
-int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
-			*root, u64 num_blocks, u64 search_start, u64
-			search_end, struct btrfs_key *ins)
+int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
+		       struct btrfs_root *root, u64 owner,
+		       u8 type, u64 num_blocks, u64 search_start,
+		       u64 search_end, struct btrfs_key *ins)
 {
 	int ret;
 	int pending_ret;
@@ -472,6 +473,8 @@
 	struct btrfs_extent_item extent_item;
 
 	btrfs_set_extent_refs(&extent_item, 1);
+	btrfs_set_extent_owner(&extent_item, owner);
+	btrfs_set_extent_type(&extent_item, type);
 
 	if (root == extent_root) {
 		BUG_ON(extent_root->fs_info->current_insert.offset == 0);
@@ -508,13 +511,15 @@
  * returns the tree buffer or NULL.
  */
 struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
-					    struct btrfs_root *root)
+					   struct btrfs_root *root)
 {
 	struct btrfs_key ins;
 	int ret;
 	struct buffer_head *buf;
 
-	ret = btrfs_alloc_extent(trans, root, 1, 0, (unsigned long)-1, &ins);
+	ret = btrfs_alloc_extent(trans, root, root->root_key.objectid,
+				 BTRFS_EXTENT_TREE,
+				 1, 0, (unsigned long)-1, &ins);
 	if (ret) {
 		BUG();
 		return NULL;