block: Generalized bio pool freeing
authorKent Overstreet <koverstreet@google.com>
Thu, 6 Sep 2012 22:34:55 +0000 (15:34 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 9 Sep 2012 08:35:38 +0000 (10:35 +0200)
commit395c72a707d966b36d5a42fe12c3a237ded3a0d9
tree79e4450a4f31409815d80ee8e1a7e1490a140f22
parenteeea3ac912207dcf759b95b2b4c36f96bce583bf
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>
drivers/block/drbd/drbd_main.c
drivers/md/dm-crypt.c
drivers/md/dm-io.c
drivers/md/dm.c
drivers/md/md.c
drivers/target/target_core_iblock.c
fs/bio.c
include/linux/blk_types.h