Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33814
b: refs/heads/master
c: 016eb4a
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Sep 8, 2006
1 parent b158e37 commit 6383062
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3665d0e58fa44f50c744f85c7e8ad21d5b10e206
refs/heads/master: 016eb4a0ed06a3677d67a584da901f0e9a63c666
11 changes: 7 additions & 4 deletions trunk/mm/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
return 0;

write_lock_irq(&mapping->tree_lock);
if (PageDirty(page)) {
write_unlock_irq(&mapping->tree_lock);
return 0;
}
if (PageDirty(page))
goto failed;
if (page_count(page) != 2) /* caller's ref + pagecache ref */
goto failed;

BUG_ON(PagePrivate(page));
__remove_from_page_cache(page);
write_unlock_irq(&mapping->tree_lock);
ClearPageUptodate(page);
page_cache_release(page); /* pagecache ref */
return 1;
failed:
write_unlock_irq(&mapping->tree_lock);
return 0;
}

/**
Expand Down

0 comments on commit 6383062

Please sign in to comment.