diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-15 19:50:51 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-22 08:35:10 +0200 |
commit | 451a9ebf653d28337ba53ed5b4b70b0b9543cca1 (patch) | |
tree | ab203dfb628623483a1aeb7ead564ea35ad21d29 /drivers | |
parent | cd0aca2d550f238d80ba58e7dcade4ea3d0a3aa7 (diff) | |
download | linux-451a9ebf653d28337ba53ed5b4b70b0b9543cca1.tar.gz linux-451a9ebf653d28337ba53ed5b4b70b0b9543cca1.tar.bz2 linux-451a9ebf653d28337ba53ed5b4b70b0b9543cca1.zip |
bio: fix bio_kmalloc()
Impact: fix bio_kmalloc() and its destruction path
bio_kmalloc() was broken in two ways.
* bvec_alloc_bs() first allocates bvec using kmalloc() and then
ignores it and allocates again like non-kmalloc bvecs.
* bio_kmalloc_destructor() didn't check for and free bio integrity
data.
This patch fixes the above problems. kmalloc patch is separated out
from bio_alloc_bioset() and allocates the requested number of bvecs as
inline bvecs.
* bio_alloc_bioset() no longer takes NULL @bs. None other than
bio_kmalloc() used it and outside users can't know how it was
allocated anyway.
* Define and use BIO_POOL_NONE so that pool index check in
bvec_free_bs() triggers if inline or kmalloc allocated bvec gets
there.
* Relocate destructors on top of each allocation function so that how
they're used is more clear.
Jens Axboe suggested allocating bvecs inline.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions