[DRBD-cvs] svn commit by phil - r2912 - trunk/drbd - The cache preheating now correctly drops the bios refer

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Sun Jun 3 15:24:27 CEST 2007


Author: phil
Date: 2007-06-03 15:24:26 +0200 (Sun, 03 Jun 2007)
New Revision: 2912

Modified:
   trunk/drbd/drbd_receiver.c
Log:
The cache preheating now correctly drops the bios reference to
the page that was handed over to the page-cache.


Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2007-06-01 14:16:47 UTC (rev 2911)
+++ trunk/drbd/drbd_receiver.c	2007-06-03 13:24:26 UTC (rev 2912)
@@ -1210,15 +1210,13 @@
 	index = sector >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
 	whole_page = bvec->bv_offset==0 && bvec->bv_len==PAGE_CACHE_SIZE;
 	npage = bvec->bv_page;
-		
+
 	write_lock_irq(&mapping->tree_lock);
 	ppage = (struct page **)radix_tree_lookup_slot(&mapping->page_tree, index);
 	if(ppage && *ppage) {
 		if( whole_page ) {
-			struct address_space *before;
 			tp = *ppage;
 
-			before = tp->mapping;
 			zone = page_zone(tp);
 			spin_lock(&zone->lru_lock);
 			if (PageLRU(tp)) {
@@ -1258,11 +1256,13 @@
 				D_ASSERT(!PageLRU(npage));
 				clear_bit(PG_lru, &(npage)->flags);
 				bvec->bv_page = tp;
+				put_page(npage); // pache cache has only ref.
 			} else {
 				__free_page(tp);
 			}
 		}
 	}
+	WARN_ON(irqs_disabled());
 }
 
 



More information about the drbd-cvs mailing list