aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/disk-io.c2
-rw-r--r--fs/btrfs/extent_io.c24
-rw-r--r--fs/btrfs/inode.c5
-rw-r--r--fs/btrfs/relocation.c2
4 files changed, 15 insertions, 18 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4438aac4947f..a762f9137610 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -420,7 +420,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
420static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) 420static int csum_dirty_buffer(struct btrfs_root *root, struct page *page)
421{ 421{
422 struct extent_io_tree *tree; 422 struct extent_io_tree *tree;
423 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 423 u64 start = page_offset(page);
424 u64 found_start; 424 u64 found_start;
425 struct extent_buffer *eb; 425 struct extent_buffer *eb;
426 426
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 1b319df29eee..bda36fef301e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1834,7 +1834,7 @@ int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
1834 */ 1834 */
1835static void check_page_uptodate(struct extent_io_tree *tree, struct page *page) 1835static void check_page_uptodate(struct extent_io_tree *tree, struct page *page)
1836{ 1836{
1837 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 1837 u64 start = page_offset(page);
1838 u64 end = start + PAGE_CACHE_SIZE - 1; 1838 u64 end = start + PAGE_CACHE_SIZE - 1;
1839 if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL)) 1839 if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL))
1840 SetPageUptodate(page); 1840 SetPageUptodate(page);
@@ -1846,7 +1846,7 @@ static void check_page_uptodate(struct extent_io_tree *tree, struct page *page)
1846 */ 1846 */
1847static void check_page_locked(struct extent_io_tree *tree, struct page *page) 1847static void check_page_locked(struct extent_io_tree *tree, struct page *page)
1848{ 1848{
1849 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 1849 u64 start = page_offset(page);
1850 u64 end = start + PAGE_CACHE_SIZE - 1; 1850 u64 end = start + PAGE_CACHE_SIZE - 1;
1851 if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL)) 1851 if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL))
1852 unlock_page(page); 1852 unlock_page(page);
@@ -1960,7 +1960,7 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start,
1960 return -EIO; 1960 return -EIO;
1961 } 1961 }
1962 bio->bi_bdev = dev->bdev; 1962 bio->bi_bdev = dev->bdev;
1963 bio_add_page(bio, page, length, start-page_offset(page)); 1963 bio_add_page(bio, page, length, start - page_offset(page));
1964 btrfsic_submit_bio(WRITE_SYNC, bio); 1964 btrfsic_submit_bio(WRITE_SYNC, bio);
1965 wait_for_completion(&compl); 1965 wait_for_completion(&compl);
1966 1966
@@ -2293,8 +2293,7 @@ static void end_bio_extent_writepage(struct bio *bio, int err)
2293 struct page *page = bvec->bv_page; 2293 struct page *page = bvec->bv_page;
2294 tree = &BTRFS_I(page->mapping->host)->io_tree; 2294 tree = &BTRFS_I(page->mapping->host)->io_tree;
2295 2295
2296 start = ((u64)page->index << PAGE_CACHE_SHIFT) + 2296 start = page_offset(page) + bvec->bv_offset;
2297 bvec->bv_offset;
2298 end = start + bvec->bv_len - 1; 2297 end = start + bvec->bv_len - 1;
2299 2298
2300 if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE) 2299 if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE)
@@ -2353,8 +2352,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
2353 (long int)bio->bi_bdev); 2352 (long int)bio->bi_bdev);
2354 tree = &BTRFS_I(page->mapping->host)->io_tree; 2353 tree = &BTRFS_I(page->mapping->host)->io_tree;
2355 2354
2356 start = ((u64)page->index << PAGE_CACHE_SHIFT) + 2355 start = page_offset(page) + bvec->bv_offset;
2357 bvec->bv_offset;
2358 end = start + bvec->bv_len - 1; 2356 end = start + bvec->bv_len - 1;
2359 2357
2360 if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE) 2358 if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE)
@@ -2471,7 +2469,7 @@ static int __must_check submit_one_bio(int rw, struct bio *bio,
2471 struct extent_io_tree *tree = bio->bi_private; 2469 struct extent_io_tree *tree = bio->bi_private;
2472 u64 start; 2470 u64 start;
2473 2471
2474 start = ((u64)page->index << PAGE_CACHE_SHIFT) + bvec->bv_offset; 2472 start = page_offset(page) + bvec->bv_offset;
2475 2473
2476 bio->bi_private = NULL; 2474 bio->bi_private = NULL;
2477 2475
@@ -2595,7 +2593,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
2595 unsigned long *bio_flags) 2593 unsigned long *bio_flags)
2596{ 2594{
2597 struct inode *inode = page->mapping->host; 2595 struct inode *inode = page->mapping->host;
2598 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 2596 u64 start = page_offset(page);
2599 u64 page_end = start + PAGE_CACHE_SIZE - 1; 2597 u64 page_end = start + PAGE_CACHE_SIZE - 1;
2600 u64 end; 2598 u64 end;
2601 u64 cur = start; 2599 u64 cur = start;
@@ -2806,7 +2804,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
2806 struct inode *inode = page->mapping->host; 2804 struct inode *inode = page->mapping->host;
2807 struct extent_page_data *epd = data; 2805 struct extent_page_data *epd = data;
2808 struct extent_io_tree *tree = epd->tree; 2806 struct extent_io_tree *tree = epd->tree;
2809 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 2807 u64 start = page_offset(page);
2810 u64 delalloc_start; 2808 u64 delalloc_start;
2811 u64 page_end = start + PAGE_CACHE_SIZE - 1; 2809 u64 page_end = start + PAGE_CACHE_SIZE - 1;
2812 u64 end; 2810 u64 end;
@@ -3674,7 +3672,7 @@ int extent_invalidatepage(struct extent_io_tree *tree,
3674 struct page *page, unsigned long offset) 3672 struct page *page, unsigned long offset)
3675{ 3673{
3676 struct extent_state *cached_state = NULL; 3674 struct extent_state *cached_state = NULL;
3677 u64 start = ((u64)page->index << PAGE_CACHE_SHIFT); 3675 u64 start = page_offset(page);
3678 u64 end = start + PAGE_CACHE_SIZE - 1; 3676 u64 end = start + PAGE_CACHE_SIZE - 1;
3679 size_t blocksize = page->mapping->host->i_sb->s_blocksize; 3677 size_t blocksize = page->mapping->host->i_sb->s_blocksize;
3680 3678
@@ -3700,7 +3698,7 @@ int try_release_extent_state(struct extent_map_tree *map,
3700 struct extent_io_tree *tree, struct page *page, 3698 struct extent_io_tree *tree, struct page *page,
3701 gfp_t mask) 3699 gfp_t mask)
3702{ 3700{
3703 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 3701 u64 start = page_offset(page);
3704 u64 end = start + PAGE_CACHE_SIZE - 1; 3702 u64 end = start + PAGE_CACHE_SIZE - 1;
3705 int ret = 1; 3703 int ret = 1;
3706 3704
@@ -3739,7 +3737,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
3739 gfp_t mask) 3737 gfp_t mask)
3740{ 3738{
3741 struct extent_map *em; 3739 struct extent_map *em;
3742 u64 start = (u64)page->index << PAGE_CACHE_SHIFT; 3740 u64 start = page_offset(page);
3743 u64 end = start + PAGE_CACHE_SIZE - 1; 3741 u64 end = start + PAGE_CACHE_SIZE - 1;
3744 3742
3745 if ((mask & __GFP_WAIT) && 3743 if ((mask & __GFP_WAIT) &&
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1ea0988b82e1..35d152444932 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2062,7 +2062,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
2062static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, 2062static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
2063 struct extent_state *state, int mirror) 2063 struct extent_state *state, int mirror)
2064{ 2064{
2065 size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); 2065 size_t offset = start - page_offset(page);
2066 struct inode *inode = page->mapping->host; 2066 struct inode *inode = page->mapping->host;
2067 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; 2067 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
2068 char *kaddr; 2068 char *kaddr;
@@ -6752,8 +6752,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset)
6752 return; 6752 return;
6753 } 6753 }
6754 lock_extent_bits(tree, page_start, page_end, 0, &cached_state); 6754 lock_extent_bits(tree, page_start, page_end, 0, &cached_state);
6755 ordered = btrfs_lookup_ordered_extent(inode, 6755 ordered = btrfs_lookup_ordered_extent(inode, page_offset(page));
6756 page_offset(page));
6757 if (ordered) { 6756 if (ordered) {
6758 /* 6757 /*
6759 * IO on this page will never be started, so we need 6758 * IO on this page will never be started, so we need
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 300e09ac3659..ba5a3210da9a 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3017,7 +3017,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
3017 } 3017 }
3018 } 3018 }
3019 3019
3020 page_start = (u64)page->index << PAGE_CACHE_SHIFT; 3020 page_start = page_offset(page);
3021 page_end = page_start + PAGE_CACHE_SIZE - 1; 3021 page_end = page_start + PAGE_CACHE_SIZE - 1;
3022 3022
3023 lock_extent(&BTRFS_I(inode)->io_tree, page_start, page_end); 3023 lock_extent(&BTRFS_I(inode)->io_tree, page_start, page_end);