OSDN Git Service

block: clarify that bio_add_page() and related helpers can add multi pages
authorMing Lei <ming.lei@redhat.com>
Tue, 23 Apr 2019 02:51:04 +0000 (10:51 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 23 Apr 2019 13:57:07 +0000 (07:57 -0600)
commit551879a48f01826fd86568d7bd1e774cb0de3295
tree5278aedd731a02b77f5dbc3fc23553e34f8728a0
parent6c88d73515c444323c57fba9069456b819700e79
block: clarify that bio_add_page() and related helpers can add multi pages

bio_add_page() and __bio_add_page() are capable of adding pages into
bio, and now we have at least two such usages alreay:

- __bio_iov_bvec_add_pages()
- nvmet_bdev_execute_rw().

So update comments on these two helpers.

The thing is a bit special for __bio_try_merge_page(), given the caller
needs to know if the new added page is same with the last added page,
then it isn't safe to pass multi-page in case that 'same_page' is true,
so adds warning on potential misuse, and updates comment on
__bio_try_merge_page().

Cc: linux-xfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c