diff options
author | Peter Osterlund <petero2@telia.com> | 2005-09-06 18:16:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:20 -0400 |
commit | 3676347a5e216a7fec7f8eedbbcf8bed6b9c4e40 (patch) | |
tree | 3b5880b862390590da8edfb98c3e62aa573d0b28 /drivers | |
parent | 6f00df24ee394f345a8789d3a2f98fc1d9195b9f (diff) |
[PATCH] kill bio->bi_set
Jens:
->bi_set is totally unnecessary bloat of struct bio. Just define a proper
destructor for the bio and it already knows what bio_set it belongs too.
Peter:
Fixed the bugs.
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-io.c | 6 | ||||
-rw-r--r-- | drivers/md/dm.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 45754bb6a799..9de000131a8a 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -239,6 +239,11 @@ static void vm_dp_init(struct dpages *dp, void *data) | |||
239 | dp->context_ptr = data; | 239 | dp->context_ptr = data; |
240 | } | 240 | } |
241 | 241 | ||
242 | static void dm_bio_destructor(struct bio *bio) | ||
243 | { | ||
244 | bio_free(bio, _bios); | ||
245 | } | ||
246 | |||
242 | /*----------------------------------------------------------------- | 247 | /*----------------------------------------------------------------- |
243 | * IO routines that accept a list of pages. | 248 | * IO routines that accept a list of pages. |
244 | *---------------------------------------------------------------*/ | 249 | *---------------------------------------------------------------*/ |
@@ -263,6 +268,7 @@ static void do_region(int rw, unsigned int region, struct io_region *where, | |||
263 | bio->bi_bdev = where->bdev; | 268 | bio->bi_bdev = where->bdev; |
264 | bio->bi_end_io = endio; | 269 | bio->bi_end_io = endio; |
265 | bio->bi_private = io; | 270 | bio->bi_private = io; |
271 | bio->bi_destructor = dm_bio_destructor; | ||
266 | bio_set_region(bio, region); | 272 | bio_set_region(bio, region); |
267 | 273 | ||
268 | /* | 274 | /* |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index d487d9deb98e..930b9fc27953 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -399,6 +399,11 @@ struct clone_info { | |||
399 | unsigned short idx; | 399 | unsigned short idx; |
400 | }; | 400 | }; |
401 | 401 | ||
402 | static void dm_bio_destructor(struct bio *bio) | ||
403 | { | ||
404 | bio_free(bio, dm_set); | ||
405 | } | ||
406 | |||
402 | /* | 407 | /* |
403 | * Creates a little bio that is just does part of a bvec. | 408 | * Creates a little bio that is just does part of a bvec. |
404 | */ | 409 | */ |
@@ -410,6 +415,7 @@ static struct bio *split_bvec(struct bio *bio, sector_t sector, | |||
410 | struct bio_vec *bv = bio->bi_io_vec + idx; | 415 | struct bio_vec *bv = bio->bi_io_vec + idx; |
411 | 416 | ||
412 | clone = bio_alloc_bioset(GFP_NOIO, 1, dm_set); | 417 | clone = bio_alloc_bioset(GFP_NOIO, 1, dm_set); |
418 | clone->bi_destructor = dm_bio_destructor; | ||
413 | *clone->bi_io_vec = *bv; | 419 | *clone->bi_io_vec = *bv; |
414 | 420 | ||
415 | clone->bi_sector = sector; | 421 | clone->bi_sector = sector; |