]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make the delalloc block rsv per inode
authorJosef Bacik <josef@toxicpanda.com>
Thu, 19 Oct 2017 18:15:57 +0000 (14:15 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Nov 2017 19:45:35 +0000 (20:45 +0100)
commitc65c1ab3c4fe3f51cb07111b212d35d8ec8741f4
treef1fce885741f552319a33c65f5957da8fe78aa77
parent4456b48950fde15b79c9384d1007ac1d439ebfc7
btrfs: make the delalloc block rsv per inode

The way we handle delalloc metadata reservations has gotten
progressively more complicated over the years.  There is so much cruft
and weirdness around keeping the reserved count and outstanding counters
consistent and handling the error cases that it's impossible to
understand.

Fix this by making the delalloc block rsv per-inode.  This way we can
calculate the actual size of the outstanding metadata reservations every
time we make a change, and then reserve the delta based on that amount.
This greatly simplifies the code everywhere, and makes the error
handling in btrfs_delalloc_reserve_metadata far less terrifying.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/ctree.h
fs/btrfs/delayed-inode.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/inode.c