Btrfs: many file_write fixes, inline data

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index cb04a70..b2faad3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -111,6 +111,9 @@
 				continue;
 			fi = btrfs_item_ptr(buf_leaf, i,
 					    struct btrfs_file_extent_item);
+			if (btrfs_file_extent_type(fi) ==
+			    BTRFS_FILE_EXTENT_INLINE)
+				continue;
 			ret = btrfs_inc_extent_ref(trans, root,
 				    btrfs_file_extent_disk_blocknr(fi),
 				    btrfs_file_extent_disk_num_blocks(fi));
@@ -539,6 +542,8 @@
 		if (btrfs_disk_key_type(key) != BTRFS_EXTENT_DATA_KEY)
 			continue;
 		fi = btrfs_item_ptr(leaf, i, struct btrfs_file_extent_item);
+		if (btrfs_file_extent_type(fi) == BTRFS_FILE_EXTENT_INLINE)
+			continue;
 		/*
 		 * FIXME make sure to insert a trans record that
 		 * repeats the snapshot del on crash