]> git.baikalelectronics.ru Git - kernel.git/commit
block: simplify bio_check_pages_dirty
authorChristoph Hellwig <hch@lst.de>
Tue, 24 Jul 2018 12:04:12 +0000 (14:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 24 Jul 2018 20:39:27 +0000 (14:39 -0600)
commit87ca79f5d7d2f8527216440e4d9c0f390794bbe2
tree5b4239636db01bf3f2a173ae4f32228afc8ce873
parentef72b044a2b0c7960bb49125c77b48f2bd3c2120
block: simplify bio_check_pages_dirty

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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c