Skip to content

Commit 166e1f9

Browse files
Christoph HellwigJens Axboe
authored andcommitted
block: export __make_request
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> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 484fc25 commit 166e1f9

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

block/blk-core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_remap);
3838
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
3939
EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
4040

41-
static int __make_request(struct request_queue *q, struct bio *bio);
42-
4341
/*
4442
* For the allocated request tables
4543
*/
@@ -1213,7 +1211,7 @@ void init_request_from_bio(struct request *req, struct bio *bio)
12131211
blk_rq_bio_prep(req->q, req, bio);
12141212
}
12151213

1216-
static int __make_request(struct request_queue *q, struct bio *bio)
1214+
int __make_request(struct request_queue *q, struct bio *bio)
12171215
{
12181216
const bool sync = !!(bio->bi_rw & REQ_SYNC);
12191217
struct blk_plug *plug;
@@ -1317,6 +1315,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
13171315
out:
13181316
return 0;
13191317
}
1318+
EXPORT_SYMBOL_GPL(__make_request); /* for device mapper only */
13201319

13211320
/*
13221321
* If bio->bi_dev is a partition, remap the location

drivers/md/dm.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ struct mapped_device {
180180
/* forced geometry settings */
181181
struct hd_geometry geometry;
182182

183-
/* For saving the address of __make_request for request based dm */
184-
make_request_fn *saved_make_request_fn;
185-
186183
/* sysfs handle */
187184
struct kobject kobj;
188185

@@ -1420,13 +1417,6 @@ static int _dm_request(struct request_queue *q, struct bio *bio)
14201417
return 0;
14211418
}
14221419

1423-
static int dm_make_request(struct request_queue *q, struct bio *bio)
1424-
{
1425-
struct mapped_device *md = q->queuedata;
1426-
1427-
return md->saved_make_request_fn(q, bio); /* call __make_request() */
1428-
}
1429-
14301420
static int dm_request_based(struct mapped_device *md)
14311421
{
14321422
return blk_queue_stackable(md->queue);
@@ -1437,7 +1427,7 @@ static int dm_request(struct request_queue *q, struct bio *bio)
14371427
struct mapped_device *md = q->queuedata;
14381428

14391429
if (dm_request_based(md))
1440-
return dm_make_request(q, bio);
1430+
return __make_request(q, bio);
14411431

14421432
return _dm_request(q, bio);
14431433
}
@@ -2172,7 +2162,6 @@ static int dm_init_request_based_queue(struct mapped_device *md)
21722162
return 0;
21732163

21742164
md->queue = q;
2175-
md->saved_make_request_fn = md->queue->make_request_fn;
21762165
dm_init_md_queue(md);
21772166
blk_queue_softirq_done(md->queue, dm_softirq_done);
21782167
blk_queue_prep_rq(md->queue, dm_prep_fn);

include/linux/blkdev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
675675
extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
676676
struct scsi_ioctl_command __user *);
677677

678+
extern int __make_request(struct request_queue *q, struct bio *bio);
679+
678680
/*
679681
* A queue has just exitted congestion. Note this in the global counter of
680682
* congested queues, and wake up anyone who was waiting for requests to be

0 commit comments

Comments
 (0)