patch-2.0.19 linux/include/linux/pagemap.h

Next file: linux/include/linux/pci.h
Previous file: linux/include/linux/mm.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.18/linux/include/linux/pagemap.h linux/include/linux/pagemap.h
@@ -71,16 +71,21 @@
 
 static inline void remove_page_from_hash_queue(struct page * page)
 {
-	struct page **p = page_hash(page->inode,page->offset);
+	struct page **p;
+	struct page *next_hash, *prev_hash;
 
-	page_cache_size--;
-	if (page->next_hash)
-		page->next_hash->prev_hash = page->prev_hash;
-	if (page->prev_hash)
-		page->prev_hash->next_hash = page->next_hash;
+	next_hash = page->next_hash;
+	prev_hash = page->prev_hash;
+	page->next_hash = NULL;
+	page->prev_hash = NULL;
+	if (next_hash)
+		next_hash->prev_hash = prev_hash;
+	if (prev_hash)
+		prev_hash->next_hash = next_hash;
+	p = page_hash(page->inode,page->offset);
 	if (*p == page)
-		*p = page->next_hash;
-	page->next_hash = page->prev_hash = NULL;
+		*p = next_hash;
+	page_cache_size--;
 }
 
 static inline void __add_page_to_hash_queue(struct page * page, struct page **p)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov