提交 125d725c 编写于 作者: I Ilya Dryomov 提交者: Sage Weil

ceph: cast PAGE_SIZE to size_t in ceph_sync_write()

Use min_t(size_t, ...) instead of plain min(), which does strict type
checking, to avoid compile warning on i386.

Cc: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NIlya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: NSage Weil <sage@inktank.com>
上级 37b52fe6
......@@ -734,7 +734,7 @@ static ssize_t ceph_sync_write(struct kiocb *iocb, const struct iovec *iov,
left = len;
for (n = 0; n < num_pages; n++) {
size_t plen = min(left, PAGE_SIZE);
size_t plen = min_t(size_t, left, PAGE_SIZE);
ret = iov_iter_copy_from_user(pages[n], &i, 0, plen);
if (ret != plen) {
ret = -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册