summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rorvick <chris@rorvick.com>2014-12-16 22:24:01 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-17 15:42:34 -0800
commit965bd8b9f743dfc7fd4175fc5072643d321e55d4 (patch)
tree87e5ec89031b50694ee5d80a59e19ec3341c46ea
parent054cd8374facbefeafa335d6c3c663939612a889 (diff)
drivers: staging: lustre: Use mult if units not specified
Units can be passed to lprocfs_write_frac_u64_helper() via a suffix (e.g., "...K", "...M", etc.) tacked onto the value. A comment states that "specified units override the multiplier," though the multiplier is overridden regardless. Update the conditional logic so that it only applies when units are specified. Signed-off-by: Chris Rorvick <chris@rorvick.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/obdclass/lprocfs_status.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index f78a24145329..5aada17c6450 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1908,7 +1908,7 @@ int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
units <<= 10;
}
/* Specified units override the multiplier */
- if (units)
+ if (units > 1)
mult = mult < 0 ? -units : units;
frac *= mult;