[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1070731021645.25240@suse.de>
Date: Tue, 31 Jul 2007 12:16:45 +1000
From: NeilBrown <neilb@...e.de>
To: linux-kernel@...r.kernel.org
Subject: [PATCH 011 of 35] 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@...e.de>
### Diffstat output
./block/ll_rw_blk.c | 10 ++++++----
./drivers/md/dm-emc.c | 10 +---------
./include/linux/blkdev.h | 1 -
3 files changed, 7 insertions(+), 14 deletions(-)
diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
--- .prev/block/ll_rw_blk.c 2007-07-31 11:20:55.000000000 +1000
+++ ./block/ll_rw_blk.c 2007-07-31 11:20:56.000000000 +1000
@@ -43,6 +43,8 @@ static void init_request_from_bio(struct
static int __make_request(struct request_queue *q, struct bio *bio);
static struct io_context *current_io_context(gfp_t gfp_flags, int node);
static void blk_recalc_rq_segments(struct request *rq);
+static void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
+ struct bio *bio);
/*
* For the allocated request tables
@@ -3628,8 +3630,8 @@ void end_request(struct request *req, in
EXPORT_SYMBOL(end_request);
-void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
- struct bio *bio)
+static void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
+ struct bio *bio)
{
/* first two bits are identical in rq->cmd_flags and bio->bi_rw */
rq->cmd_flags |= (bio->bi_rw & 3);
@@ -3644,10 +3646,10 @@ void blk_rq_bio_prep(struct request_queu
rq->buffer = blk_rq_data(rq);
rq->current_nr_sectors = blk_rq_cur_sectors(rq);
rq->hard_cur_sectors = rq->current_nr_sectors;
+ if (bio->bi_bdev)
+ rq->rq_disk = bio->bi_bdev->bd_disk;
}
-EXPORT_SYMBOL(blk_rq_bio_prep);
-
void *blk_rq_data(struct request *rq)
{
struct bio_vec bvec;
diff .prev/drivers/md/dm-emc.c ./drivers/md/dm-emc.c
--- .prev/drivers/md/dm-emc.c 2007-07-31 11:20:51.000000000 +1000
+++ ./drivers/md/dm-emc.c 2007-07-31 11:20:56.000000000 +1000
@@ -106,15 +106,7 @@ static struct request *get_failover_req(
return NULL;
}
- rq->bio = rq->biotail = bio;
- blk_rq_bio_prep(q, rq, bio);
-
- rq->rq_disk = bdev->bd_contains->bd_disk;
-
- /* bio backed don't set data */
- rq->buffer = rq->data = NULL;
- /* rq data_len used for pc cmd's request_bufflen */
- rq->data_len = bio->bi_size;
+ blk_rq_append_bio(q, rq, bio);
rq->sense = h->sense;
memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE);
diff .prev/include/linux/blkdev.h ./include/linux/blkdev.h
--- .prev/include/linux/blkdev.h 2007-07-31 11:20:55.000000000 +1000
+++ ./include/linux/blkdev.h 2007-07-31 11:20:56.000000000 +1000
@@ -837,7 +837,6 @@ static inline struct request *blk_map_qu
return bqt->tag_index[tag];
}
-extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
extern int blkdev_issue_flush(struct block_device *, sector_t *);
#define MAX_PHYS_SEGMENTS 128
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists