From: Jens Axboe Date: Wed, 27 Jul 2005 18:43:37 +0000 (-0700) Subject: [PATCH] as-iosched tunable encoding fix X-Git-Tag: v2.6.13-rc4~25^2~155 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9b3ad673460fc997a652cd58aa3a345d40e5218;p=linux-2.6 [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c index 91aeb67813..95c0a3690b 100644 --- a/drivers/block/as-iosched.c +++ b/drivers/block/as-iosched.c @@ -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; }