Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758716Ab2EXRrN (ORCPT ); Thu, 24 May 2012 13:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49923 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753677Ab2EXRrL (ORCPT ); Thu, 24 May 2012 13:47:11 -0400 Date: Thu, 24 May 2012 13:46:49 -0400 From: Vivek Goyal To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, tj@kernel.org, axboe@kernel.dk, agk@redhat.com, neilb@suse.de, drbd-dev@lists.linbit.com, bharrosh@panasas.com, mpatocka@redhat.com, sage@newdream.net, yehuda@hq.newdream.net Subject: Re: [PATCH v2 01/14] block: Generalized bio pool freeing Message-ID: <20120524174649.GC27550@redhat.com> References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1337817771-25038-2-git-send-email-koverstreet@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1114 Lines: 34 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 -- 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/