Commit 6972ead0 authored by Yu Kuai's avatar Yu Kuai Committed by Zheng Zengkai
Browse files

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: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 626cdf5c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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)