lkml.org 
[lkml]   [2009]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs/bio: bio_alloc_bioset: pass right object ptr to mempool_free
On Sun, Feb 15 2009, Subhash Peddamallu wrote:
> When freeing from bio pool use right ptr to account for bs->front_pad,
> instead of bio ptr,
>
> Signed-off-by: Subhash Peddamallu <subhash.peddamallu@gmail.com>
> ---
> fs/bio.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/bio.c b/fs/bio.c
> index 062299a..72ab251 100644
> --- a/fs/bio.c
> +++ b/fs/bio.c
> @@ -302,9 +302,10 @@ void bio_init(struct bio *bio)
> struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
> {
> struct bio *bio = NULL;
> + void *p;
>
> if (bs) {
> - void *p = mempool_alloc(bs->bio_pool, gfp_mask);
> + p = mempool_alloc(bs->bio_pool, gfp_mask);
>
> if (p)
> bio = p + bs->front_pad;
> @@ -329,7 +330,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int
> nr_iovecs, struct bio_set *bs)
> }
> if (unlikely(!bvl)) {
> if (bs)
> - mempool_free(bio, bs->bio_pool);
> + mempool_free(p, bs->bio_pool);
> else
> kfree(bio);
> bio = NULL;
> --
> 1.5.6.3

Thanks, applied.

--
Jens Axboe



\
 
 \ /
  Last update: 2009-02-18 12:23    [W:0.039 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site