 buffer.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)

diff -puN fs/buffer.c~remove-buffer_head_mempool fs/buffer.c
--- 25/fs/buffer.c~remove-buffer_head_mempool	2003-02-09 19:36:12.000000000 -0800
+++ 25-akpm/fs/buffer.c	2003-02-09 19:39:30.000000000 -0800
@@ -31,7 +31,6 @@
 #include <linux/highmem.h>
 #include <linux/module.h>
 #include <linux/writeback.h>
-#include <linux/mempool.h>
 #include <linux/hash.h>
 #include <linux/suspend.h>
 #include <linux/buffer_head.h>
@@ -2794,7 +2793,6 @@ asmlinkage long sys_bdflush(int func, lo
  * Buffer-head allocation
  */
 static kmem_cache_t *bh_cachep;
-static mempool_t *bh_mempool;
 
 /*
  * Once the number of bh's in the machine exceeds this level, we start
@@ -2828,7 +2826,7 @@ static void recalc_bh_state(void)
 	
 struct buffer_head *alloc_buffer_head(void)
 {
-	struct buffer_head *ret = mempool_alloc(bh_mempool, GFP_NOFS);
+	struct buffer_head *ret = kmem_cache_alloc(bh_cachep, GFP_NOFS);
 	if (ret) {
 		preempt_disable();
 		__get_cpu_var(bh_accounting).nr++;
@@ -2842,7 +2840,7 @@ EXPORT_SYMBOL(alloc_buffer_head);
 void free_buffer_head(struct buffer_head *bh)
 {
 	BUG_ON(!list_empty(&bh->b_assoc_buffers));
-	mempool_free(bh, bh_mempool);
+	kmem_cache_free(bh_cachep, bh);
 	preempt_disable();
 	__get_cpu_var(bh_accounting).nr--;
 	recalc_bh_state();
@@ -2850,7 +2848,8 @@ void free_buffer_head(struct buffer_head
 }
 EXPORT_SYMBOL(free_buffer_head);
 
-static void init_buffer_head(void *data, kmem_cache_t *cachep, unsigned long flags)
+static void
+init_buffer_head(void *data, kmem_cache_t *cachep, unsigned long flags)
 {
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 			    SLAB_CTOR_CONSTRUCTOR) {
@@ -2861,19 +2860,6 @@ static void init_buffer_head(void *data,
 	}
 }
 
-static void *bh_mempool_alloc(int gfp_mask, void *pool_data)
-{
-	return kmem_cache_alloc(bh_cachep, gfp_mask);
-}
-
-static void bh_mempool_free(void *element, void *pool_data)
-{
-	return kmem_cache_free(bh_cachep, element);
-}
-
-#define NR_RESERVED (10*MAX_BUF_PER_PAGE)
-#define MAX_UNUSED_BUFFERS NR_RESERVED+20
-
 static void buffer_init_cpu(int cpu)
 {
 	struct bh_accounting *bha = &per_cpu(bh_accounting, cpu);
@@ -2910,8 +2896,6 @@ void __init buffer_init(void)
 	bh_cachep = kmem_cache_create("buffer_head",
 			sizeof(struct buffer_head), 0,
 			0, init_buffer_head, NULL);
-	bh_mempool = mempool_create(MAX_UNUSED_BUFFERS, bh_mempool_alloc,
-				bh_mempool_free, NULL);
 	for (i = 0; i < ARRAY_SIZE(bh_wait_queue_heads); i++)
 		init_waitqueue_head(&bh_wait_queue_heads[i].wqh);
 

_
