Commit 8e05ea56 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] bio documentation update

From: Jens Axboe <axboe@suse.de>

Although it was an established part of the current bio api, it was never
documented that bio_add_page() and merge_bvec_fn() must accept to add at
least one page to an empty bio.
parent f5ace166
......@@ -173,9 +173,11 @@ EXPORT_SYMBOL(blk_queue_prep_rq);
* are dynamic, and thus we have to query the queue whether it is ok to
* add a new bio_vec to a bio at a given offset or not. If the block device
* has such limitations, it needs to register a merge_bvec_fn to control
* the size of bio's sent to it. Per default now merge_bvec_fn is defined for
* a queue, and only the fixed limits are honored.
*
* the size of bio's sent to it. Note that a block device *must* allow a
* single page to be added to an empty bio. The block device driver may want
* to use the bio_split() function to deal with these bio's. By default
* no merge_bvec_fn is defined for a queue, and only the fixed limits are
* honored.
*/
void blk_queue_merge_bvec(request_queue_t *q, merge_bvec_fn *mbfn)
{
......
......@@ -290,7 +290,9 @@ int bio_get_nr_vecs(struct block_device *bdev)
*
* Attempt to add a page to the bio_vec maplist. This can fail for a
* number of reasons, such as the bio being full or target block
* device limitations.
* device limitations. The target block device must allow bio's
* smaller than PAGE_SIZE, so it is always possible to add a single
* page to an empty bio.
*/
int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
unsigned int offset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment