diff options
| author | Alberto Bertogli <albertito@blitiri.com.ar> | 2009-11-02 05:39:42 -0500 |
|---|---|---|
| committer | Jens Axboe <jens.axboe@oracle.com> | 2009-11-02 05:41:13 -0500 |
| commit | 5f04eeb8a76521dec371ceb05e8263889a8af2bc (patch) | |
| tree | ec69a41f4e6258994aee7720bdee645ad569bc73 /fs | |
| parent | ad0bf11070ebb3c95f8ce82e6219dbd79c8e8b69 (diff) | |
Fix bio_alloc() and bio_kmalloc() documentation
Commit 451a9ebf accidentally broke bio_alloc() and bio_kmalloc() comments by
(almost) swapping them.
This patch fixes that, by placing the comments in the right place.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/bio.c | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -325,8 +325,16 @@ static void bio_fs_destructor(struct bio *bio) | |||
| 325 | * @gfp_mask: allocation mask to use | 325 | * @gfp_mask: allocation mask to use |
| 326 | * @nr_iovecs: number of iovecs | 326 | * @nr_iovecs: number of iovecs |
| 327 | * | 327 | * |
| 328 | * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask | 328 | * bio_alloc will allocate a bio and associated bio_vec array that can hold |
| 329 | * contains __GFP_WAIT, the allocation is guaranteed to succeed. | 329 | * at least @nr_iovecs entries. Allocations will be done from the |
| 330 | * fs_bio_set. Also see @bio_alloc_bioset and @bio_kmalloc. | ||
| 331 | * | ||
| 332 | * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate | ||
| 333 | * a bio. This is due to the mempool guarantees. To make this work, callers | ||
| 334 | * must never allocate more than 1 bio at a time from this pool. Callers | ||
| 335 | * that need to allocate more than 1 bio must always submit the previously | ||
| 336 | * allocated bio for IO before attempting to allocate a new one. Failure to | ||
| 337 | * do so can cause livelocks under memory pressure. | ||
| 330 | * | 338 | * |
| 331 | * RETURNS: | 339 | * RETURNS: |
| 332 | * Pointer to new bio on success, NULL on failure. | 340 | * Pointer to new bio on success, NULL on failure. |
| @@ -350,21 +358,13 @@ static void bio_kmalloc_destructor(struct bio *bio) | |||
| 350 | } | 358 | } |
| 351 | 359 | ||
| 352 | /** | 360 | /** |
| 353 | * bio_alloc - allocate a bio for I/O | 361 | * bio_kmalloc - allocate a bio for I/O using kmalloc() |
| 354 | * @gfp_mask: the GFP_ mask given to the slab allocator | 362 | * @gfp_mask: the GFP_ mask given to the slab allocator |
| 355 | * @nr_iovecs: number of iovecs to pre-allocate | 363 | * @nr_iovecs: number of iovecs to pre-allocate |
| 356 | * | 364 | * |
| 357 | * Description: | 365 | * Description: |
| 358 | * bio_alloc will allocate a bio and associated bio_vec array that can hold | 366 | * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask contains |
| 359 | * at least @nr_iovecs entries. Allocations will be done from the | 367 | * %__GFP_WAIT, the allocation is guaranteed to succeed. |
| 360 | * fs_bio_set. Also see @bio_alloc_bioset. | ||
| 361 | * | ||
| 362 | * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate | ||
| 363 | * a bio. This is due to the mempool guarantees. To make this work, callers | ||
| 364 | * must never allocate more than 1 bio at a time from this pool. Callers | ||
| 365 | * that need to allocate more than 1 bio must always submit the previously | ||
| 366 | * allocated bio for IO before attempting to allocate a new one. Failure to | ||
| 367 | * do so can cause livelocks under memory pressure. | ||
| 368 | * | 368 | * |
| 369 | **/ | 369 | **/ |
| 370 | struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) | 370 | struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) |
