btrfs: 32-bit type problems

An assorted set of casts to get rid of the warnings on 32-bit archs.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6b2f2b4..7de7707 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -149,7 +149,7 @@
 	if (ret)
 		return NULL;
 
-	block_group = (struct btrfs_block_group_cache *)ptr;
+	block_group = (struct btrfs_block_group_cache *)(unsigned long)ptr;
 
 
 	if (block_group->key.objectid <= bytenr && bytenr <=
@@ -279,7 +279,7 @@
 		if (ret)
 			break;
 
-		cache = (struct btrfs_block_group_cache *)ptr;
+		cache = (struct btrfs_block_group_cache *)(unsigned long)ptr;
 		last = cache->key.objectid + cache->key.offset;
 		used = btrfs_block_group_used(&cache->item);
 
@@ -537,7 +537,7 @@
 		if (ret)
 			break;
 
-		cache = (struct btrfs_block_group_cache *)ptr;
+		cache = (struct btrfs_block_group_cache *)(unsigned long)ptr;
 		err = write_one_cache_group(trans, root,
 					    path, cache);
 		/*
@@ -1541,7 +1541,7 @@
 				found_key.objectid + found_key.offset - 1,
 				bit | EXTENT_LOCKED, GFP_NOFS);
 		set_state_private(block_group_cache, found_key.objectid,
-				  (u64)cache);
+				  (unsigned long)cache);
 
 		if (key.objectid >=
 		    btrfs_super_total_bytes(&info->super_copy))