Skip to content

Commit 165125e

Browse files
author
Jens Axboe
committed
[BLOCK] Get rid of request_queue_t typedef
Some of the code has been gradually transitioned to using the proper struct request_queue, but there's lots left. So do a full sweet of the kernel and get rid of this typedef and replace its uses with the proper type. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent f695baf commit 165125e

85 files changed

Lines changed: 529 additions & 510 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/block/barrier.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ and how to prepare flush requests. Note that the term 'ordered' is
7979
used to indicate the whole sequence of performing barrier requests
8080
including draining and flushing.
8181

82-
typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq);
82+
typedef void (prepare_flush_fn)(struct request_queue *q, struct request *rq);
8383

84-
int blk_queue_ordered(request_queue_t *q, unsigned ordered,
84+
int blk_queue_ordered(struct request_queue *q, unsigned ordered,
8585
prepare_flush_fn *prepare_flush_fn);
8686

8787
@q : the queue in question
@@ -92,7 +92,7 @@ int blk_queue_ordered(request_queue_t *q, unsigned ordered,
9292
For example, SCSI disk driver's prepare_flush_fn looks like the
9393
following.
9494

95-
static void sd_prepare_flush(request_queue_t *q, struct request *rq)
95+
static void sd_prepare_flush(struct request_queue *q, struct request *rq)
9696
{
9797
memset(rq->cmd, 0, sizeof(rq->cmd));
9898
rq->cmd_type = REQ_TYPE_BLOCK_PC;

‎Documentation/block/biodoc.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,12 @@ Block now offers some simple generic functionality to help support command
740740
queueing (typically known as tagged command queueing), ie manage more than
741741
one outstanding command on a queue at any given time.
742742

743-
blk_queue_init_tags(request_queue_t *q, int depth)
743+
blk_queue_init_tags(struct request_queue *q, int depth)
744744

745745
Initialize internal command tagging structures for a maximum
746746
depth of 'depth'.
747747

748-
blk_queue_free_tags((request_queue_t *q)
748+
blk_queue_free_tags((struct request_queue *q)
749749

750750
Teardown tag info associated with the queue. This will be done
751751
automatically by block if blk_queue_cleanup() is called on a queue
@@ -754,15 +754,15 @@ one outstanding command on a queue at any given time.
754754
The above are initialization and exit management, the main helpers during
755755
normal operations are:
756756

757-
blk_queue_start_tag(request_queue_t *q, struct request *rq)
757+
blk_queue_start_tag(struct request_queue *q, struct request *rq)
758758

759759
Start tagged operation for this request. A free tag number between
760760
0 and 'depth' is assigned to the request (rq->tag holds this number),
761761
and 'rq' is added to the internal tag management. If the maximum depth
762762
for this queue is already achieved (or if the tag wasn't started for
763763
some other reason), 1 is returned. Otherwise 0 is returned.
764764

765-
blk_queue_end_tag(request_queue_t *q, struct request *rq)
765+
blk_queue_end_tag(struct request_queue *q, struct request *rq)
766766

767767
End tagged operation on this request. 'rq' is removed from the internal
768768
book keeping structures.
@@ -781,7 +781,7 @@ queue. For instance, on IDE any tagged request error needs to clear both
781781
the hardware and software block queue and enable the driver to sanely restart
782782
all the outstanding requests. There's a third helper to do that:
783783

784-
blk_queue_invalidate_tags(request_queue_t *q)
784+
blk_queue_invalidate_tags(struct request_queue *q)
785785

786786
Clear the internal block tag queue and re-add all the pending requests
787787
to the request queue. The driver will receive them again on the

‎Documentation/block/request.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ struct bio *bio DBI First bio in request
8383

8484
struct bio *biotail DBI Last bio in request
8585

86-
request_queue_t *q DB Request queue this request belongs to
86+
struct request_queue *q DB Request queue this request belongs to
8787

8888
struct request_list *rl B Request list this request came from

‎Documentation/iostats.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Field 8 -- # of milliseconds spent writing
7979
measured from __make_request() to end_that_request_last()).
8080
Field 9 -- # of I/Os currently in progress
8181
The only field that should go to zero. Incremented as requests are
82-
given to appropriate request_queue_t and decremented as they finish.
82+
given to appropriate struct request_queue and decremented as they finish.
8383
Field 10 -- # of milliseconds spent doing I/Os
8484
This field is increases so long as field 9 is nonzero.
8585
Field 11 -- weighted # of milliseconds spent doing I/Os

‎arch/arm/plat-omap/mailbox.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ static void mbox_rx_work(struct work_struct *work)
161161
/*
162162
* Mailbox interrupt handler
163163
*/
164-
static void mbox_txq_fn(request_queue_t * q)
164+
static void mbox_txq_fn(struct request_queue * q)
165165
{
166166
}
167167

168-
static void mbox_rxq_fn(request_queue_t * q)
168+
static void mbox_rxq_fn(struct request_queue * q)
169169
{
170170
}
171171

@@ -180,7 +180,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
180180
{
181181
struct request *rq;
182182
mbox_msg_t msg;
183-
request_queue_t *q = mbox->rxq->queue;
183+
struct request_queue *q = mbox->rxq->queue;
184184

185185
disable_mbox_irq(mbox, IRQ_RX);
186186

@@ -297,7 +297,7 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
297297
request_fn_proc * proc,
298298
void (*work) (struct work_struct *))
299299
{
300-
request_queue_t *q;
300+
struct request_queue *q;
301301
struct omap_mbox_queue *mq;
302302

303303
mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL);

‎arch/um/drivers/ubd_kern.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ __uml_help(fakehd,
469469
" Change the ubd device name to \"hd\".\n\n"
470470
);
471471

472-
static void do_ubd_request(request_queue_t * q);
472+
static void do_ubd_request(struct request_queue * q);
473473

474474
/* Only changed by ubd_init, which is an initcall. */
475475
int thread_fd = -1;
@@ -1081,7 +1081,7 @@ static void prepare_request(struct request *req, struct io_thread_req *io_req,
10811081
}
10821082

10831083
/* Called with dev->lock held */
1084-
static void do_ubd_request(request_queue_t *q)
1084+
static void do_ubd_request(struct request_queue *q)
10851085
{
10861086
struct io_thread_req *io_req;
10871087
struct request *req;

‎block/as-iosched.c‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ static void update_write_batch(struct as_data *ad)
796796
* as_completed_request is to be called when a request has completed and
797797
* returned something to the requesting process, be it an error or data.
798798
*/
799-
static void as_completed_request(request_queue_t *q, struct request *rq)
799+
static void as_completed_request(struct request_queue *q, struct request *rq)
800800
{
801801
struct as_data *ad = q->elevator->elevator_data;
802802

@@ -853,7 +853,8 @@ static void as_completed_request(request_queue_t *q, struct request *rq)
853853
* reference unless it replaces the request at somepart of the elevator
854854
* (ie. the dispatch queue)
855855
*/
856-
static void as_remove_queued_request(request_queue_t *q, struct request *rq)
856+
static void as_remove_queued_request(struct request_queue *q,
857+
struct request *rq)
857858
{
858859
const int data_dir = rq_is_sync(rq);
859860
struct as_data *ad = q->elevator->elevator_data;
@@ -978,7 +979,7 @@ static void as_move_to_dispatch(struct as_data *ad, struct request *rq)
978979
* read/write expire, batch expire, etc, and moves it to the dispatch
979980
* queue. Returns 1 if a request was found, 0 otherwise.
980981
*/
981-
static int as_dispatch_request(request_queue_t *q, int force)
982+
static int as_dispatch_request(struct request_queue *q, int force)
982983
{
983984
struct as_data *ad = q->elevator->elevator_data;
984985
const int reads = !list_empty(&ad->fifo_list[REQ_SYNC]);
@@ -1139,7 +1140,7 @@ static int as_dispatch_request(request_queue_t *q, int force)
11391140
/*
11401141
* add rq to rbtree and fifo
11411142
*/
1142-
static void as_add_request(request_queue_t *q, struct request *rq)
1143+
static void as_add_request(struct request_queue *q, struct request *rq)
11431144
{
11441145
struct as_data *ad = q->elevator->elevator_data;
11451146
int data_dir;
@@ -1167,15 +1168,15 @@ static void as_add_request(request_queue_t *q, struct request *rq)
11671168
RQ_SET_STATE(rq, AS_RQ_QUEUED);
11681169
}
11691170

1170-
static void as_activate_request(request_queue_t *q, struct request *rq)
1171+
static void as_activate_request(struct request_queue *q, struct request *rq)
11711172
{
11721173
WARN_ON(RQ_STATE(rq) != AS_RQ_DISPATCHED);
11731174
RQ_SET_STATE(rq, AS_RQ_REMOVED);
11741175
if (RQ_IOC(rq) && RQ_IOC(rq)->aic)
11751176
atomic_dec(&RQ_IOC(rq)->aic->nr_dispatched);
11761177
}
11771178

1178-
static void as_deactivate_request(request_queue_t *q, struct request *rq)
1179+
static void as_deactivate_request(struct request_queue *q, struct request *rq)
11791180
{
11801181
WARN_ON(RQ_STATE(rq) != AS_RQ_REMOVED);
11811182
RQ_SET_STATE(rq, AS_RQ_DISPATCHED);
@@ -1189,7 +1190,7 @@ static void as_deactivate_request(request_queue_t *q, struct request *rq)
11891190
* is not empty - it is used in the block layer to check for plugging and
11901191
* merging opportunities
11911192
*/
1192-
static int as_queue_empty(request_queue_t *q)
1193+
static int as_queue_empty(struct request_queue *q)
11931194
{
11941195
struct as_data *ad = q->elevator->elevator_data;
11951196

@@ -1198,7 +1199,7 @@ static int as_queue_empty(request_queue_t *q)
11981199
}
11991200

12001201
static int
1201-
as_merge(request_queue_t *q, struct request **req, struct bio *bio)
1202+
as_merge(struct request_queue *q, struct request **req, struct bio *bio)
12021203
{
12031204
struct as_data *ad = q->elevator->elevator_data;
12041205
sector_t rb_key = bio->bi_sector + bio_sectors(bio);
@@ -1216,7 +1217,8 @@ as_merge(request_queue_t *q, struct request **req, struct bio *bio)
12161217
return ELEVATOR_NO_MERGE;
12171218
}
12181219

1219-
static void as_merged_request(request_queue_t *q, struct request *req, int type)
1220+
static void as_merged_request(struct request_queue *q, struct request *req,
1221+
int type)
12201222
{
12211223
struct as_data *ad = q->elevator->elevator_data;
12221224

@@ -1234,7 +1236,7 @@ static void as_merged_request(request_queue_t *q, struct request *req, int type)
12341236
}
12351237
}
12361238

1237-
static void as_merged_requests(request_queue_t *q, struct request *req,
1239+
static void as_merged_requests(struct request_queue *q, struct request *req,
12381240
struct request *next)
12391241
{
12401242
/*
@@ -1285,7 +1287,7 @@ static void as_work_handler(struct work_struct *work)
12851287
spin_unlock_irqrestore(q->queue_lock, flags);
12861288
}
12871289

1288-
static int as_may_queue(request_queue_t *q, int rw)
1290+
static int as_may_queue(struct request_queue *q, int rw)
12891291
{
12901292
int ret = ELV_MQUEUE_MAY;
12911293
struct as_data *ad = q->elevator->elevator_data;
@@ -1318,7 +1320,7 @@ static void as_exit_queue(elevator_t *e)
13181320
/*
13191321
* initialize elevator private data (as_data).
13201322
*/
1321-
static void *as_init_queue(request_queue_t *q)
1323+
static void *as_init_queue(struct request_queue *q)
13221324
{
13231325
struct as_data *ad;
13241326

‎block/blktrace.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void blk_trace_cleanup(struct blk_trace *bt)
231231
kfree(bt);
232232
}
233233

234-
static int blk_trace_remove(request_queue_t *q)
234+
static int blk_trace_remove(struct request_queue *q)
235235
{
236236
struct blk_trace *bt;
237237

@@ -312,7 +312,7 @@ static struct rchan_callbacks blk_relay_callbacks = {
312312
/*
313313
* Setup everything required to start tracing
314314
*/
315-
static int blk_trace_setup(request_queue_t *q, struct block_device *bdev,
315+
static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
316316
char __user *arg)
317317
{
318318
struct blk_user_trace_setup buts;
@@ -401,7 +401,7 @@ static int blk_trace_setup(request_queue_t *q, struct block_device *bdev,
401401
return ret;
402402
}
403403

404-
static int blk_trace_startstop(request_queue_t *q, int start)
404+
static int blk_trace_startstop(struct request_queue *q, int start)
405405
{
406406
struct blk_trace *bt;
407407
int ret;
@@ -444,7 +444,7 @@ static int blk_trace_startstop(request_queue_t *q, int start)
444444
**/
445445
int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
446446
{
447-
request_queue_t *q;
447+
struct request_queue *q;
448448
int ret, start = 0;
449449

450450
q = bdev_get_queue(bdev);
@@ -479,7 +479,7 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
479479
* @q: the request queue associated with the device
480480
*
481481
**/
482-
void blk_trace_shutdown(request_queue_t *q)
482+
void blk_trace_shutdown(struct request_queue *q)
483483
{
484484
if (q->blk_trace) {
485485
blk_trace_startstop(q, 0);

‎block/bsg.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define BSG_VERSION "0.4"
3838

3939
struct bsg_device {
40-
request_queue_t *queue;
40+
struct request_queue *queue;
4141
spinlock_t lock;
4242
struct list_head busy_list;
4343
struct list_head done_list;
@@ -180,7 +180,7 @@ static int bsg_io_schedule(struct bsg_device *bd)
180180
return ret;
181181
}
182182

183-
static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
183+
static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
184184
struct sg_io_v4 *hdr, int has_write_perm)
185185
{
186186
memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
@@ -214,7 +214,7 @@ static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
214214
* Check if sg_io_v4 from user is allowed and valid
215215
*/
216216
static int
217-
bsg_validate_sgv4_hdr(request_queue_t *q, struct sg_io_v4 *hdr, int *rw)
217+
bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
218218
{
219219
int ret = 0;
220220

@@ -250,7 +250,7 @@ bsg_validate_sgv4_hdr(request_queue_t *q, struct sg_io_v4 *hdr, int *rw)
250250
static struct request *
251251
bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
252252
{
253-
request_queue_t *q = bd->queue;
253+
struct request_queue *q = bd->queue;
254254
struct request *rq, *next_rq = NULL;
255255
int ret, rw;
256256
unsigned int dxfer_len;
@@ -345,7 +345,7 @@ static void bsg_rq_end_io(struct request *rq, int uptodate)
345345
* do final setup of a 'bc' and submit the matching 'rq' to the block
346346
* layer for io
347347
*/
348-
static void bsg_add_command(struct bsg_device *bd, request_queue_t *q,
348+
static void bsg_add_command(struct bsg_device *bd, struct request_queue *q,
349349
struct bsg_command *bc, struct request *rq)
350350
{
351351
rq->sense = bc->sense;
@@ -611,7 +611,7 @@ static int __bsg_write(struct bsg_device *bd, const char __user *buf,
611611
bc = NULL;
612612
ret = 0;
613613
while (nr_commands) {
614-
request_queue_t *q = bd->queue;
614+
struct request_queue *q = bd->queue;
615615

616616
bc = bsg_alloc_command(bd);
617617
if (IS_ERR(bc)) {

0 commit comments

Comments
 (0)