Skip to content

Commit

Permalink
ceph: cast PAGE_SIZE to size_t in ceph_sync_write()
Browse files Browse the repository at this point in the history
Use min_t(size_t, ...) instead of plain min(), which does strict type
checking, to avoid compile warning on i386.

Cc: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Ilya Dryomov authored and Sage Weil committed Jan 28, 2014
1 parent 37b52fe commit 125d725
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static ssize_t ceph_sync_write(struct kiocb *iocb, const struct iovec *iov,

left = len;
for (n = 0; n < num_pages; n++) {
size_t plen = min(left, PAGE_SIZE);
size_t plen = min_t(size_t, left, PAGE_SIZE);
ret = iov_iter_copy_from_user(pages[n], &i, 0, plen);
if (ret != plen) {
ret = -EFAULT;
Expand Down

0 comments on commit 125d725

Please sign in to comment.