lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1345670823.10190.21.camel@haakon2.linux-iscsi.org>
Date:	Wed, 22 Aug 2012 14:27:03 -0700
From:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-bcache@...r.kernel.org, linux-kernel@...r.kernel.org,
	dm-devel@...hat.com, tj@...nel.org, vgoyal@...hat.com,
	mpatocka@...hat.com, bharrosh@...asas.com,
	Jens Axboe <axboe@...nel.dk>, NeilBrown <neilb@...e.de>,
	Alasdair Kergon <agk@...hat.com>,
	Lars Ellenberg <lars.ellenberg@...bit.com>,
	target-devel <target-devel@...r.kernel.org>
Subject: Re: [PATCH v6 01/13] block: Generalized bio pool freeing

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@...gle.com>
> CC: Jens Axboe <axboe@...nel.dk>
> CC: NeilBrown <neilb@...e.de>
> CC: Alasdair Kergon <agk@...hat.com>
> CC: Nicholas Bellinger <nab@...ux-iscsi.org>
> CC: Lars Ellenberg <lars.ellenberg@...bit.com>
> Acked-by: Tejun Heo <tj@...nel.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@...ux-iscsi.org>

Nice work Kent!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ