Btrfs: fix wrong reservation of csums
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 28 Mar 2013 08:08:20 +0000 (08:08 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Thu, 28 Mar 2013 13:51:30 +0000 (09:51 -0400)
commit39847c4d3d91f487f9ab3d083ee5d0f8419f105c
tree9de238dbe4fbe627d4b8914561827cf6b3d9c19e
parenta7975026ff9ddf91ba190ae2b71699dd156395e3
Btrfs: fix wrong reservation of csums

We reserve the space for csums only when we write data into a file, in
the other cases, such as tree log, log replay, we don't do reservation,
so we can use the reservation of the transaction handle just for the former.
And for the latter, we should use the tree's own reservation. But the
function - btrfs_csum_file_blocks() didn't differentiate between these
two types of the cases, fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/file-item.c
fs/btrfs/inode.c