patch-2.1.38 linux/fs/buffer.c

Next file: linux/fs/exec.c
Previous file: linux/fs/binfmt_elf.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.37/linux/fs/buffer.c linux/fs/buffer.c
@@ -612,8 +612,7 @@
 	    buffer_locked(bh))
 		return 0;
 			 
-	if (atomic_read(&mem_map[MAP_NR((unsigned long) bh->b_data)].count) != 1 ||
-	    buffer_dirty(bh)) {
+	if (buffer_dirty(bh)) {
 		refile_buffer(bh);
 		return 0;
 	}
@@ -644,8 +643,7 @@
 			continue;
 		}
 
-		if (buffer_locked(bh) && 
-		    (bh->b_list == BUF_LOCKED || bh->b_list == BUF_LOCKED1)) {
+		if (buffer_locked(bh) && bh->b_list == BUF_LOCKED) {
 			/* Buffers are written in the order they are placed 
 			 * on the locked list. If we encounter a locked
 			 * buffer here, this means that the rest of them
@@ -845,9 +843,6 @@
 	if(dispose != buf->b_list) {
 		if(dispose == BUF_DIRTY)
 			 buf->b_lru_time = jiffies;
-		if(dispose == BUF_LOCKED && 
-		   (buf->b_flushtime - buf->b_lru_time) <= bdf_prm.b_un.age_super)
-			 dispose = BUF_LOCKED1;
 		remove_from_queues(buf);
 		buf->b_list = dispose;
 		insert_into_queues(buf);
@@ -1467,7 +1462,7 @@
 	buffermem -= PAGE_SIZE;
 	mem_map[MAP_NR(page)].buffers = NULL;
 	free_page(page);
-	return !atomic_read(&mem_map[MAP_NR(page)].count);
+	return 1;
 }
 
 /* ================== Debugging =================== */
@@ -1478,7 +1473,7 @@
 	int found = 0, locked = 0, dirty = 0, used = 0, lastused = 0;
 	int protected = 0;
 	int nlist;
-	static char *buf_types[NR_LIST] = {"CLEAN","LOCKED","LOCKED1","DIRTY"};
+	static char *buf_types[NR_LIST] = {"CLEAN","LOCKED","DIRTY"};
 
 	printk("Buffer memory:   %6dkB\n",buffermem>>10);
 	printk("Buffer heads:    %6d\n",nr_buffer_heads);
@@ -1526,7 +1521,7 @@
 
 	bh_cachep = kmem_cache_create("buffer_head",
 				      sizeof(struct buffer_head),
-				      sizeof(unsigned long) * 4,
+				      0,
 				      SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if(!bh_cachep)
 		panic("Cannot create buffer head SLAB cache\n");

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