ceph: cast PAGE_SIZE to size_t in ceph_sync_write()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 28 Jan 2014 17:16:18 +0000 (19:16 +0200)
committerSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 17:57:21 +0000 (09:57 -0800)
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>
fs/ceph/file.c

index d10510a4733d50e7a00729545776a73eb241db31..dfd2ce3419f812f71769406023d0ff33cea3a35b 100644 (file)
@@ -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;