- Subject: Re: [PATCH v2 01/14] block: Generalized bio pool freeing
- From: Vivek Goyal <vgoyal@xxxxxxxxxx>
- Date: Thu, 24 May 2012 13:46:49 -0400
- Cc: axboe@xxxxxxxxx, yehuda@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, tj@xxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, mpatocka@xxxxxxxxxx, bharrosh@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, sage@xxxxxxxxxxxx, agk@xxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx
- In-reply-to: <1337817771-25038-2-git-send-email-koverstreet@google.com>
- References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com>
- Reply-to: device-mapper development <dm-devel@xxxxxxxxxx>
- User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, May 23, 2012 at 05:02:38PM -0700, Kent Overstreet wrote:
> With the old code, when you allocate a bio from a bio pool you have to
> implement your own destructor that knows how to find the bio pool the
> bio was originally allocated from.
>
> This adds a new field to struct bio (bi_pool) and changes
> bio_alloc_bioset() to use it. This makes various bio destructors
> unnecessary, so they're then deleted.
>
[..]
> @@ -419,7 +406,11 @@ void bio_put(struct bio *bio)
> */
> if (atomic_dec_and_test(&bio->bi_cnt)) {
> bio->bi_next = NULL;
> - bio->bi_destructor(bio);
> +
> + if (bio->bi_pool)
> + bio_free(bio, bio->bi_pool);
> + else
> + bio->bi_destructor(bio);
If you have removed all the users of bi_destructor, then I am wondering that
why are we retaining this field and trying to call into it when bio_pool
is not set?
Thanks
Vivek
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel
[DM Crypt]
[Fedora Desktop]
[ATA RAID]
[Fedora Marketing]
[Fedora Packaging]
[Fedora SELinux]
[Yosemite Discussion]
[Yosemite Photos]
[KDE Users]
[Fedora Tools]
[Fedora Docs]