Skip to content

Commit

Permalink
[BLOCK] Get rid of request_queue_t typedef
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jens Axboe committed Jul 24, 2007
1 parent f695baf commit 165125e
Show file tree
Hide file tree
Showing 85 changed files with 529 additions and 510 deletions.
6 changes: 3 additions & 3 deletions Documentation/block/barrier.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ and how to prepare flush requests. Note that the term 'ordered' is
used to indicate the whole sequence of performing barrier requests
including draining and flushing.

typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq);
typedef void (prepare_flush_fn)(struct request_queue *q, struct request *rq);

int blk_queue_ordered(request_queue_t *q, unsigned ordered,
int blk_queue_ordered(struct request_queue *q, unsigned ordered,
prepare_flush_fn *prepare_flush_fn);

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

static void sd_prepare_flush(request_queue_t *q, struct request *rq)
static void sd_prepare_flush(struct request_queue *q, struct request *rq)
{
memset(rq->cmd, 0, sizeof(rq->cmd));
rq->cmd_type = REQ_TYPE_BLOCK_PC;
Expand Down
10 changes: 5 additions & 5 deletions Documentation/block/biodoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,12 @@ Block now offers some simple generic functionality to help support command
queueing (typically known as tagged command queueing), ie manage more than
one outstanding command on a queue at any given time.

blk_queue_init_tags(request_queue_t *q, int depth)
blk_queue_init_tags(struct request_queue *q, int depth)

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

blk_queue_free_tags((request_queue_t *q)
blk_queue_free_tags((struct request_queue *q)

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

blk_queue_start_tag(request_queue_t *q, struct request *rq)
blk_queue_start_tag(struct request_queue *q, struct request *rq)

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

blk_queue_end_tag(request_queue_t *q, struct request *rq)
blk_queue_end_tag(struct request_queue *q, struct request *rq)

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

blk_queue_invalidate_tags(request_queue_t *q)
blk_queue_invalidate_tags(struct request_queue *q)

Clear the internal block tag queue and re-add all the pending requests
to the request queue. The driver will receive them again on the
Expand Down
2 changes: 1 addition & 1 deletion Documentation/block/request.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ struct bio *bio DBI First bio in request

struct bio *biotail DBI Last bio in request

request_queue_t *q DB Request queue this request belongs to
struct request_queue *q DB Request queue this request belongs to

struct request_list *rl B Request list this request came from
2 changes: 1 addition & 1 deletion Documentation/iostats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Field 8 -- # of milliseconds spent writing
measured from __make_request() to end_that_request_last()).
Field 9 -- # of I/Os currently in progress
The only field that should go to zero. Incremented as requests are
given to appropriate request_queue_t and decremented as they finish.
given to appropriate struct request_queue and decremented as they finish.
Field 10 -- # of milliseconds spent doing I/Os
This field is increases so long as field 9 is nonzero.
Field 11 -- weighted # of milliseconds spent doing I/Os
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/plat-omap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ static void mbox_rx_work(struct work_struct *work)
/*
* Mailbox interrupt handler
*/
static void mbox_txq_fn(request_queue_t * q)
static void mbox_txq_fn(struct request_queue * q)
{
}

static void mbox_rxq_fn(request_queue_t * q)
static void mbox_rxq_fn(struct request_queue * q)
{
}

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

disable_mbox_irq(mbox, IRQ_RX);

Expand Down Expand Up @@ -297,7 +297,7 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
request_fn_proc * proc,
void (*work) (struct work_struct *))
{
request_queue_t *q;
struct request_queue *q;
struct omap_mbox_queue *mq;

mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL);
Expand Down
4 changes: 2 additions & 2 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ __uml_help(fakehd,
" Change the ubd device name to \"hd\".\n\n"
);

static void do_ubd_request(request_queue_t * q);
static void do_ubd_request(struct request_queue * q);

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

/* Called with dev->lock held */
static void do_ubd_request(request_queue_t *q)
static void do_ubd_request(struct request_queue *q)
{
struct io_thread_req *io_req;
struct request *req;
Expand Down
26 changes: 14 additions & 12 deletions block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static void update_write_batch(struct as_data *ad)
* as_completed_request is to be called when a request has completed and
* returned something to the requesting process, be it an error or data.
*/
static void as_completed_request(request_queue_t *q, struct request *rq)
static void as_completed_request(struct request_queue *q, struct request *rq)
{
struct as_data *ad = q->elevator->elevator_data;

Expand Down Expand Up @@ -853,7 +853,8 @@ static void as_completed_request(request_queue_t *q, struct request *rq)
* reference unless it replaces the request at somepart of the elevator
* (ie. the dispatch queue)
*/
static void as_remove_queued_request(request_queue_t *q, struct request *rq)
static void as_remove_queued_request(struct request_queue *q,
struct request *rq)
{
const int data_dir = rq_is_sync(rq);
struct as_data *ad = q->elevator->elevator_data;
Expand Down Expand Up @@ -978,7 +979,7 @@ static void as_move_to_dispatch(struct as_data *ad, struct request *rq)
* read/write expire, batch expire, etc, and moves it to the dispatch
* queue. Returns 1 if a request was found, 0 otherwise.
*/
static int as_dispatch_request(request_queue_t *q, int force)
static int as_dispatch_request(struct request_queue *q, int force)
{
struct as_data *ad = q->elevator->elevator_data;
const int reads = !list_empty(&ad->fifo_list[REQ_SYNC]);
Expand Down Expand Up @@ -1139,7 +1140,7 @@ static int as_dispatch_request(request_queue_t *q, int force)
/*
* add rq to rbtree and fifo
*/
static void as_add_request(request_queue_t *q, struct request *rq)
static void as_add_request(struct request_queue *q, struct request *rq)
{
struct as_data *ad = q->elevator->elevator_data;
int data_dir;
Expand Down Expand Up @@ -1167,15 +1168,15 @@ static void as_add_request(request_queue_t *q, struct request *rq)
RQ_SET_STATE(rq, AS_RQ_QUEUED);
}

static void as_activate_request(request_queue_t *q, struct request *rq)
static void as_activate_request(struct request_queue *q, struct request *rq)
{
WARN_ON(RQ_STATE(rq) != AS_RQ_DISPATCHED);
RQ_SET_STATE(rq, AS_RQ_REMOVED);
if (RQ_IOC(rq) && RQ_IOC(rq)->aic)
atomic_dec(&RQ_IOC(rq)->aic->nr_dispatched);
}

static void as_deactivate_request(request_queue_t *q, struct request *rq)
static void as_deactivate_request(struct request_queue *q, struct request *rq)
{
WARN_ON(RQ_STATE(rq) != AS_RQ_REMOVED);
RQ_SET_STATE(rq, AS_RQ_DISPATCHED);
Expand All @@ -1189,7 +1190,7 @@ static void as_deactivate_request(request_queue_t *q, struct request *rq)
* is not empty - it is used in the block layer to check for plugging and
* merging opportunities
*/
static int as_queue_empty(request_queue_t *q)
static int as_queue_empty(struct request_queue *q)
{
struct as_data *ad = q->elevator->elevator_data;

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

static int
as_merge(request_queue_t *q, struct request **req, struct bio *bio)
as_merge(struct request_queue *q, struct request **req, struct bio *bio)
{
struct as_data *ad = q->elevator->elevator_data;
sector_t rb_key = bio->bi_sector + bio_sectors(bio);
Expand All @@ -1216,7 +1217,8 @@ as_merge(request_queue_t *q, struct request **req, struct bio *bio)
return ELEVATOR_NO_MERGE;
}

static void as_merged_request(request_queue_t *q, struct request *req, int type)
static void as_merged_request(struct request_queue *q, struct request *req,
int type)
{
struct as_data *ad = q->elevator->elevator_data;

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

static void as_merged_requests(request_queue_t *q, struct request *req,
static void as_merged_requests(struct request_queue *q, struct request *req,
struct request *next)
{
/*
Expand Down Expand Up @@ -1285,7 +1287,7 @@ static void as_work_handler(struct work_struct *work)
spin_unlock_irqrestore(q->queue_lock, flags);
}

static int as_may_queue(request_queue_t *q, int rw)
static int as_may_queue(struct request_queue *q, int rw)
{
int ret = ELV_MQUEUE_MAY;
struct as_data *ad = q->elevator->elevator_data;
Expand Down Expand Up @@ -1318,7 +1320,7 @@ static void as_exit_queue(elevator_t *e)
/*
* initialize elevator private data (as_data).
*/
static void *as_init_queue(request_queue_t *q)
static void *as_init_queue(struct request_queue *q)
{
struct as_data *ad;

Expand Down
10 changes: 5 additions & 5 deletions block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static void blk_trace_cleanup(struct blk_trace *bt)
kfree(bt);
}

static int blk_trace_remove(request_queue_t *q)
static int blk_trace_remove(struct request_queue *q)
{
struct blk_trace *bt;

Expand Down Expand Up @@ -312,7 +312,7 @@ static struct rchan_callbacks blk_relay_callbacks = {
/*
* Setup everything required to start tracing
*/
static int blk_trace_setup(request_queue_t *q, struct block_device *bdev,
static int blk_trace_setup(struct request_queue *q, struct block_device *bdev,
char __user *arg)
{
struct blk_user_trace_setup buts;
Expand Down Expand Up @@ -401,7 +401,7 @@ static int blk_trace_setup(request_queue_t *q, struct block_device *bdev,
return ret;
}

static int blk_trace_startstop(request_queue_t *q, int start)
static int blk_trace_startstop(struct request_queue *q, int start)
{
struct blk_trace *bt;
int ret;
Expand Down Expand Up @@ -444,7 +444,7 @@ static int blk_trace_startstop(request_queue_t *q, int start)
**/
int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
{
request_queue_t *q;
struct request_queue *q;
int ret, start = 0;

q = bdev_get_queue(bdev);
Expand Down Expand Up @@ -479,7 +479,7 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
* @q: the request queue associated with the device
*
**/
void blk_trace_shutdown(request_queue_t *q)
void blk_trace_shutdown(struct request_queue *q)
{
if (q->blk_trace) {
blk_trace_startstop(q, 0);
Expand Down
12 changes: 6 additions & 6 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define BSG_VERSION "0.4"

struct bsg_device {
request_queue_t *queue;
struct request_queue *queue;
spinlock_t lock;
struct list_head busy_list;
struct list_head done_list;
Expand Down Expand Up @@ -180,7 +180,7 @@ static int bsg_io_schedule(struct bsg_device *bd)
return ret;
}

static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
struct sg_io_v4 *hdr, int has_write_perm)
{
memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
Expand Down Expand Up @@ -214,7 +214,7 @@ static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
* Check if sg_io_v4 from user is allowed and valid
*/
static int
bsg_validate_sgv4_hdr(request_queue_t *q, struct sg_io_v4 *hdr, int *rw)
bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
{
int ret = 0;

Expand Down Expand Up @@ -250,7 +250,7 @@ bsg_validate_sgv4_hdr(request_queue_t *q, struct sg_io_v4 *hdr, int *rw)
static struct request *
bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
{
request_queue_t *q = bd->queue;
struct request_queue *q = bd->queue;
struct request *rq, *next_rq = NULL;
int ret, rw;
unsigned int dxfer_len;
Expand Down Expand Up @@ -345,7 +345,7 @@ static void bsg_rq_end_io(struct request *rq, int uptodate)
* do final setup of a 'bc' and submit the matching 'rq' to the block
* layer for io
*/
static void bsg_add_command(struct bsg_device *bd, request_queue_t *q,
static void bsg_add_command(struct bsg_device *bd, struct request_queue *q,
struct bsg_command *bc, struct request *rq)
{
rq->sense = bc->sense;
Expand Down Expand Up @@ -611,7 +611,7 @@ static int __bsg_write(struct bsg_device *bd, const char __user *buf,
bc = NULL;
ret = 0;
while (nr_commands) {
request_queue_t *q = bd->queue;
struct request_queue *q = bd->queue;

bc = bsg_alloc_command(bd);
if (IS_ERR(bc)) {
Expand Down
Loading

0 comments on commit 165125e

Please sign in to comment.