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>
This commit is contained in:
Christoph Hellwig 2007-09-17 11:25:58 -04:00 committed by Chris Mason
parent 8e1cd76664
commit b3cfa35a49
4 changed files with 18 additions and 37 deletions

View file

@ -652,12 +652,7 @@ static int btrfs_cow_one_page(struct inode *inode, struct page *page,
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,