Re: [PATCH] kill bio->bi_set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Axboe <[email protected]> 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 - [email protected]
http://web.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux