Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75054
b: refs/heads/master
c: 051a1d1
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Adamushko authored and Ingo Molnar committed Dec 18, 2007
1 parent f822da5 commit 979f79a
Show file tree
Hide file tree
Showing 19 changed files with 210 additions and 180 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c615e19a4c518e349cc81a7f43223c7ec5f9e9a
refs/heads/master: 051a1d1afa47206e23ae03f781c6795ce870e3d5
11 changes: 4 additions & 7 deletions trunk/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ static void as_remove_queued_request(struct request_queue *q,
}

/*
* as_fifo_expired returns 0 if there are no expired requests on the fifo,
* as_fifo_expired returns 0 if there are no expired reads on the fifo,
* 1 otherwise. It is ratelimited so that we only perform the check once per
* `fifo_expire' interval. Otherwise a large number of expired requests
* would create a hopeless seekstorm.
Expand Down Expand Up @@ -1097,8 +1097,7 @@ static int as_dispatch_request(struct request_queue *q, int force)
ad->batch_data_dir = REQ_ASYNC;
ad->current_write_count = ad->write_batch_count;
ad->write_batch_idled = 0;
rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
ad->last_check_fifo[REQ_ASYNC] = jiffies;
rq = ad->next_rq[ad->batch_data_dir];
goto dispatch_request;
}

Expand Down Expand Up @@ -1160,7 +1159,7 @@ static void as_add_request(struct request_queue *q, struct request *rq)
as_add_rq_rb(ad, rq);

/*
* set expire time and add to fifo list
* set expire time (only used for reads) and add to fifo list
*/
rq_set_fifo_time(rq, jiffies + ad->fifo_expire[data_dir]);
list_add_tail(&rq->queuelist, &ad->fifo_list[data_dir]);
Expand Down Expand Up @@ -1464,9 +1463,7 @@ static struct elevator_type iosched_as = {

static int __init as_init(void)
{
elv_register(&iosched_as);

return 0;
return elv_register(&iosched_as);
}

static void __exit as_exit(void)
Expand Down
8 changes: 6 additions & 2 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,8 @@ static struct elevator_type iosched_cfq = {

static int __init cfq_init(void)
{
int ret;

/*
* could be 0 on HZ < 1000 setups
*/
Expand All @@ -2290,9 +2292,11 @@ static int __init cfq_init(void)
if (cfq_slab_setup())
return -ENOMEM;

elv_register(&iosched_cfq);
ret = elv_register(&iosched_cfq);
if (ret)
cfq_slab_kill();

return 0;
return ret;
}

static void __exit cfq_exit(void)
Expand Down
4 changes: 1 addition & 3 deletions trunk/block/deadline-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ static struct elevator_type iosched_deadline = {

static int __init deadline_init(void)
{
elv_register(&iosched_deadline);

return 0;
return elv_register(&iosched_deadline);
}

static void __exit deadline_exit(void)
Expand Down
3 changes: 2 additions & 1 deletion trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q)
__elv_unregister_queue(q->elevator);
}

void elv_register(struct elevator_type *e)
int elv_register(struct elevator_type *e)
{
char *def = "";

Expand All @@ -975,6 +975,7 @@ void elv_register(struct elevator_type *e)
def = " (default)";

printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
return 0;
}
EXPORT_SYMBOL_GPL(elv_register);

Expand Down
4 changes: 1 addition & 3 deletions trunk/block/noop-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ static struct elevator_type elevator_noop = {

static int __init noop_init(void)
{
elv_register(&elevator_noop);

return 0;
return elv_register(&elevator_noop);
}

static void __exit noop_exit(void)
Expand Down
4 changes: 2 additions & 2 deletions trunk/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
rq->cmd_len = hdr->cmd_len;
rq->cmd_type = REQ_TYPE_BLOCK_PC;

rq->timeout = msecs_to_jiffies(hdr->timeout);
rq->timeout = (hdr->timeout * HZ) / 1000;
if (!rq->timeout)
rq->timeout = q->sg_timeout;
if (!rq->timeout)
Expand Down Expand Up @@ -366,7 +366,7 @@ static int sg_io(struct file *file, struct request_queue *q,
*/
blk_execute_rq(q, bd_disk, rq, 0);

hdr->duration = jiffies_to_msecs(jiffies - start_time);
hdr->duration = ((jiffies - start_time) * 1000) / HZ;

return blk_complete_sghdr_rq(rq, hdr, bio);
out:
Expand Down
Loading

0 comments on commit 979f79a

Please sign in to comment.