Skip to content

Commit 6c88632

Browse files
Wu BoMiklos Szeredi
authored andcommitted
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>
1 parent 15db168 commit 6c88632

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/fuse/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii,
14051405
nbytes += ret;
14061406

14071407
ret += start;
1408-
npages = (ret + PAGE_SIZE - 1) / PAGE_SIZE;
1408+
npages = DIV_ROUND_UP(ret, PAGE_SIZE);
14091409

14101410
ap->descs[ap->num_pages].offset = start;
14111411
fuse_page_descs_length_init(ap->descs, ap->num_pages, npages);

0 commit comments

Comments
 (0)