[RFC][PATCH 10/10] I/O context inheritance

From: Hirokazu Takahashi
Date: Tue Apr 22 2008 - 10:00:47 EST



The floppy driver will allocate a bio on its stack, so its iocontext
should be set here.

This code hasn't been tested yet.

Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>


--- linux-2.6.25.bio0/drivers/block/floppy.c 2008-04-22 15:48:36.000000000 +0900
+++ linux-2.6.25/drivers/block/floppy.c 2008-04-22 21:33:40.000000000 +0900
@@ -3845,12 +3845,14 @@ static int __floppy_read_block_0(struct
init_completion(&complete);
bio.bi_private = &complete;
bio.bi_end_io = floppy_rb0_complete;
+ bio.bi_io_context = get_io_context(GFP_NOIO, -1);

submit_bio(READ, &bio);
generic_unplug_device(bdev_get_queue(bdev));
process_fd_request();
wait_for_completion(&complete);

+ put_io_context(bio.bi_io_context);
__free_page(page);

return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/