Btrfs: Switch to libcrc32c to avoid problems with cryptomgr on highmem machines
[linux-2.6-block.git] / fs / btrfs / file.c
index 6b455c2b3f039bf40783efc8b30a43294f4f5798..23f02935968809d68ef8c9eb93976b07a6ac9fdb 100644 (file)
@@ -607,7 +607,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
 
        while(count > 0) {
                size_t offset = pos & (PAGE_CACHE_SIZE - 1);
-               size_t write_bytes = min(count, nrptrs * PAGE_CACHE_SIZE -
+               size_t write_bytes = min(count, nrptrs *
+                                       (size_t)PAGE_CACHE_SIZE -
                                         offset);
                size_t num_pages = (write_bytes + PAGE_CACHE_SIZE - 1) >>
                                        PAGE_CACHE_SHIFT;