diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-17 13:53:27 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | eb84ae039e10f1f80443d846ba1350122bbdc753 (patch) | |
tree | d87bcbead436eaf96f5160ac46f78699d65c5251 /fs/btrfs/inode.c | |
parent | 54641bd17db9fbfc13c7b1d4ee0dd2713bf3e076 (diff) |
Btrfs: Cleanup and comment ordered-data.c
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0d1e2ba47a9c..f37e09e724f7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1343,7 +1343,7 @@ again: | |||
1343 | unlock_extent(io_tree, page_start, page_end, GFP_NOFS); | 1343 | unlock_extent(io_tree, page_start, page_end, GFP_NOFS); |
1344 | unlock_page(page); | 1344 | unlock_page(page); |
1345 | page_cache_release(page); | 1345 | page_cache_release(page); |
1346 | btrfs_wait_ordered_extent(inode, ordered); | 1346 | btrfs_start_ordered_extent(inode, ordered, 1); |
1347 | btrfs_put_ordered_extent(ordered); | 1347 | btrfs_put_ordered_extent(ordered); |
1348 | goto again; | 1348 | goto again; |
1349 | } | 1349 | } |
@@ -2660,6 +2660,10 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset) | |||
2660 | ordered = btrfs_lookup_ordered_extent(page->mapping->host, | 2660 | ordered = btrfs_lookup_ordered_extent(page->mapping->host, |
2661 | page_offset(page)); | 2661 | page_offset(page)); |
2662 | if (ordered) { | 2662 | if (ordered) { |
2663 | /* | ||
2664 | * IO on this page will never be started, so we need | ||
2665 | * to account for any ordered extents now | ||
2666 | */ | ||
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); |
@@ -2732,11 +2736,15 @@ again: | |||
2732 | lock_extent(io_tree, page_start, page_end, GFP_NOFS); | 2736 | lock_extent(io_tree, page_start, page_end, GFP_NOFS); |
2733 | set_page_extent_mapped(page); | 2737 | set_page_extent_mapped(page); |
2734 | 2738 | ||
2739 | /* | ||
2740 | * we can't set the delalloc bits if there are pending ordered | ||
2741 | * extents. Drop our locks and wait for them to finish | ||
2742 | */ | ||
2735 | ordered = btrfs_lookup_ordered_extent(inode, page_start); | 2743 | ordered = btrfs_lookup_ordered_extent(inode, page_start); |
2736 | if (ordered) { | 2744 | if (ordered) { |
2737 | unlock_extent(io_tree, page_start, page_end, GFP_NOFS); | 2745 | unlock_extent(io_tree, page_start, page_end, GFP_NOFS); |
2738 | unlock_page(page); | 2746 | unlock_page(page); |
2739 | btrfs_wait_ordered_extent(inode, ordered); | 2747 | btrfs_start_ordered_extent(inode, ordered, 1); |
2740 | btrfs_put_ordered_extent(ordered); | 2748 | btrfs_put_ordered_extent(ordered); |
2741 | goto again; | 2749 | goto again; |
2742 | } | 2750 | } |