Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7103b99 authored by Jeff Layton's avatar Jeff Layton
Browse files

cifs: fix up get_numpages



Use DIV_ROUND_UP. Also, PAGE_SIZE is more appropriate here since these
aren't pagecache pages.

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Reviewed-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
parent 35ebb415
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2071,9 +2071,7 @@ size_t get_numpages(const size_t wsize, const size_t len, size_t *cur_len)
	size_t clen;

	clen = min_t(const size_t, len, wsize);
	num_pages = clen / PAGE_CACHE_SIZE;
	if (clen % PAGE_CACHE_SIZE)
		num_pages++;
	num_pages = DIV_ROUND_UP(clen, PAGE_SIZE);

	if (cur_len)
		*cur_len = clen;