From 129f8758d8c41e0378ace0b6e2f56bbb8a1ec694 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:27:58 -0500 Subject: [PATCH] Import 2.3.23 --- mm/filemap.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 6fdd065a7fad..7451f46d949c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -106,26 +106,21 @@ repeat: while (curr != head) { page = list_entry(curr, struct page, list); curr = curr->next; - get_page(page); - if (TryLockPage(page)) { - spin_unlock(&pagecache_lock); - wait_on_page(page); - page_cache_release(page); - goto repeat; - } - if (page_count(page) != 2) - printk("hm, busy page invalidated? (not necessarily a bug)\n"); + + /* We cannot invalidate a locked page */ + if (PageLocked(page)) + continue; + lru_cache_del(page); remove_page_from_inode_queue(page); remove_page_from_hash_queue(page); page->inode = NULL; - UnlockPage(page); - page_cache_release(page); page_cache_release(page); } spin_unlock(&pagecache_lock); } + /* * Truncate the page cache at a set offset, removing the pages * that are beyond that offset (and zeroing out partial pages). -- 2.39.5