projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15db168
)
fuse: use DIV_ROUND_UP helper macro for calculations
author
Wu Bo
<wubo40@huawei.com>
Tue, 25 May 2021 07:40:47 +0000
(15:40 +0800)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Tue, 22 Jun 2021 07:15:36 +0000
(09:15 +0200)
Replace open coded divisor calculations with the DIV_ROUND_UP kernel macro
for better readability.
Signed-off-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c
patch
|
blob
|
history
diff --git
a/fs/fuse/file.c
b/fs/fuse/file.c
index ec20a1801c1b7da91013e7bfe5a139cf60c24b73..3f6ba68dfbbc9adfa24269ee6015bf90064713d9 100644
(file)
--- a/
fs/fuse/file.c
+++ b/
fs/fuse/file.c
@@
-1405,7
+1405,7
@@
static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii,
nbytes += ret;
ret += start;
- npages =
(ret + PAGE_SIZE - 1) / PAGE_SIZE
;
+ npages =
DIV_ROUND_UP(ret, PAGE_SIZE)
;
ap->descs[ap->num_pages].offset = start;
fuse_page_descs_length_init(ap->descs, ap->num_pages, npages);