提交 6972ead0 编写于 作者: Y Yu Kuai 提交者: Zheng Zengkai

block: only use cmpxchg64 in 64bit platform

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I65K8D
CVE: NA

--------------------------------

Use cmpxchg64() in some 32bit platform will cause compile error, because
it might not be implemented, for example PCC32. Hence only compile it in
64bit platform.

Fixes: 82327165 ("blk-mq: don't access request_wrapper if request is not allocated from block layer")
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 626cdf5c
......@@ -1306,10 +1306,11 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes)
static void blk_account_io_latency(struct request *req, u64 now, const int sgrp)
{
#ifdef CONFIG_64BIT
u64 stat_time;
struct request_wrapper *rq_wrapper;
if (!IS_ENABLED(CONFIG_64BIT) || !(req->rq_flags & RQF_FROM_BLOCK)) {
if (!(req->rq_flags & RQF_FROM_BLOCK)) {
part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns);
return;
}
......@@ -1328,6 +1329,10 @@ static void blk_account_io_latency(struct request *req, u64 now, const int sgrp)
part_stat_add(req->part, nsecs[sgrp], duration);
}
#else
part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns);
#endif
}
void blk_account_io_done(struct request *req, u64 now)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册