projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
451c0ba
)
ITER_XARRAY: don't open-code DIV_ROUND_UP()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sat, 11 Jun 2022 00:30:35 +0000
(20:30 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Tue, 9 Aug 2022 02:37:21 +0000
(22:37 -0400)
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lib/iov_iter.c
patch
|
blob
|
history
diff --git
a/lib/iov_iter.c
b/lib/iov_iter.c
index 8c6cdc1cf832be804b470c6bb07287e716df8dae..c78129e709f20d02be78ce858ebde5c9b02cf305 100644
(file)
--- a/
lib/iov_iter.c
+++ b/
lib/iov_iter.c
@@
-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;