diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-10-30 16:56:53 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:57 -0400 |
commit | 35ebb934bd7fcc7ca991b155b7980c3c4ff9f1a5 (patch) | |
tree | ce2980aac2b06a75b18b0c523aa0d859f09c8fad /fs/btrfs/inode.c | |
parent | 2ff3e9b61d02b03e3157f7d43ba20ee1452814de (diff) |
Btrfs: Fix PAGE_CACHE_SHIFT shifts on 32 bit machines
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0ba1cdbdf112..5d10b64e42df 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -111,7 +111,7 @@ int btrfs_writepage_io_hook(struct page *page, u64 start, u64 end) | |||
111 | struct btrfs_trans_handle *trans; | 111 | struct btrfs_trans_handle *trans; |
112 | char *kaddr; | 112 | char *kaddr; |
113 | int ret; | 113 | int ret; |
114 | u64 page_start = page->index << PAGE_CACHE_SHIFT; | 114 | u64 page_start = (u64)page->index << PAGE_CACHE_SHIFT; |
115 | size_t offset = start - page_start; | 115 | size_t offset = start - page_start; |
116 | 116 | ||
117 | mutex_lock(&root->fs_info->fs_mutex); | 117 | mutex_lock(&root->fs_info->fs_mutex); |
@@ -160,7 +160,7 @@ out: | |||
160 | 160 | ||
161 | int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end) | 161 | int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end) |
162 | { | 162 | { |
163 | size_t offset = start - (page->index << PAGE_CACHE_SHIFT); | 163 | size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); |
164 | struct inode *inode = page->mapping->host; | 164 | struct inode *inode = page->mapping->host; |
165 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 165 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
166 | char *kaddr; | 166 | char *kaddr; |
@@ -688,7 +688,7 @@ static int btrfs_cow_one_page(struct inode *inode, struct page *page, | |||
688 | char *kaddr; | 688 | char *kaddr; |
689 | int ret = 0; | 689 | int ret = 0; |
690 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 690 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
691 | u64 page_start = page->index << PAGE_CACHE_SHIFT; | 691 | u64 page_start = (u64)page->index << PAGE_CACHE_SHIFT; |
692 | u64 page_end = page_start + PAGE_CACHE_SIZE - 1; | 692 | u64 page_end = page_start + PAGE_CACHE_SIZE - 1; |
693 | 693 | ||
694 | set_page_extent_mapped(page); | 694 | set_page_extent_mapped(page); |
@@ -739,7 +739,7 @@ static int btrfs_truncate_page(struct address_space *mapping, loff_t from) | |||
739 | goto out; | 739 | goto out; |
740 | } | 740 | } |
741 | } | 741 | } |
742 | page_start = page->index << PAGE_CACHE_SHIFT; | 742 | page_start = (u64)page->index << PAGE_CACHE_SHIFT; |
743 | 743 | ||
744 | ret = btrfs_cow_one_page(inode, page, offset); | 744 | ret = btrfs_cow_one_page(inode, page, offset); |
745 | 745 | ||
@@ -1618,7 +1618,7 @@ again: | |||
1618 | goto out; | 1618 | goto out; |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | extent_offset = (page->index << PAGE_CACHE_SHIFT) - | 1621 | extent_offset = ((u64)page->index << PAGE_CACHE_SHIFT) - |
1622 | extent_start + page_offset; | 1622 | extent_start + page_offset; |
1623 | copy_size = min_t(u64, PAGE_CACHE_SIZE - page_offset, | 1623 | copy_size = min_t(u64, PAGE_CACHE_SIZE - page_offset, |
1624 | size - extent_offset); | 1624 | size - extent_offset); |
@@ -1769,7 +1769,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page) | |||
1769 | lock_page(page); | 1769 | lock_page(page); |
1770 | wait_on_page_writeback(page); | 1770 | wait_on_page_writeback(page); |
1771 | size = i_size_read(inode); | 1771 | size = i_size_read(inode); |
1772 | page_start = page->index << PAGE_CACHE_SHIFT; | 1772 | page_start = (u64)page->index << PAGE_CACHE_SHIFT; |
1773 | 1773 | ||
1774 | if ((page->mapping != inode->i_mapping) || | 1774 | if ((page->mapping != inode->i_mapping) || |
1775 | (page_start > size)) { | 1775 | (page_start > size)) { |
@@ -2065,7 +2065,7 @@ int btrfs_defrag_file(struct file *file) { | |||
2065 | goto out_unlock; | 2065 | goto out_unlock; |
2066 | } | 2066 | } |
2067 | } | 2067 | } |
2068 | page_start = page->index << PAGE_CACHE_SHIFT; | 2068 | page_start = (u64)page->index << PAGE_CACHE_SHIFT; |
2069 | page_end = page_start + PAGE_CACHE_SIZE - 1; | 2069 | page_end = page_start + PAGE_CACHE_SIZE - 1; |
2070 | 2070 | ||
2071 | lock_extent(em_tree, page_start, page_end, GFP_NOFS); | 2071 | lock_extent(em_tree, page_start, page_end, GFP_NOFS); |