writeback: restructure bdi forker loop a little
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 25 Jul 2010 11:29:19 +0000 (14:29 +0300)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:53:56 +0000 (18:53 +0200)
commitadf392407076b85816d48714fb8eeaedb2157884
treee926a18b55e67724e0267fe359caf51d530d5b09
parentecd584030da67ede1bf17955746a6ce834d9fc6b
writeback: restructure bdi forker loop a little

This patch re-structures the bdi forker a little:
1. Add 'bdi_cap_flush_forker(bdi)' condition check to the bdi loop. The reason
   for this is that the forker thread can start _before_ the 'BDI_registered'
   flag is set (see 'bdi_register()'), so the WARN() statement will fire for
   the default bdi. I observed this warning at boot-up.

2. Introduce an enum 'action' and use "switch" statement in the outer loop.
   This is a preparation to the further patch which will teach the forker
   thread killing bdi threads, so we'll have another case in the "switch"
   statement. This change was suggested by Christoph Hellwig.

This patch is just a small step towards the coming change where the forker
thread will kill the bdi threads. It should simplify reviewing the following
changes, which would otherwise be larger.

This patch also amends comments a little.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
mm/backing-dev.c