提交 fc251d5c 编写于 作者: L Lars Ellenberg 提交者: Philipp Reisner

drbd: cosmetic: fix accidental division instead of modulo when pretty printing

For large resync rates, seq_printf_with_thousands_grouping()
accidentally only produced Y,000,00Y, instead of the real numbers.
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 46530e85
...@@ -52,7 +52,7 @@ void seq_printf_with_thousands_grouping(struct seq_file *seq, long v) ...@@ -52,7 +52,7 @@ void seq_printf_with_thousands_grouping(struct seq_file *seq, long v)
if (unlikely(v >= 1000000)) { if (unlikely(v >= 1000000)) {
/* cool: > GiByte/s */ /* cool: > GiByte/s */
seq_printf(seq, "%ld,", v / 1000000); seq_printf(seq, "%ld,", v / 1000000);
v /= 1000000; v %= 1000000;
seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000); seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000);
} else if (likely(v >= 1000)) } else if (likely(v >= 1000))
seq_printf(seq, "%ld,%03ld", v/1000, v % 1000); seq_printf(seq, "%ld,%03ld", v/1000, v % 1000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册