Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Cleanup umem driver: fix most checkpatch warnings, conform to kernel
  block: let elv_register() return void
  as-iosched: fix write batch start point
  as-iosched: fix incorrect comments
  block: use jiffies conversion functions in scsi_ioctl.c
  • Loading branch information
Linus Torvalds committed Dec 18, 2007
2 parents 5768091 + 458cf5e commit 3c615e1
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 173 deletions.
11 changes: 7 additions & 4 deletions 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 reads on the fifo,
* as_fifo_expired returns 0 if there are no expired requests 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,7 +1097,8 @@ 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 = ad->next_rq[ad->batch_data_dir];
rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
ad->last_check_fifo[REQ_ASYNC] = jiffies;
goto dispatch_request;
}

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

/*
* set expire time (only used for reads) and add to fifo list
* set expire time 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 @@ -1463,7 +1464,9 @@ static struct elevator_type iosched_as = {

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

return 0;
}

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

static int __init cfq_init(void)
{
int ret;

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

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

return ret;
return 0;
}

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

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

return 0;
}

static void __exit deadline_exit(void)
Expand Down
3 changes: 1 addition & 2 deletions 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);
}

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

Expand All @@ -975,7 +975,6 @@ int 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: 3 additions & 1 deletion block/noop-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ static struct elevator_type elevator_noop = {

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

return 0;
}

static void __exit noop_exit(void)
Expand Down
4 changes: 2 additions & 2 deletions 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 = (hdr->timeout * HZ) / 1000;
rq->timeout = msecs_to_jiffies(hdr->timeout);
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 - start_time) * 1000) / HZ;
hdr->duration = jiffies_to_msecs(jiffies - start_time);

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

0 comments on commit 3c615e1

Please sign in to comment.