diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-06 15:34:55 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-09-09 10:35:38 +0200 |
commit | 395c72a707d966b36d5a42fe12c3a237ded3a0d9 (patch) | |
tree | 79e4450a4f31409815d80ee8e1a7e1490a140f22 /include/linux/blk_types.h | |
parent | eeea3ac912207dcf759b95b2b4c36f96bce583bf (diff) | |
download | linux-stable-395c72a707d966b36d5a42fe12c3a237ded3a0d9.tar.gz linux-stable-395c72a707d966b36d5a42fe12c3a237ded3a0d9.tar.bz2 linux-stable-395c72a707d966b36d5a42fe12c3a237ded3a0d9.zip |
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 'include/linux/blk_types.h')
-rw-r--r-- | include/linux/blk_types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 7b7ac9ccec7a..af9dd9d2efc4 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -80,6 +80,9 @@ struct bio { struct bio_integrity_payload *bi_integrity; /* data integrity */ #endif + /* If bi_pool is non NULL, bi_destructor is not called */ + struct bio_set *bi_pool; + bio_destructor_t *bi_destructor; /* destructor */ /* |