Commit 6c88632b authored by Wu Bo's avatar Wu Bo Committed by Miklos Szeredi

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: default avatarWu Bo <wubo40@huawei.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 15db1683
...@@ -1405,7 +1405,7 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii, ...@@ -1405,7 +1405,7 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii,
nbytes += ret; nbytes += ret;
ret += start; ret += start;
npages = (ret + PAGE_SIZE - 1) / PAGE_SIZE; npages = DIV_ROUND_UP(ret, PAGE_SIZE);
ap->descs[ap->num_pages].offset = start; ap->descs[ap->num_pages].offset = start;
fuse_page_descs_length_init(ap->descs, ap->num_pages, npages); fuse_page_descs_length_init(ap->descs, ap->num_pages, npages);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment