Skip to content

Commit

Permalink
[BLOCK] Cleanup unused variable passing
Browse files Browse the repository at this point in the history
- ->init_queue() does not need the elevator passed in
- ->put_request() is a hot path and need not have the queue passed in
- cfq_update_io_seektime() does not need cfqd passed in

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Dec 1, 2006
1 parent 0e75f90 commit bb37b94
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ static void as_exit_queue(elevator_t *e)
/*
* initialize elevator private data (as_data).
*/
static void *as_init_queue(request_queue_t *q, elevator_t *e)
static void *as_init_queue(request_queue_t *q)
{
struct as_data *ad;

Expand Down
9 changes: 4 additions & 5 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,7 @@ cfq_update_io_thinktime(struct cfq_data *cfqd, struct cfq_io_context *cic)
}

static void
cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_io_context *cic,
struct request *rq)
cfq_update_io_seektime(struct cfq_io_context *cic, struct request *rq)
{
sector_t sdist;
u64 total;
Expand Down Expand Up @@ -1617,7 +1616,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
}

cfq_update_io_thinktime(cfqd, cic);
cfq_update_io_seektime(cfqd, cic, rq);
cfq_update_io_seektime(cic, rq);
cfq_update_idle_window(cfqd, cfqq, cic);

cic->last_queue = jiffies;
Expand Down Expand Up @@ -1770,7 +1769,7 @@ static int cfq_may_queue(request_queue_t *q, int rw)
/*
* queue lock held here
*/
static void cfq_put_request(request_queue_t *q, struct request *rq)
static void cfq_put_request(struct request *rq)
{
struct cfq_queue *cfqq = RQ_CFQQ(rq);

Expand Down Expand Up @@ -1951,7 +1950,7 @@ static void cfq_exit_queue(elevator_t *e)
kfree(cfqd);
}

static void *cfq_init_queue(request_queue_t *q, elevator_t *e)
static void *cfq_init_queue(request_queue_t *q)
{
struct cfq_data *cfqd;
int i;
Expand Down
2 changes: 1 addition & 1 deletion block/deadline-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void deadline_exit_queue(elevator_t *e)
/*
* initialize elevator private data (deadline_data).
*/
static void *deadline_init_queue(request_queue_t *q, elevator_t *e)
static void *deadline_init_queue(request_queue_t *q)
{
struct deadline_data *dd;

Expand Down
4 changes: 2 additions & 2 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static struct elevator_type *elevator_get(const char *name)

static void *elevator_init_queue(request_queue_t *q, struct elevator_queue *eq)
{
return eq->ops->elevator_init_fn(q, eq);
return eq->ops->elevator_init_fn(q);
}

static void elevator_attach(request_queue_t *q, struct elevator_queue *eq,
Expand Down Expand Up @@ -810,7 +810,7 @@ void elv_put_request(request_queue_t *q, struct request *rq)
elevator_t *e = q->elevator;

if (e->ops->elevator_put_req_fn)
e->ops->elevator_put_req_fn(q, rq);
e->ops->elevator_put_req_fn(rq);
}

int elv_may_queue(request_queue_t *q, int rw)
Expand Down
2 changes: 1 addition & 1 deletion block/noop-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ noop_latter_request(request_queue_t *q, struct request *rq)
return list_entry(rq->queuelist.next, struct request, queuelist);
}

static void *noop_init_queue(request_queue_t *q, elevator_t *e)
static void *noop_init_queue(request_queue_t *q)
{
struct noop_data *nd;

Expand Down
4 changes: 2 additions & 2 deletions include/linux/elevator.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
typedef int (elevator_may_queue_fn) (request_queue_t *, int);

typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
typedef void (elevator_put_req_fn) (struct request *);
typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);

typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *);
typedef void *(elevator_init_fn) (request_queue_t *);
typedef void (elevator_exit_fn) (elevator_t *);

struct elevator_ops
Expand Down

0 comments on commit bb37b94

Please sign in to comment.