Commit c9b3ad67 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] as-iosched tunable encoding fix

AS is doing internal msec<->jiffies conversions twice, so the sysfs tunables
which represent time are coming out wrong.  The switch from HZ=1000 exposed
this.

Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ef2a701d
...@@ -1935,23 +1935,15 @@ struct as_fs_entry { ...@@ -1935,23 +1935,15 @@ struct as_fs_entry {
static ssize_t static ssize_t
as_var_show(unsigned int var, char *page) as_var_show(unsigned int var, char *page)
{ {
var = (var * 1000) / HZ;
return sprintf(page, "%d\n", var); return sprintf(page, "%d\n", var);
} }
static ssize_t static ssize_t
as_var_store(unsigned long *var, const char *page, size_t count) as_var_store(unsigned long *var, const char *page, size_t count)
{ {
unsigned long tmp;
char *p = (char *) page; char *p = (char *) page;
tmp = simple_strtoul(p, &p, 10); *var = simple_strtoul(p, &p, 10);
if (tmp != 0) {
tmp = (tmp * HZ) / 1000;
if (tmp == 0)
tmp = 1;
}
*var = tmp;
return count; return count;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment