summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-15 09:13:45 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit211c17f51f46dc6c308c742098273dd46b5ca59c (patch)
treed72de74136af93236f2b37088ff310f08ddeadf5 /fs/btrfs/file.c
parenta0af469b58944f6e8c5c8ecbebb42997baf0cb9e (diff)
downloadop-kernel-dev-211c17f51f46dc6c308c742098273dd46b5ca59c.zip
op-kernel-dev-211c17f51f46dc6c308c742098273dd46b5ca59c.tar.gz
Fix corners in writepage and btrfs_truncate_page
The extent_io writepage calls needed an extra check for discarding pages that started on th last byte in the file. btrfs_truncate_page needed checks to make sure the page was still part of the file after reading it, and most importantly, needed to wait for all IO to the page to finish before freeing the corresponding extents on disk. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index df97d47..d968900 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -305,7 +305,6 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans,
(inline_size & (root->sectorsize -1)) == 0 ||
inline_size >= BTRFS_MAX_INLINE_DATA_SIZE(root)) {
u64 last_end;
- u64 existing_delalloc = 0;
for (i = 0; i < num_pages; i++) {
struct page *p = pages[i];
@@ -315,13 +314,6 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans,
last_end = (u64)(pages[num_pages -1]->index) <<
PAGE_CACHE_SHIFT;
last_end += PAGE_CACHE_SIZE - 1;
- if (start_pos < isize) {
- u64 delalloc_start = start_pos;
- existing_delalloc = count_range_bits(io_tree,
- &delalloc_start,
- end_of_last_block, (u64)-1,
- EXTENT_DELALLOC);
- }
set_extent_delalloc(io_tree, start_pos, end_of_last_block,
GFP_NOFS);
btrfs_add_ordered_inode(inode);
OpenPOWER on IntegriCloud