Btrfs: Allow worker threads to exit when idle
authorChris Mason <chris.mason@oracle.com>
Tue, 4 Aug 2009 20:56:34 +0000 (16:56 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 11 Sep 2009 17:30:56 +0000 (13:30 -0400)
The Btrfs worker threads don't currently die off after they have
been idle for a while, leading to a lot of threads sitting around
doing nothing for each mount.

Also, they are unable to start atomically (from end_io hanlders).

This commit reworks the worker threads so they can be started
from end_io handlers (just setting a flag that asks for a thread
to be added at a later date) and so they can exit if they
have been idle for a long time.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

No differences found