]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: reduce the amount of space needed for truncates
authorJosef Bacik <josef@redhat.com>
Fri, 19 Aug 2011 14:29:59 +0000 (10:29 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:16 +0000 (21:20 -0500)
commitd9b6bbfe79ca745cc959e4b21fdbff9aaafc00a6
tree7cb34b6bd38cbb69f8defabd5e5e41b09cff8673
parent1b8db5d366d5490fd1e4bcb3f81064b8d3f83317
Btrfs: reduce the amount of space needed for truncates

With btrfs_truncate_inode_items we always return if we have to go to another
leaf, which makes us do our reservation again.  This means we will only ever
modify one leaf at a time, so we only need 1 items worth of slack space.  Also,
since we are deleting we will not be creating nodes as we go down, if anything
we'll be free'ing them as we merge them together, so make a different
calculation for truncate which will only have the worst case useage of COW'ing
the entire path down to the leaf.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 07127184efb629f1336c0592bfdacec258cab731)
fs/btrfs/ctree.h
fs/btrfs/inode.c