• Christoph Hellwig's avatar
    block: simplify bio_check_pages_dirty · 24d5493f
    Christoph Hellwig authored
    bio_check_pages_dirty currently inviolates the invariant that bv_page of
    a bio_vec inside bi_vcnt shouldn't be zero, and that is going to become
    really annoying with multpath biovecs.  Fortunately there isn't any
    all that good reason for it - once we decide to defer freeing the bio
    to a workqueue holding onto a few additional pages isn't really an
    issue anymore.  So just check if there is a clean page that needs
    dirtying in the first path, and do a second pass to free them if there
    was none, while the cache is still hot.
    
    Also use the chance to micro-optimize bio_dirty_fn a bit by not saving
    irq state - we know we are called from a workqueue.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    24d5493f
bio.c 52.5 KB