diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-06-12 07:43:08 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-06-12 07:43:08 -0400 |
commit | 84f54cfa78c81991e087309a9b379f25f1ffdb10 (patch) | |
tree | 2f2576ea31a276504e99090473e2c6829d1a9024 /fs/btrfs/file.c | |
parent | 39279cc3d2704cfbf9c35dcb5bdd392159ae4625 (diff) |
Btrfs: 64 bit div fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7f8e3035d99e..0325dc038592 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -82,7 +82,7 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans, | |||
82 | 82 | ||
83 | for (i = 0; i < num_pages; i++) { | 83 | for (i = 0; i < num_pages; i++) { |
84 | offset = pos & (PAGE_CACHE_SIZE -1); | 84 | offset = pos & (PAGE_CACHE_SIZE -1); |
85 | this_write = min(PAGE_CACHE_SIZE - offset, write_bytes); | 85 | this_write = min((size_t)PAGE_CACHE_SIZE - offset, write_bytes); |
86 | /* FIXME, one block at a time */ | 86 | /* FIXME, one block at a time */ |
87 | 87 | ||
88 | mutex_lock(&root->fs_info->fs_mutex); | 88 | mutex_lock(&root->fs_info->fs_mutex); |
@@ -395,7 +395,7 @@ static int prepare_pages(struct btrfs_root *root, | |||
395 | cancel_dirty_page(pages[i], PAGE_CACHE_SIZE); | 395 | cancel_dirty_page(pages[i], PAGE_CACHE_SIZE); |
396 | wait_on_page_writeback(pages[i]); | 396 | wait_on_page_writeback(pages[i]); |
397 | offset = pos & (PAGE_CACHE_SIZE -1); | 397 | offset = pos & (PAGE_CACHE_SIZE -1); |
398 | this_write = min(PAGE_CACHE_SIZE - offset, write_bytes); | 398 | this_write = min((size_t)PAGE_CACHE_SIZE - offset, write_bytes); |
399 | if (!page_has_buffers(pages[i])) { | 399 | if (!page_has_buffers(pages[i])) { |
400 | create_empty_buffers(pages[i], | 400 | create_empty_buffers(pages[i], |
401 | root->fs_info->sb->s_blocksize, | 401 | root->fs_info->sb->s_blocksize, |
@@ -567,7 +567,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, | |||
567 | 567 | ||
568 | while(count > 0) { | 568 | while(count > 0) { |
569 | size_t offset = pos & (PAGE_CACHE_SIZE - 1); | 569 | size_t offset = pos & (PAGE_CACHE_SIZE - 1); |
570 | size_t write_bytes = min(count, PAGE_CACHE_SIZE - offset); | 570 | size_t write_bytes = min(count, |
571 | (size_t)PAGE_CACHE_SIZE - offset); | ||
571 | size_t num_pages = (write_bytes + PAGE_CACHE_SIZE - 1) >> | 572 | size_t num_pages = (write_bytes + PAGE_CACHE_SIZE - 1) >> |
572 | PAGE_CACHE_SHIFT; | 573 | PAGE_CACHE_SHIFT; |
573 | 574 | ||