lkml.org 
[lkml]   [2005]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kill bio->bi_set
From
Date
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.

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

> @@ -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
set bi_destructor, but this is forgotten in bio_clone() in bio.c and
in split_bvec() in dm.c.

--
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-23 22:02    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site