[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [PATCH v7 3/9] block: Add bio_reset()
- From: Tejun Heo <tj kernel org>
- To: Kent Overstreet <koverstreet google com>
- Cc: Jens Axboe <axboe kernel dk>, dm-devel redhat com, linux-kernel vger kernel org, linux-bcache vger kernel org, mpatocka redhat com, bharrosh panasas com, vgoyal redhat com
- Subject: Re: [dm-devel] [PATCH v7 3/9] block: Add bio_reset()
- Date: Tue, 28 Aug 2012 13:31:48 -0700
Hello, Kent.
On Tue, Aug 28, 2012 at 10:37:30AM -0700, Kent Overstreet wrote:
> Reusing bios is something that's been highly frowned upon in the past,
> but driver code keeps doing it anyways. If it's going to happen anyways,
> we should provide a generic method.
>
> This'll help with getting rid of bi_destructor - drivers/block/pktcdvd.c
> was open coding it, by doing a bio_init() and resetting bi_destructor.
Better to explain why some bio fields are re-ordered and why that
shouldn't make things worse cacheline-wise?
> +void bio_reset(struct bio *bio)
> +{
Function comment explaining what it does and why it does what it does
with integrity / bi_css / whatnot?
> + unsigned long flags = bio->bi_flags & (~0UL << BIO_RESET_BITS);
> +
> + if (bio_integrity(bio))
> + bio_integrity_free(bio, bio->bi_pool);
> +
> + bio_disassociate_task(bio);
Is this desirable? Why?
Thanks.
--
tejun
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]