patch-2.4.0-test5 linux/fs/buffer.c

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

diff -u --recursive --new-file v2.4.0-test4/linux/fs/buffer.c linux/fs/buffer.c
@@ -92,8 +92,6 @@
 };
 static struct bh_free_head free_list[NR_SIZES];
 
-kmem_cache_t *bh_cachep;
-
 static int grow_buffers(int size);
 static void __refile_buffer(struct buffer_head *);
 
@@ -708,11 +706,11 @@
 	}
 }
 
-void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *dev_id)
+void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
 {
 	bh->b_list = BUF_CLEAN;
 	bh->b_end_io = handler;
-	bh->b_dev_id = dev_id;
+	bh->b_private = private;
 }
 
 static void end_buffer_io_sync(struct buffer_head *bh, int uptodate)
@@ -1620,9 +1618,9 @@
 						PAGE_CACHE_SIZE, get_block);
 		if (status)
 			goto out_unmap;
-		kaddr = (char*)page_address(page);
+		kaddr = (char*)page_address(new_page);
 		memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
-		__block_commit_write(inode, new_page, zerofrom, to);
+		__block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
 		kunmap(new_page);
 		UnlockPage(new_page);
 		page_cache_release(new_page);
@@ -1742,7 +1740,7 @@
 	
 	mark_buffer_uptodate(bh, uptodate);
 
-	kiobuf = bh->b_kiobuf;
+	kiobuf = bh->b_private;
 	unlock_buffer(bh);
 	end_kio_request(kiobuf, uptodate);
 }
@@ -1862,11 +1860,10 @@
 				set_bh_page(tmp, map, offset);
 				tmp->b_this_page = tmp;
 
-				init_buffer(tmp, end_buffer_io_kiobuf, NULL);
+				init_buffer(tmp, end_buffer_io_kiobuf, iobuf);
 				tmp->b_dev = dev;
 				tmp->b_blocknr = blocknr;
 				tmp->b_state = 1 << BH_Mapped;
-				tmp->b_kiobuf = iobuf;
 
 				if (rw == WRITE) {
 					set_bit(BH_Uptodate, &tmp->b_state);
@@ -2303,12 +2300,6 @@
 	for(i = 0; i < NR_LIST; i++)
 		lru_list[i] = NULL;
 
-	bh_cachep = kmem_cache_create("buffer_head",
-				      sizeof(struct buffer_head),
-				      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 (who was at: slshen@lbl.gov)