提交 0aa4fc32 编写于 作者: A Al Viro

ITER_XARRAY: don't open-code DIV_ROUND_UP()

Reviewed-by: NJeff Layton <jlayton@kernel.org>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 451c0ba9
......@@ -1386,15 +1386,7 @@ static ssize_t iter_xarray_get_pages(struct iov_iter *i,
offset = pos & ~PAGE_MASK;
*_start_offset = offset;
count = 1;
if (size > PAGE_SIZE - offset) {
size -= PAGE_SIZE - offset;
count += size >> PAGE_SHIFT;
size &= ~PAGE_MASK;
if (size)
count++;
}
count = DIV_ROUND_UP(size + offset, PAGE_SIZE);
if (count > maxpages)
count = maxpages;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册