]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: add a io_ctl struct and helpers for dealing with the space cache
authorJosef Bacik <josef@redhat.com>
Wed, 5 Oct 2011 19:18:58 +0000 (15:18 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:28 +0000 (21:20 -0500)
commitbaf7a99689ff0a5a81a1ad5dd52b9ae4d81187cc
treefe95b04efd39e263c43f10346b27ea28fda1b8fb
parentea75c3b74915a80e49fa40f58718a81dc15cf8a6
Btrfs: add a io_ctl struct and helpers for dealing with the space cache

In writing and reading the space cache we have one big loop that keeps track of
which page we are on and then a bunch of sizeable loops underneath this big loop
to try and read/write out properly.  Especially in the write case this makes
things hugely complicated and hard to follow, and makes our error checking and
recovery equally as complex.  So add a io_ctl struct with a bunch of helpers to
keep track of the pages we have, where we are, if we have enough space etc.
This unifies how we deal with the pages we're writing and keeps all the messy
tracking internal.  This allows us to kill the big loops in both the read and
write case and makes reviewing and chaning the write and read paths much
simpler.  I've run xfstests and stress.sh on this code and it survives.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit a67509c30079f4c5025fb19ea443fb2906c3a85e)
fs/btrfs/free-space-cache.c