提交 88b7210c 编写于 作者: A Arnd Bergmann 提交者: Jens Axboe

block: iolatency: avoid 64-bit division

On 32-bit architectures, dividing a 64-bit number needs to use the
do_div() function or something like it to avoid a link failure:

block/blk-iolatency.o: In function `iolatency_prfill_limit':
blk-iolatency.c:(.text+0x8cc): undefined reference to `__aeabi_uldivmod'

Using div_u64() gives us the best output and avoids the need for an
explicit cast.

Fixes: d7067512 ("block: introduce blk-iolatency io controller")
Reviewed-by: NJosef Bacik <josef@toxicpanda.com>
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 3993e501
......@@ -798,8 +798,7 @@ static u64 iolatency_prfill_limit(struct seq_file *sf,
if (!dname || !iolat->min_lat_nsec)
return 0;
seq_printf(sf, "%s target=%llu\n",
dname,
(unsigned long long)iolat->min_lat_nsec / NSEC_PER_USEC);
dname, div_u64(iolat->min_lat_nsec, NSEC_PER_USEC));
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册