aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/as-iosched.c11
-rw-r--r--block/cfq-iosched.c8
-rw-r--r--block/deadline-iosched.c4
-rw-r--r--block/elevator.c3
-rw-r--r--block/noop-iosched.c4
-rw-r--r--block/scsi_ioctl.c4
6 files changed, 18 insertions, 16 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index dc715a562e14..cb5e53b05c7c 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -880,7 +880,7 @@ static void as_remove_queued_request(struct request_queue *q,
880} 880}
881 881
882/* 882/*
883 * as_fifo_expired returns 0 if there are no expired reads on the fifo, 883 * as_fifo_expired returns 0 if there are no expired requests on the fifo,
884 * 1 otherwise. It is ratelimited so that we only perform the check once per 884 * 1 otherwise. It is ratelimited so that we only perform the check once per
885 * `fifo_expire' interval. Otherwise a large number of expired requests 885 * `fifo_expire' interval. Otherwise a large number of expired requests
886 * would create a hopeless seekstorm. 886 * would create a hopeless seekstorm.
@@ -1097,7 +1097,8 @@ dispatch_writes:
1097 ad->batch_data_dir = REQ_ASYNC; 1097 ad->batch_data_dir = REQ_ASYNC;
1098 ad->current_write_count = ad->write_batch_count; 1098 ad->current_write_count = ad->write_batch_count;
1099 ad->write_batch_idled = 0; 1099 ad->write_batch_idled = 0;
1100 rq = ad->next_rq[ad->batch_data_dir]; 1100 rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
1101 ad->last_check_fifo[REQ_ASYNC] = jiffies;
1101 goto dispatch_request; 1102 goto dispatch_request;
1102 } 1103 }
1103 1104
@@ -1159,7 +1160,7 @@ static void as_add_request(struct request_queue *q, struct request *rq)
1159 as_add_rq_rb(ad, rq); 1160 as_add_rq_rb(ad, rq);
1160 1161
1161 /* 1162 /*
1162 * set expire time (only used for reads) and add to fifo list 1163 * set expire time and add to fifo list
1163 */ 1164 */
1164 rq_set_fifo_time(rq, jiffies + ad->fifo_expire[data_dir]); 1165 rq_set_fifo_time(rq, jiffies + ad->fifo_expire[data_dir]);
1165 list_add_tail(&rq->queuelist, &ad->fifo_list[data_dir]); 1166 list_add_tail(&rq->queuelist, &ad->fifo_list[data_dir]);
@@ -1463,7 +1464,9 @@ static struct elevator_type iosched_as = {
1463 1464
1464static int __init as_init(void) 1465static int __init as_init(void)
1465{ 1466{
1466 return elv_register(&iosched_as); 1467 elv_register(&iosched_as);
1468
1469 return 0;
1467} 1470}
1468 1471
1469static void __exit as_exit(void) 1472static void __exit as_exit(void)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 0b4a47905575..13553e015d72 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2279,8 +2279,6 @@ static struct elevator_type iosched_cfq = {
2279 2279
2280static int __init cfq_init(void) 2280static int __init cfq_init(void)
2281{ 2281{
2282 int ret;
2283
2284 /* 2282 /*
2285 * could be 0 on HZ < 1000 setups 2283 * could be 0 on HZ < 1000 setups
2286 */ 2284 */
@@ -2292,11 +2290,9 @@ static int __init cfq_init(void)
2292 if (cfq_slab_setup()) 2290 if (cfq_slab_setup())
2293 return -ENOMEM; 2291 return -ENOMEM;
2294 2292
2295 ret = elv_register(&iosched_cfq); 2293 elv_register(&iosched_cfq);
2296 if (ret)
2297 cfq_slab_kill();
2298 2294
2299 return ret; 2295 return 0;
2300} 2296}
2301 2297
2302static void __exit cfq_exit(void) 2298static void __exit cfq_exit(void)
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c
index a054eef8dff6..342448c3d2dd 100644
--- a/block/deadline-iosched.c
+++ b/block/deadline-iosched.c
@@ -467,7 +467,9 @@ static struct elevator_type iosched_deadline = {
467 467
468static int __init deadline_init(void) 468static int __init deadline_init(void)
469{ 469{
470 return elv_register(&iosched_deadline); 470 elv_register(&iosched_deadline);
471
472 return 0;
471} 473}
472 474
473static void __exit deadline_exit(void) 475static void __exit deadline_exit(void)
diff --git a/block/elevator.c b/block/elevator.c
index 446aea2a3cfb..e452deb80395 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q)
960 __elv_unregister_queue(q->elevator); 960 __elv_unregister_queue(q->elevator);
961} 961}
962 962
963int elv_register(struct elevator_type *e) 963void elv_register(struct elevator_type *e)
964{ 964{
965 char *def = ""; 965 char *def = "";
966 966
@@ -975,7 +975,6 @@ int elv_register(struct elevator_type *e)
975 def = " (default)"; 975 def = " (default)";
976 976
977 printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def); 977 printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
978 return 0;
979} 978}
980EXPORT_SYMBOL_GPL(elv_register); 979EXPORT_SYMBOL_GPL(elv_register);
981 980
diff --git a/block/noop-iosched.c b/block/noop-iosched.c
index 7563d8aa3944..c23e02969650 100644
--- a/block/noop-iosched.c
+++ b/block/noop-iosched.c
@@ -101,7 +101,9 @@ static struct elevator_type elevator_noop = {
101 101
102static int __init noop_init(void) 102static int __init noop_init(void)
103{ 103{
104 return elv_register(&elevator_noop); 104 elv_register(&elevator_noop);
105
106 return 0;
105} 107}
106 108
107static void __exit noop_exit(void) 109static void __exit noop_exit(void)
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 91c73224f4c6..9675b34638d4 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -230,7 +230,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
230 rq->cmd_len = hdr->cmd_len; 230 rq->cmd_len = hdr->cmd_len;
231 rq->cmd_type = REQ_TYPE_BLOCK_PC; 231 rq->cmd_type = REQ_TYPE_BLOCK_PC;
232 232
233 rq->timeout = (hdr->timeout * HZ) / 1000; 233 rq->timeout = msecs_to_jiffies(hdr->timeout);
234 if (!rq->timeout) 234 if (!rq->timeout)
235 rq->timeout = q->sg_timeout; 235 rq->timeout = q->sg_timeout;
236 if (!rq->timeout) 236 if (!rq->timeout)
@@ -366,7 +366,7 @@ static int sg_io(struct file *file, struct request_queue *q,
366 */ 366 */
367 blk_execute_rq(q, bd_disk, rq, 0); 367 blk_execute_rq(q, bd_disk, rq, 0);
368 368
369 hdr->duration = ((jiffies - start_time) * 1000) / HZ; 369 hdr->duration = jiffies_to_msecs(jiffies - start_time);
370 370
371 return blk_complete_sghdr_rq(rq, hdr, bio); 371 return blk_complete_sghdr_rq(rq, hdr, bio);
372out: 372out: