summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorMiao Xie2012-12-21 10:17:45 +0100
committerJosef Bacik2013-02-20 15:36:43 +0100
commit4eee4fa4f8ab8c2b2623c22be4c3cb91d525aa57 (patch)
tree683eda1d306b23d1a82a918d869850256237c432 /fs/btrfs/inode.c
parentBtrfs: flush all dirty inodes if writeback can not start (diff)
downloadkernel-qcow2-linux-4eee4fa4f8ab8c2b2623c22be4c3cb91d525aa57.tar.gz
kernel-qcow2-linux-4eee4fa4f8ab8c2b2623c22be4c3cb91d525aa57.tar.xz
kernel-qcow2-linux-4eee4fa4f8ab8c2b2623c22be4c3cb91d525aa57.zip
Btrfs: use wrapper page_offset
Use wrapper page_offset to get byte-offset into filesystem object for page. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 2 insertions, 3 deletions
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,
static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
struct extent_state *state, int mirror)
{
- size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT);
+ size_t offset = start - page_offset(page);
struct inode *inode = page->mapping->host;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
char *kaddr;
@@ -6752,8 +6752,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset)
return;
}
lock_extent_bits(tree, page_start, page_end, 0, &cached_state);
- ordered = btrfs_lookup_ordered_extent(inode,
- page_offset(page));
+ ordered = btrfs_lookup_ordered_extent(inode, page_offset(page));
if (ordered) {
/*
* IO on this page will never be started, so we need