aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-04-29 03:54:36 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-04-29 08:48:55 -0400
commit2a4aa30c5f967eb6ae874c67fa6fceeee84815f9 (patch)
treefddd67e3b3697874e2a19c0e8e194190957b0e1e
parent992b5bceee447a32ef2d617730ae0d03c063eedd (diff)
block: rename and export rq_init()
This rename rq_init() blk_rq_init() and export it. Any path that hands the request to the block layer needs to call it to initialize the request. This is a preparation for large command support, which needs to initialize the request in a proper way (that is, just doing a memset() will not work). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--block/blk-barrier.c4
-rw-r--r--block/blk-core.c5
-rw-r--r--block/blk.h1
-rw-r--r--include/linux/blkdev.h1
4 files changed, 6 insertions, 5 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c
index 47127ba09e45..66e55288178c 100644
--- a/block/blk-barrier.c
+++ b/block/blk-barrier.c
@@ -143,7 +143,7 @@ static void queue_flush(struct request_queue *q, unsigned which)
143 end_io = post_flush_end_io; 143 end_io = post_flush_end_io;
144 } 144 }
145 145
146 rq_init(q, rq); 146 blk_rq_init(q, rq);
147 rq->cmd_flags = REQ_HARDBARRIER; 147 rq->cmd_flags = REQ_HARDBARRIER;
148 rq->rq_disk = q->bar_rq.rq_disk; 148 rq->rq_disk = q->bar_rq.rq_disk;
149 rq->end_io = end_io; 149 rq->end_io = end_io;
@@ -165,7 +165,7 @@ static inline struct request *start_ordered(struct request_queue *q,
165 blkdev_dequeue_request(rq); 165 blkdev_dequeue_request(rq);
166 q->orig_bar_rq = rq; 166 q->orig_bar_rq = rq;
167 rq = &q->bar_rq; 167 rq = &q->bar_rq;
168 rq_init(q, rq); 168 blk_rq_init(q, rq);
169 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE) 169 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
170 rq->cmd_flags |= REQ_RW; 170 rq->cmd_flags |= REQ_RW;
171 if (q->ordered & QUEUE_ORDERED_FUA) 171 if (q->ordered & QUEUE_ORDERED_FUA)
diff --git a/block/blk-core.c b/block/blk-core.c
index d2f23ec5ebfa..fe0d1390b743 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -107,7 +107,7 @@ struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev)
107} 107}
108EXPORT_SYMBOL(blk_get_backing_dev_info); 108EXPORT_SYMBOL(blk_get_backing_dev_info);
109 109
110void rq_init(struct request_queue *q, struct request *rq) 110void blk_rq_init(struct request_queue *q, struct request *rq)
111{ 111{
112 memset(rq, 0, sizeof(*rq)); 112 memset(rq, 0, sizeof(*rq));
113 113
@@ -120,6 +120,7 @@ void rq_init(struct request_queue *q, struct request *rq)
120 rq->tag = -1; 120 rq->tag = -1;
121 rq->ref_count = 1; 121 rq->ref_count = 1;
122} 122}
123EXPORT_SYMBOL(blk_rq_init);
123 124
124static void req_bio_endio(struct request *rq, struct bio *bio, 125static void req_bio_endio(struct request *rq, struct bio *bio,
125 unsigned int nbytes, int error) 126 unsigned int nbytes, int error)
@@ -598,7 +599,7 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask)
598 if (!rq) 599 if (!rq)
599 return NULL; 600 return NULL;
600 601
601 rq_init(q, rq); 602 blk_rq_init(q, rq);
602 603
603 /* 604 /*
604 * first three bits are identical in rq->cmd_flags and bio->bi_rw, 605 * first three bits are identical in rq->cmd_flags and bio->bi_rw,
diff --git a/block/blk.h b/block/blk.h
index ec9120fb789a..59776ab4742a 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -10,7 +10,6 @@
10extern struct kmem_cache *blk_requestq_cachep; 10extern struct kmem_cache *blk_requestq_cachep;
11extern struct kobj_type blk_queue_ktype; 11extern struct kobj_type blk_queue_ktype;
12 12
13void rq_init(struct request_queue *q, struct request *rq);
14void init_request_from_bio(struct request *req, struct bio *bio); 13void init_request_from_bio(struct request *req, struct bio *bio);
15void blk_rq_bio_prep(struct request_queue *q, struct request *rq, 14void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
16 struct bio *bio); 15 struct bio *bio);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8ca481cd7d73..d17032c347c0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -607,6 +607,7 @@ extern int blk_register_queue(struct gendisk *disk);
607extern void blk_unregister_queue(struct gendisk *disk); 607extern void blk_unregister_queue(struct gendisk *disk);
608extern void register_disk(struct gendisk *dev); 608extern void register_disk(struct gendisk *dev);
609extern void generic_make_request(struct bio *bio); 609extern void generic_make_request(struct bio *bio);
610extern void blk_rq_init(struct request_queue *q, struct request *rq);
610extern void blk_put_request(struct request *); 611extern void blk_put_request(struct request *);
611extern void __blk_put_request(struct request_queue *, struct request *); 612extern void __blk_put_request(struct request_queue *, struct request *);
612extern void blk_end_sync_rq(struct request *rq, int error); 613extern void blk_end_sync_rq(struct request *rq, int error);