aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-06-28 03:04:00 -0400
committerJens Axboe <axboe@fb.com>2016-06-28 10:21:46 -0400
commit93fdf1478aaba6c397ba54f4cc534bf5019831b4 (patch)
tree819d98cc9cafe4a47dd2fcd162e6c251a1e9e4bc /block
parent9828c2c6c1048c61034a8b94e6376aeff6d2284f (diff)
cfq-iosched: Convert slice_resid from u64 to s64
slice_resid can be both positive and negative. Commit 9a7f38c42c2b (cfq-iosched: Convert from jiffies to nanoseconds) converted it from long to u64. Although this did not introduce any functional regression (the operations just overflow and the result was fine), it is certainly wrong and could cause issues in future. So convert the type to more appropriate s64. Fixes: 9a7f38c42c2b92391d9dabaf9f51df7cfe5608e4 Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d227ad633242..c1adbd01d0fa 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -132,7 +132,7 @@ struct cfq_queue {
132 /* time when first request from queue completed and slice started. */ 132 /* time when first request from queue completed and slice started. */
133 u64 slice_start; 133 u64 slice_start;
134 u64 slice_end; 134 u64 slice_end;
135 u64 slice_resid; 135 s64 slice_resid;
136 136
137 /* pending priority requests */ 137 /* pending priority requests */
138 int prio_pending; 138 int prio_pending;
@@ -2689,7 +2689,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
2689 cfqq->slice_resid = cfq_scaled_cfqq_slice(cfqd, cfqq); 2689 cfqq->slice_resid = cfq_scaled_cfqq_slice(cfqd, cfqq);
2690 else 2690 else
2691 cfqq->slice_resid = cfqq->slice_end - ktime_get_ns(); 2691 cfqq->slice_resid = cfqq->slice_end - ktime_get_ns();
2692 cfq_log_cfqq(cfqd, cfqq, "resid=%llu", cfqq->slice_resid); 2692 cfq_log_cfqq(cfqd, cfqq, "resid=%lld", cfqq->slice_resid);
2693 } 2693 }
2694 2694
2695 cfq_group_served(cfqd, cfqq->cfqg, cfqq); 2695 cfq_group_served(cfqd, cfqq->cfqg, cfqq);