OSDN Git Service

block: tidy up the bio full checks in bio_add_hw_page
authorChristoph Hellwig <hch@lst.de>
Mon, 24 Jul 2023 16:54:26 +0000 (09:54 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 25 Jul 2023 01:55:16 +0000 (19:55 -0600)
commitcd1d83e24e689f25de7e34bea697971750138d5f
tree788fef148baffc1e83b709ac030addd27ce63495
parent8f63fef5867fb5e8c29d9c14b6d739bfc1869d32
block: tidy up the bio full checks in bio_add_hw_page

bio_add_hw_page already checks if the number of bytes trying to be added
even fit into max_hw_sectors limit of the queue.   Remove the call to
bio_full and just do a check for the smaller of the number of segments
in the bio and the queue max segments limit, and do this cheap check
before the more expensive gap to previous check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jinyoung Choi <j-young.choi@samsung.com>
Link: https://lore.kernel.org/r/20230724165433.117645-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c