diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-06 18:34:55 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-09-09 04:35:38 -0400 |
commit | 395c72a707d966b36d5a42fe12c3a237ded3a0d9 (patch) | |
tree | 79e4450a4f31409815d80ee8e1a7e1490a140f22 /drivers/target | |
parent | eeea3ac912207dcf759b95b2b4c36f96bce583bf (diff) |
block: Generalized bio pool freeing
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@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: NeilBrown <neilb@suse.de>
CC: Alasdair Kergon <agk@redhat.com>
CC: Nicholas Bellinger <nab@linux-iscsi.org>
CC: Lars Ellenberg <lars.ellenberg@linbit.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_iblock.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 76db75e836ed..e58cd7d2fce4 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) | |||
543 | kfree(ibr); | 543 | kfree(ibr); |
544 | } | 544 | } |
545 | 545 | ||
546 | static void iblock_bio_destructor(struct bio *bio) | ||
547 | { | ||
548 | struct se_cmd *cmd = bio->bi_private; | ||
549 | struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr; | ||
550 | |||
551 | bio_free(bio, ib_dev->ibd_bio_set); | ||
552 | } | ||
553 | |||
554 | static struct bio * | 546 | static struct bio * |
555 | iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num) | 547 | iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num) |
556 | { | 548 | { |
@@ -572,7 +564,6 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num) | |||
572 | 564 | ||
573 | bio->bi_bdev = ib_dev->ibd_bd; | 565 | bio->bi_bdev = ib_dev->ibd_bd; |
574 | bio->bi_private = cmd; | 566 | bio->bi_private = cmd; |
575 | bio->bi_destructor = iblock_bio_destructor; | ||
576 | bio->bi_end_io = &iblock_bio_done; | 567 | bio->bi_end_io = &iblock_bio_done; |
577 | bio->bi_sector = lba; | 568 | bio->bi_sector = lba; |
578 | return bio; | 569 | return bio; |