Btrfs: factor page private preparations into a helper

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 88b3ef2..0df325f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -652,12 +652,7 @@
 	u64 page_start = page->index << PAGE_CACHE_SHIFT;
 	u64 page_end = page_start + PAGE_CACHE_SIZE - 1;
 
-	if (!PagePrivate(page)) {
-		SetPagePrivate(page);
-		set_page_private(page, 1);
-		WARN_ON(!page->mapping->a_ops->invalidatepage);
-		page_cache_get(page);
-	}
+	set_page_extent_mapped(page);
 
 	lock_extent(em_tree, page_start, page_end, GFP_NOFS);
 	set_extent_delalloc(&BTRFS_I(inode)->extent_tree, page_start,