linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix bio_alloc() and bio_kmalloc() documentation
@ 2009-10-31 23:18 Alberto Bertogli
  2009-11-01  9:31 ` Tejun Heo
  2009-11-02 10:38 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Alberto Bertogli @ 2009-10-31 23:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-fsdevel, jens.axboe, tj, Alberto Bertogli

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>
---

I'm not completely sure the mempool part is in the right place. If it's not,
let me know and I'll fix the patch.

Thanks a lot,
		Alberto


 fs/bio.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index bcab9e9..12da5db 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -325,8 +325,16 @@ static void bio_fs_destructor(struct bio *bio)
  *	@gfp_mask: allocation mask to use
  *	@nr_iovecs: number of iovecs
  *
- *	Allocate a new bio with @nr_iovecs bvecs.  If @gfp_mask
- *	contains __GFP_WAIT, the allocation is guaranteed to succeed.
+ *	bio_alloc will allocate a bio and associated bio_vec array that can hold
+ *	at least @nr_iovecs entries. Allocations will be done from the
+ *	fs_bio_set. Also see @bio_alloc_bioset and @bio_kmalloc.
+ *
+ *	If %__GFP_WAIT is set, then bio_alloc will always be able to allocate
+ *	a bio. This is due to the mempool guarantees. To make this work, callers
+ *	must never allocate more than 1 bio at a time from this pool. Callers
+ *	that need to allocate more than 1 bio must always submit the previously
+ *	allocated bio for IO before attempting to allocate a new one. Failure to
+ *	do so can cause livelocks under memory pressure.
  *
  *	RETURNS:
  *	Pointer to new bio on success, NULL on failure.
@@ -350,21 +358,13 @@ static void bio_kmalloc_destructor(struct bio *bio)
 }
 
 /**
- * bio_alloc - allocate a bio for I/O
+ * bio_kmalloc - allocate a bio for I/O using kmalloc()
  * @gfp_mask:   the GFP_ mask given to the slab allocator
  * @nr_iovecs:	number of iovecs to pre-allocate
  *
  * Description:
- *   bio_alloc will allocate a bio and associated bio_vec array that can hold
- *   at least @nr_iovecs entries. Allocations will be done from the
- *   fs_bio_set. Also see @bio_alloc_bioset.
- *
- *   If %__GFP_WAIT is set, then bio_alloc will always be able to allocate
- *   a bio. This is due to the mempool guarantees. To make this work, callers
- *   must never allocate more than 1 bio at a time from this pool. Callers
- *   that need to allocate more than 1 bio must always submit the previously
- *   allocated bio for IO before attempting to allocate a new one. Failure to
- *   do so can cause livelocks under memory pressure.
+ *   Allocate a new bio with @nr_iovecs bvecs.  If @gfp_mask contains
+ *   %__GFP_WAIT, the allocation is guaranteed to succeed.
  *
  **/
 struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs)
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix bio_alloc() and bio_kmalloc() documentation
  2009-10-31 23:18 [PATCH] Fix bio_alloc() and bio_kmalloc() documentation Alberto Bertogli
@ 2009-11-01  9:31 ` Tejun Heo
  2009-11-02 10:38 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2009-11-01  9:31 UTC (permalink / raw)
  To: Alberto Bertogli; +Cc: linux-kernel, linux-fsdevel, jens.axboe

Alberto Bertogli wrote:
> 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>

Oops,

Acked-by: Tejun Heo <tj@kernel.org>

Thank you.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix bio_alloc() and bio_kmalloc() documentation
  2009-10-31 23:18 [PATCH] Fix bio_alloc() and bio_kmalloc() documentation Alberto Bertogli
  2009-11-01  9:31 ` Tejun Heo
@ 2009-11-02 10:38 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-11-02 10:38 UTC (permalink / raw)
  To: Alberto Bertogli; +Cc: linux-kernel, linux-fsdevel, tj

On Sat, Oct 31 2009, Alberto Bertogli wrote:
> 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.

Thanks, applied to for-linus.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-02 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-31 23:18 [PATCH] Fix bio_alloc() and bio_kmalloc() documentation Alberto Bertogli
2009-11-01  9:31 ` Tejun Heo
2009-11-02 10:38 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).