Skip to content

Commit

Permalink
[PATCH] as-iosched tunable encoding fix
Browse files Browse the repository at this point in the history
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Jul 27, 2005
1 parent ef2a701 commit c9b3ad6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,23 +1935,15 @@ struct as_fs_entry {
static ssize_t
as_var_show(unsigned int var, char *page)
{
var = (var * 1000) / HZ;
return sprintf(page, "%d\n", var);
}

static ssize_t
as_var_store(unsigned long *var, const char *page, size_t count)
{
unsigned long tmp;
char *p = (char *) page;

tmp = simple_strtoul(p, &p, 10);
if (tmp != 0) {
tmp = (tmp * HZ) / 1000;
if (tmp == 0)
tmp = 1;
}
*var = tmp;
*var = simple_strtoul(p, &p, 10);
return count;
}

Expand Down

0 comments on commit c9b3ad6

Please sign in to comment.