dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
To: Kent Overstreet <koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	mpatocka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org,
	Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>,
	Alasdair Kergon <agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Lars Ellenberg
	<lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org>,
	target-devel
	<target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v6 01/13] block: Generalized bio pool freeing
Date: Wed, 22 Aug 2012 14:27:03 -0700	[thread overview]
Message-ID: <1345670823.10190.21.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1345655050-28199-2-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Wed, 2012-08-22 at 10:03 -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.
> 
> v6: Explain the temporary if statement in bio_put
> 
> Signed-off-by: Kent Overstreet <koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> CC: Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
> CC: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
> CC: Alasdair Kergon <agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> CC: Nicholas Bellinger <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
> CC: Lars Ellenberg <lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org>
> Acked-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
>  drivers/block/drbd/drbd_main.c      | 13 +------------
>  drivers/md/dm-crypt.c               |  9 ---------
>  drivers/md/dm-io.c                  | 11 -----------
>  drivers/md/dm.c                     | 20 --------------------
>  drivers/md/md.c                     | 28 ++++------------------------
>  drivers/target/target_core_iblock.c |  9 ---------
>  fs/bio.c                            | 31 +++++++++++++------------------
>  include/linux/blk_types.h           |  3 +++
>  8 files changed, 21 insertions(+), 103 deletions(-)
> 

<SNIP>

> diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
> index 76db75e..e58cd7d 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> @@ -543,14 +543,6 @@ static void iblock_complete_cmd(struct se_cmd *cmd)
>  	kfree(ibr);
>  }
>  
> -static void iblock_bio_destructor(struct bio *bio)
> -{
> -	struct se_cmd *cmd = bio->bi_private;
> -	struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr;
> -
> -	bio_free(bio, ib_dev->ibd_bio_set);
> -}
> -
>  static struct bio *
>  iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num)
>  {
> @@ -572,7 +564,6 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num)
>  
>  	bio->bi_bdev = ib_dev->ibd_bd;
>  	bio->bi_private = cmd;
> -	bio->bi_destructor = iblock_bio_destructor;
>  	bio->bi_end_io = &iblock_bio_done;
>  	bio->bi_sector = lba;
>  	return bio;

The change to drop iblock_bio_destructor() looks fine to me.  For the
drivers/target/ bit, feel free to add:

Acked-by: Nicholas Bellinger <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>

Nice work Kent!

  parent reply	other threads:[~2012-08-22 21:27 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 17:03 [PATCH v6 00/13] Block cleanups Kent Overstreet
2012-08-22 17:03 ` [PATCH v6 01/13] block: Generalized bio pool freeing Kent Overstreet
     [not found]   ` <1345655050-28199-2-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:27     ` Nicholas A. Bellinger [this message]
2012-08-22 17:03 ` [PATCH v6 02/13] dm: Use bioset's front_pad for dm_rq_clone_bio_info Kent Overstreet
     [not found]   ` <1345655050-28199-3-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 18:32     ` Tejun Heo
2012-08-22 21:30     ` Vivek Goyal
     [not found]       ` <20120822213010.GA8020-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-24  7:14         ` Kent Overstreet
     [not found]           ` <20120824071448.GF11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 18:40             ` Vivek Goyal
2012-08-22 17:04 ` [PATCH v6 03/13] block: Add bio_reset() Kent Overstreet
     [not found]   ` <1345655050-28199-4-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 18:34     ` Tejun Heo
2012-08-22 19:51       ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 04/13] pktcdvd: Switch to bio_kmalloc() Kent Overstreet
     [not found]   ` <1345655050-28199-5-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 19:55     ` Tejun Heo
     [not found]       ` <20120822195546.GG19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-28 23:19         ` Jiri Kosina
2012-08-29  4:35           ` Peter Osterlund
2012-09-03 16:15         ` Jiri Kosina
2012-08-22 17:04 ` [PATCH v6 05/13] block: Kill bi_destructor Kent Overstreet
     [not found]   ` <1345655050-28199-6-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:00     ` Tejun Heo
     [not found]       ` <20120822200032.GH19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  5:09         ` Kent Overstreet
2012-08-22 17:04 ` [PATCH v6 06/13] block: Consolidate bio_alloc_bioset(), bio_kmalloc() Kent Overstreet
     [not found]   ` <1345655050-28199-7-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:17     ` Tejun Heo
     [not found]       ` <20120822201730.GI19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  5:04         ` Kent Overstreet
     [not found]           ` <20120824050400.GA11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:08             ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 07/13] block: Avoid deadlocks with bio allocation by stacking drivers Kent Overstreet
2012-08-22 20:30   ` Tejun Heo
2012-08-24  5:55     ` Kent Overstreet
     [not found]       ` <20120824055554.GC11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:28         ` Tejun Heo
2012-08-22 17:04 ` [PATCH v6 11/13] block: Rework bio_pair_split() Kent Overstreet
     [not found]   ` <1345655050-28199-12-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:04     ` Tejun Heo
     [not found]       ` <20120822210410.GL19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  2:25         ` Martin K. Petersen
     [not found]           ` <yq1y5l5hvpw.fsf-+q57XtR/GgMb6DWv4sQWN6xOck334EZe@public.gmane.org>
2012-08-24 10:37             ` Kent Overstreet
2012-08-24 20:58             ` Tejun Heo
2012-08-24 10:30       ` Kent Overstreet
2012-08-24 20:53         ` Tejun Heo
     [not found] ` <1345655050-28199-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:04   ` [PATCH v6 08/13] block: Add an explicit bio flag for bios that own their bvec Kent Overstreet
     [not found]     ` <1345655050-28199-9-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:43       ` Adrian Bunk
     [not found]         ` <20120822174351.GA27453-c9qLp6CXzmZPEsXTsnYjsA@public.gmane.org>
2012-08-22 19:22           ` Kent Overstreet
2012-08-22 20:00             ` Adrian Bunk
     [not found]               ` <20120822200038.GB27453-c9qLp6CXzmZPEsXTsnYjsA@public.gmane.org>
2012-08-28 17:23                 ` Kent Overstreet
2012-08-22 17:04   ` [PATCH v6 09/13] block: Rename bio_split() -> bio_pair_split() Kent Overstreet
2012-08-22 17:04   ` [PATCH v6 10/13] block: Introduce new bio_split() Kent Overstreet
     [not found]     ` <1345655050-28199-11-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:46       ` Tejun Heo
2012-08-22 17:04   ` [PATCH v6 12/13] block: Add bio_clone_bioset(), bio_clone_kmalloc() Kent Overstreet
     [not found]     ` <1345655050-28199-13-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 17:13       ` Jeff Garzik
2012-08-22 21:07       ` Tejun Heo
     [not found]         ` <20120822210740.GM19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  6:24           ` Kent Overstreet
     [not found]             ` <20120824062418.GD11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:36               ` Tejun Heo
2012-08-23 18:00   ` [PATCH v6 00/13] Block cleanups Vivek Goyal
     [not found]     ` <20120823180041.GK12232-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-24 12:46       ` Kent Overstreet
2012-08-22 17:04 ` [PATCH v6 13/13] block: Only clone bio vecs that are in use Kent Overstreet
     [not found]   ` <1345655050-28199-14-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-22 21:10     ` Tejun Heo
     [not found]       ` <20120822211045.GN19212-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-24  7:05         ` Kent Overstreet
     [not found]           ` <20120824070508.GE11977-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-08-24 20:42             ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345670823.10190.21.camel@haakon2.linux-iscsi.org \
    --to=nab-izhhd5pylfbp7fqvkimdcq@public.gmane.org \
    --cc=agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org \
    --cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org \
    --cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mpatocka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=neilb-l3A5Bk7waGM@public.gmane.org \
    --cc=target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).