diff options
author | NeilBrown <neilb@suse.de> | 2007-08-16 07:31:28 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:56 -0400 |
commit | 66846572bfb4ec62bcba260028cbbcbdb77bd636 (patch) | |
tree | 23a29655a22835a49bd1549524fc3b950a5bf261 | |
parent | 3001ca77128273cc5634d79f5306ce2e5a14ec41 (diff) |
Stop exporting blk_rq_bio_prep
blk_rq_bio_prep is exported for use in exactly
one place. That place can benefit from using
the new blk_rq_append_bio instead.
So
- change dm-emc to call blk_rq_append_bio
- stop exporting blk_rq_bio_prep, and
- initialise rq_disk in blk_rq_bio_prep,
as dm-emc needs it.
Signed-off-by: Neil Brown <neilb@suse.de>
diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/ll_rw_blk.c | 11 | ||||
-rw-r--r-- | drivers/md/dm-emc.c | 10 | ||||
-rw-r--r-- | include/linux/blkdev.h | 1 |
3 files changed, 8 insertions, 14 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 2de9bad1d042..eb27b335d238 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -43,6 +43,8 @@ static void init_request_from_bio(struct request *req, struct bio *bio); | |||
43 | static int __make_request(struct request_queue *q, struct bio *bio); | 43 | static int __make_request(struct request_queue *q, struct bio *bio); |
44 | static struct io_context *current_io_context(gfp_t gfp_flags, int node); | 44 | static struct io_context *current_io_context(gfp_t gfp_flags, int node); |
45 | static void blk_recalc_rq_segments(struct request *rq); | 45 | static void blk_recalc_rq_segments(struct request *rq); |
46 | static void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | ||
47 | struct bio *bio); | ||
46 | 48 | ||
47 | /* | 49 | /* |
48 | * For the allocated request tables | 50 | * For the allocated request tables |
@@ -3665,8 +3667,8 @@ void end_request(struct request *req, int uptodate) | |||
3665 | 3667 | ||
3666 | EXPORT_SYMBOL(end_request); | 3668 | EXPORT_SYMBOL(end_request); |
3667 | 3669 | ||
3668 | void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | 3670 | static void blk_rq_bio_prep(struct request_queue *q, struct request *rq, |
3669 | struct bio *bio) | 3671 | struct bio *bio) |
3670 | { | 3672 | { |
3671 | /* first two bits are identical in rq->cmd_flags and bio->bi_rw */ | 3673 | /* first two bits are identical in rq->cmd_flags and bio->bi_rw */ |
3672 | rq->cmd_flags |= (bio->bi_rw & 3); | 3674 | rq->cmd_flags |= (bio->bi_rw & 3); |
@@ -3680,9 +3682,10 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | |||
3680 | rq->data_len = bio->bi_size; | 3682 | rq->data_len = bio->bi_size; |
3681 | 3683 | ||
3682 | rq->bio = rq->biotail = bio; | 3684 | rq->bio = rq->biotail = bio; |
3683 | } | ||
3684 | 3685 | ||
3685 | EXPORT_SYMBOL(blk_rq_bio_prep); | 3686 | if (bio->bi_bdev) |
3687 | rq->rq_disk = bio->bi_bdev->bd_disk; | ||
3688 | } | ||
3686 | 3689 | ||
3687 | int kblockd_schedule_work(struct work_struct *work) | 3690 | int kblockd_schedule_work(struct work_struct *work) |
3688 | { | 3691 | { |
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c index 265c467854da..71cc858b7860 100644 --- a/drivers/md/dm-emc.c +++ b/drivers/md/dm-emc.c | |||
@@ -109,15 +109,7 @@ static struct request *get_failover_req(struct emc_handler *h, | |||
109 | return NULL; | 109 | return NULL; |
110 | } | 110 | } |
111 | 111 | ||
112 | rq->bio = rq->biotail = bio; | 112 | blk_rq_append_bio(q, rq, bio); |
113 | blk_rq_bio_prep(q, rq, bio); | ||
114 | |||
115 | rq->rq_disk = bdev->bd_contains->bd_disk; | ||
116 | |||
117 | /* bio backed don't set data */ | ||
118 | rq->buffer = rq->data = NULL; | ||
119 | /* rq data_len used for pc cmd's request_bufflen */ | ||
120 | rq->data_len = bio->bi_size; | ||
121 | 113 | ||
122 | rq->sense = h->sense; | 114 | rq->sense = h->sense; |
123 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); | 115 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3021a5b1d392..492ac946391e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -823,7 +823,6 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
823 | return bqt->tag_index[tag]; | 823 | return bqt->tag_index[tag]; |
824 | } | 824 | } |
825 | 825 | ||
826 | extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *); | ||
827 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 826 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
828 | 827 | ||
829 | #define MAX_PHYS_SEGMENTS 128 | 828 | #define MAX_PHYS_SEGMENTS 128 |