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

Next file: linux/include/linux/smb_fs.h
Previous file: linux/include/linux/ncp_mount.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.52/linux/include/linux/pagemap.h linux/include/linux/pagemap.h
@@ -13,7 +13,9 @@
 }
 
 #define PAGE_HASH_SIZE 257
+#define PAGE_AGE_VALUE 16
 
+extern unsigned long page_cache_size;
 extern struct page * page_hash_table[PAGE_HASH_SIZE];
 
 static inline unsigned long _page_hashfn(struct inode * inode, unsigned long offset)
@@ -33,6 +35,7 @@
 			continue;
 		if (page->offset != offset)
 			continue;
+		page->age = PAGE_AGE_VALUE | (page->age >> 1);
 		break;
 	}
 	return page;
@@ -42,6 +45,7 @@
 {
 	struct page **p = &page_hash(page->inode,page->offset);
 
+	page_cache_size--;
 	if (page->next_hash)
 		page->next_hash->prev_hash = page->prev_hash;
 	if (page->prev_hash)
@@ -55,6 +59,8 @@
 {
 	struct page **p = &page_hash(inode,page->offset);
 
+	page_cache_size++;
+	page->age = PAGE_AGE_VALUE;
 	page->prev_hash = NULL;
 	if ((page->next_hash = *p) != NULL)
 		page->next_hash->prev_hash = page;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this