All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] block: export __make_request
@ 2011-09-11 14:50 Christoph Hellwig
  2011-09-11 14:51 ` [PATCH 2/2] block: remove support for bio remapping from ->make_request Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Christoph Hellwig @ 2011-09-11 14:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-raid, dm-devel, linux-kernel

Avoid the hacks need for request based device mappers currently by simply
exporting the symbol instead of trying to get it through the back door.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/block/blk-core.c
===================================================================
--- linux-2.6.orig/block/blk-core.c	2011-09-08 12:02:11.575274440 +0200
+++ linux-2.6/block/blk-core.c	2011-09-08 12:03:25.422774199 +0200
@@ -38,8 +38,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_r
 EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
 EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
 
-static int __make_request(struct request_queue *q, struct bio *bio);
-
 /*
  * For the allocated request tables
  */
@@ -1213,7 +1211,7 @@ void init_request_from_bio(struct reques
 	blk_rq_bio_prep(req->q, req, bio);
 }
 
-static int __make_request(struct request_queue *q, struct bio *bio)
+int __make_request(struct request_queue *q, struct bio *bio)
 {
 	const bool sync = !!(bio->bi_rw & REQ_SYNC);
 	struct blk_plug *plug;
@@ -1317,6 +1315,7 @@ out_unlock:
 out:
 	return 0;
 }
+EXPORT_SYMBOL_GPL(__make_request);	/* for device mapper only */
 
 /*
  * If bio->bi_dev is a partition, remap the location
Index: linux-2.6/drivers/md/dm.c
===================================================================
--- linux-2.6.orig/drivers/md/dm.c	2011-09-08 12:03:31.587273831 +0200
+++ linux-2.6/drivers/md/dm.c	2011-09-08 12:05:02.306774593 +0200
@@ -180,9 +180,6 @@ struct mapped_device {
 	/* forced geometry settings */
 	struct hd_geometry geometry;
 
-	/* For saving the address of __make_request for request based dm */
-	make_request_fn *saved_make_request_fn;
-
 	/* sysfs handle */
 	struct kobject kobj;
 
@@ -1420,13 +1417,6 @@ static int _dm_request(struct request_qu
 	return 0;
 }
 
-static int dm_make_request(struct request_queue *q, struct bio *bio)
-{
-	struct mapped_device *md = q->queuedata;
-
-	return md->saved_make_request_fn(q, bio); /* call __make_request() */
-}
-
 static int dm_request_based(struct mapped_device *md)
 {
 	return blk_queue_stackable(md->queue);
@@ -1437,7 +1427,7 @@ static int dm_request(struct request_que
 	struct mapped_device *md = q->queuedata;
 
 	if (dm_request_based(md))
-		return dm_make_request(q, bio);
+		return __make_request(q, bio);
 
 	return _dm_request(q, bio);
 }
@@ -2172,7 +2162,6 @@ static int dm_init_request_based_queue(s
 		return 0;
 
 	md->queue = q;
-	md->saved_make_request_fn = md->queue->make_request_fn;
 	dm_init_md_queue(md);
 	blk_queue_softirq_done(md->queue, dm_softirq_done);
 	blk_queue_prep_rq(md->queue, dm_prep_fn);
Index: linux-2.6/include/linux/blkdev.h
===================================================================
--- linux-2.6.orig/include/linux/blkdev.h	2011-09-08 12:02:11.595273510 +0200
+++ linux-2.6/include/linux/blkdev.h	2011-09-08 12:02:33.038774679 +0200
@@ -680,6 +680,8 @@ extern int scsi_cmd_ioctl(struct request
 extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
 			 struct scsi_ioctl_command __user *);
 
+extern int __make_request(struct request_queue *q, struct bio *bio);
+
 /*
  * A queue has just exitted congestion.  Note this in the global counter of
  * congested queues, and wake up anyone who was waiting for requests to be

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2011-09-15 11:56 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11 14:50 [PATCH 1/2] block: export __make_request Christoph Hellwig
2011-09-11 14:51 ` [PATCH 2/2] block: remove support for bio remapping from ->make_request Christoph Hellwig
2011-09-12  3:25   ` NeilBrown
2011-09-12  9:59   ` Jens Axboe
2011-09-12 12:25     ` Christoph Hellwig
2011-09-12 12:26       ` Jens Axboe
2011-09-12  9:59 ` [PATCH 1/2] block: export __make_request Jens Axboe
2011-09-12 12:25   ` Christoph Hellwig
2011-09-12 12:26     ` Jens Axboe
2011-09-12 13:38       ` Christoph Hellwig
2011-09-12 18:04         ` Jens Axboe
2011-09-13 21:19           ` Christoph Hellwig
2011-09-14 17:17             ` Boaz Harrosh
2011-09-14 17:17               ` Boaz Harrosh
2011-09-14 17:53               ` Doug Dumitru
2011-09-14 17:53                 ` Doug Dumitru
2011-09-14 18:40                 ` Alan Cox
2011-09-14 21:34                   ` Doug Dumitru
2011-09-14 22:01                     ` Alan Cox
2011-09-14 22:48                       ` Doug Dumitru
2011-09-15 10:20                     ` Bernd Petrovitsch
2011-09-14 20:16               ` Nicholas A. Bellinger
2011-09-12 13:42 ` [PATCH 3/2] block: refactor generic_make_request Christoph Hellwig
2011-09-12 15:09   ` Vivek Goyal
2011-09-12 15:13     ` Christoph Hellwig
2011-09-15 11:55       ` Christoph Hellwig
2011-09-15 11:56         ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.