• Artem Bityutskiy's avatar
    writeback: restructure bdi forker loop a little · adf39240
    Artem Bityutskiy authored
    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: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
    adf39240
backing-dev.c 15.9 KB