From 7ba1ba12eeef0aa7113beb16410ef8b7c748e18b Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Mon, 30 Jun 2008 20:04:41 +0200 Subject: block: Block layer data integrity support Some block devices support verifying the integrity of requests by way of checksums or other protection information that is submitted along with the I/O. This patch implements support for generating and verifying integrity metadata, as well as correctly merging, splitting and cloning bios and requests that have this extra information attached. See Documentation/block/data-integrity.txt for more information. Signed-off-by: Martin K. Petersen Signed-off-by: Jens Axboe --- block/elevator.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'block/elevator.c') diff --git a/block/elevator.c b/block/elevator.c index 902dd1344d5..1f5bfe69602 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -86,6 +86,12 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio) if (rq->rq_disk != bio->bi_bdev->bd_disk || rq->special) return 0; + /* + * only merge integrity protected bio into ditto rq + */ + if (bio_integrity(bio) != blk_integrity_rq(rq)) + return 0; + if (!elv_iosched_allow_merge(rq, bio)) return 0; -- cgit v1.2.3 From e180f5949327e897bc35a816f4f4010186632df9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 1 Jul 2008 09:42:47 +0200 Subject: block: request_module(): use format string Avoid bad things happening if the module has a printk control string in its name. Signed-off-by: maximilian attems Signed-off-by: Jens Axboe --- block/elevator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/elevator.c') diff --git a/block/elevator.c b/block/elevator.c index 1f5bfe69602..ed6f8f32d27 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -150,7 +150,7 @@ static struct elevator_type *elevator_get(const char *name) else sprintf(elv, "%s-iosched", name); - request_module(elv); + request_module("%s", elv); spin_lock(&elv_list_lock); e = elevator_find(name); } -- cgit v1.2.3