btrfs: clean snapshots one by one
authorDavid Sterba <dsterba@suse.cz>
Tue, 12 Mar 2013 15:13:28 +0000 (15:13 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:21 +0000 (15:54 -0400)
commit9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c
tree1648c620a5264275004bd09c207292697b450367
parent6841ebee6b02abe178abd30f40806e385cd96777
btrfs: clean snapshots one by one

Each time pick one dead root from the list and let the caller know if
it's needed to continue. This should improve responsiveness during
umount and balance which at some point waits for cleaning all currently
queued dead roots.

A new dead root is added to the end of the list, so the snapshots
disappear in the order of deletion.

The snapshot cleaning work is now done only from the cleaner thread and the
others wake it if needed.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h