]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: calculate checksum space correctly
authorJosef Bacik <josef@redhat.com>
Thu, 4 Aug 2011 14:25:02 +0000 (10:25 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:12 +0000 (21:20 -0500)
commitdc9ad5c12ef8900b4a7d5c33c4a845f2441365db
tree4e6fe05ff42782610e013889d5dba19af8bcb539
parent1a3eded8882b3a70ad73666b2ff5609e4530a649
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>
(cherry picked from commit 7709cde33f12db71efb377fae4ae7aab6c94ebc6)
fs/btrfs/btrfs_inode.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c