aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/extent_io.c3
-rw-r--r--fs/btrfs/inode.c14
2 files changed, 11 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index feff16cb9b40..3153b4fdd0b3 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2542,7 +2542,8 @@ int try_release_extent_state(struct extent_map_tree *map,
2542 u64 end = start + PAGE_CACHE_SIZE - 1; 2542 u64 end = start + PAGE_CACHE_SIZE - 1;
2543 int ret = 1; 2543 int ret = 1;
2544 2544
2545 if (test_range_bit(tree, start, end, EXTENT_IOBITS, 0)) 2545 if (test_range_bit(tree, start, end,
2546 EXTENT_IOBITS | EXTENT_ORDERED, 0))
2546 ret = 0; 2547 ret = 0;
2547 else { 2548 else {
2548 if ((mask & GFP_NOFS) == GFP_NOFS) 2549 if ((mask & GFP_NOFS) == GFP_NOFS)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4d729d90d2b8..8803abc89bb8 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -477,10 +477,8 @@ printk("queueing worker to fixup page %lu %Lu\n", inode->i_ino, page_offset(page
477 return -EAGAIN; 477 return -EAGAIN;
478} 478}
479 479
480int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, 480static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
481 struct extent_state *state, int uptodate)
482{ 481{
483 struct inode *inode = page->mapping->host;
484 struct btrfs_root *root = BTRFS_I(inode)->root; 482 struct btrfs_root *root = BTRFS_I(inode)->root;
485 struct btrfs_trans_handle *trans; 483 struct btrfs_trans_handle *trans;
486 struct btrfs_ordered_extent *ordered_extent; 484 struct btrfs_ordered_extent *ordered_extent;
@@ -550,6 +548,12 @@ int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
550 return 0; 548 return 0;
551} 549}
552 550
551int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
552 struct extent_state *state, int uptodate)
553{
554 return btrfs_finish_ordered_io(page->mapping->host, start, end);
555}
556
553int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end) 557int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
554{ 558{
555 int ret = 0; 559 int ret = 0;
@@ -2663,8 +2667,8 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset)
2663 clear_extent_bit(tree, page_start, page_end, 2667 clear_extent_bit(tree, page_start, page_end,
2664 EXTENT_DIRTY | EXTENT_DELALLOC | 2668 EXTENT_DIRTY | EXTENT_DELALLOC |
2665 EXTENT_LOCKED, 1, 0, GFP_NOFS); 2669 EXTENT_LOCKED, 1, 0, GFP_NOFS);
2666 btrfs_writepage_end_io_hook(page, page_start, 2670 btrfs_finish_ordered_io(page->mapping->host,
2667 page_end, NULL, 1); 2671 page_start, page_end);
2668 btrfs_put_ordered_extent(ordered); 2672 btrfs_put_ordered_extent(ordered);
2669 lock_extent(tree, page_start, page_end, GFP_NOFS); 2673 lock_extent(tree, page_start, page_end, GFP_NOFS);
2670 } 2674 }