aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorWu Bo <wubo40@huawei.com>2021-05-25 15:40:47 +0800
committerMiklos Szeredi <mszeredi@redhat.com>2021-06-22 09:15:36 +0200
commit6c88632be3827899953d9bc2260da378394007b7 (patch)
treec785fb4990db43ae51276e02319431c07681997f /fs/fuse/file.c
parentfuse: fix illegal access to inode with reused nodeid (diff)
downloadlinux-dev-6c88632be3827899953d9bc2260da378394007b7.tar.xz
linux-dev-6c88632be3827899953d9bc2260da378394007b7.zip
fuse: use DIV_ROUND_UP helper macro for calculations
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>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index ec20a1801c1b..3f6ba68dfbbc 100644
--- 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);