mtd/drivers/mtd/devices block2mtd.c,1.25,1.26

gleixner at infradead.org gleixner at infradead.org
Thu Mar 17 14:48:22 EST 2005


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv26157

Modified Files:
	block2mtd.c 
Log Message:
Merge from mainstream.

[PATCH] make mapping->tree_lock an rwlock

Convert mapping->tree_lock to an rwlock.

Replaced some printk() by INFO().



Index: block2mtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/block2mtd.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- block2mtd.c	7 Mar 2005 20:29:05 -0000	1.25
+++ block2mtd.c	17 Mar 2005 19:48:19 -0000	1.26
@@ -52,17 +52,17 @@
 	loff_t isize = i_size_read(inode);
 
 	if (!isize) {
-		printk(KERN_INFO "iSize=0 in cache_readahead\n");
+		INFO("iSize=0 in cache_readahead\n");
 		return;
 	}
 
 	end_index = ((isize - 1) >> PAGE_CACHE_SHIFT);
 
-	spin_lock_irq(&mapping->tree_lock);
+	read_lock_irq(&mapping->tree_lock);
 	for (i = 0; i < PAGE_READAHEAD; i++) {
 		pagei = index + i;
 		if (pagei > end_index) {
-			printk(KERN_INFO "Overrun end of disk in cache readahead\n");
+			INFO("Overrun end of disk in cache readahead\n");
 			break;
 		}
 		page = radix_tree_lookup(&mapping->page_tree, pagei);
@@ -70,16 +70,16 @@
 			break;
 		if (page)
 			continue;
-		spin_unlock_irq(&mapping->tree_lock);
+		read_unlock_irq(&mapping->tree_lock);
 		page = page_cache_alloc_cold(mapping);
-		spin_lock_irq(&mapping->tree_lock);
+		read_lock_irq(&mapping->tree_lock);
 		if (!page)
 			break;
 		page->index = pagei;
 		list_add(&page->lru, &page_pool);
 		ret++;
 	}
-	spin_unlock_irq(&mapping->tree_lock);
+	read_unlock_irq(&mapping->tree_lock);
 	if (ret)
 		read_cache_pages(mapping, &page_pool, filler, NULL);
 }





More information about the linux-mtd-cvs mailing list