All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Peter Osterlund <petero2@telia.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	dmo@osdl.org
Subject: Re: [PATCH] kill bio->bi_set
Date: Sat, 23 Jul 2005 22:59:56 +0200	[thread overview]
Message-ID: <20050723205956.GA17370@suse.de> (raw)
In-Reply-To: <m34qaljnvd.fsf@telia.com>

On Sat, Jul 23 2005, Peter Osterlund wrote:
> Jens Axboe <axboe@suse.de> writes:
> 
> > Dunno why I didn't notice before, but ->bi_set is totally unnecessary
> > bloat of struct bio. Just define a proper destructor for the bio and it
> > already knows what bio_set it belongs too.
> 
> This causes crashes on my computer.

Did I neglect to mention it was untested? :)

> > +void bio_free(struct bio *bio, struct bio_set *bio_set)
> >  {
> >  	const int pool_idx = BIO_POOL_IDX(bio);
> > -	struct bio_set *bs = bio->bi_set;
> >  
> >  	BIO_BUG_ON(pool_idx >= BIOVEC_NR_POOLS);
> >  
> > -	mempool_free(bio->bi_io_vec, bs->bvec_pools[pool_idx]);
> > -	mempool_free(bio, bs->bio_pool);
> > +	mempool_free(bio->bi_io_vec, fs_bio_set->bvec_pools[pool_idx]);
> > +	mempool_free(bio, fs_bio_set->bio_pool);
> > +}
> 
> This function uses fs_bio_set instead of the function parameter
> bio_set.

Clear mistake, thanks.

> > @@ -171,8 +175,6 @@ struct bio *bio_alloc_bioset(unsigned in
> >  			bio->bi_max_vecs = bvec_slabs[idx].nr_vecs;
> >  		}
> >  		bio->bi_io_vec = bvl;
> > -		bio->bi_destructor = bio_destructor;
> > -		bio->bi_set = bs;
> >  	}
> 
> This change means that all code that calls bio_alloc_bioset() must now

Correct. The alternative was to require a destructor function passed
into bio_alloc_bioset().

> set bi_destructor, but this is forgotten in bio_clone() in bio.c and
> in split_bvec() in dm.c.

Thanks, I'll go over these and submit a fixed version.

-- 
Jens Axboe


  reply	other threads:[~2005-07-23 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20 22:29 [PATCH] kill bio->bi_set Jens Axboe
2005-07-23 19:58 ` Peter Osterlund
2005-07-23 20:59   ` Jens Axboe [this message]
2005-07-26  0:03     ` Peter Osterlund
2005-07-26  2:16       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050723205956.GA17370@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=dmo@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.