]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: calculate checksum space correctly
authorJosef Bacik <josef@redhat.com>
Thu, 4 Aug 2011 14:25:02 +0000 (10:25 -0400)
committerJosef Bacik <josef@redhat.com>
Wed, 19 Oct 2011 19:12:31 +0000 (15:12 -0400)
commite5f0cea7a2c541614b68490ef4aa3a633c976b68
treef60b4ff7dafa0fcf64e0d9e9445d6984739cbfe6
parent22093cdf8afc6fe3bf28c34f2b12be05134c46a1
Btrfs: calculate checksum space correctly

We have not been reserving enough space for checksums.  We were just reserving
bytes for the checksum items themselves, we were not taking into account having
to cow the tree and such.  This patch adds a csum_bytes counter to the inode for
keeping track of the number of bytes outstanding we have for checksums.  Then we
calculate how many leaves would be required for the checksums we are given and
use that to reserve space.  This adds a significant amount of bytes to our
reservations, but we will handle this later.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c