summaryrefslogtreecommitdiff
path: root/linux/dev
diff options
context:
space:
mode:
authorAlfred M. Szmidt <ams@gnu.org>2004-12-01 06:10:11 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:15:26 +0200
commit8f95dc8729437a6546a3777106f64d1c671d8ac3 (patch)
tree806d93a10c23bc2eda42628ba3fcbd29009b8a48 /linux/dev
parent7e2c3175d713af0d7ce14182fc188a24df176d36 (diff)
2004-09-07 Neal H. Walfield <neal@cs.uml.edu>
* linux/dev/glue/block.c (__brelse): Unconditionally kfree BH. (getblk): Unconditionally kalloc BH. * kern/kalloc.c [!NDEBUG] (kalloc_init_called): New static variable. (kalloc_init): Assert that kalloc_init_called is zero. [! NDEBUG] Set kalloc_init_called to 1 on success. (kalloc): Assert that kalloc_init_called is non-zero. (kget): Likewise. (kfree): Likewise.
Diffstat (limited to 'linux/dev')
-rw-r--r--linux/dev/glue/block.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c
index d65acac..5267474 100644
--- a/linux/dev/glue/block.c
+++ b/linux/dev/glue/block.c
@@ -354,22 +354,17 @@ struct buffer_head *
getblk (kdev_t dev, int block, int size)
{
struct buffer_head *bh;
- static struct buffer_head bhead;
assert (size <= PAGE_SIZE);
- if (! linux_auto_config)
- bh = (struct buffer_head *) kalloc (sizeof (struct buffer_head));
- else
- bh = &bhead;
+ bh = (struct buffer_head *) kalloc (sizeof (struct buffer_head));
if (bh)
{
memset (bh, 0, sizeof (struct buffer_head));
bh->b_data = alloc_buffer (size);
if (! bh->b_data)
{
- if (! linux_auto_config)
- kfree ((vm_offset_t) bh, sizeof (struct buffer_head));
+ kfree ((vm_offset_t) bh, sizeof (struct buffer_head));
return NULL;
}
bh->b_dev = dev;
@@ -385,8 +380,7 @@ void
__brelse (struct buffer_head *bh)
{
free_buffer (bh->b_data, bh->b_size);
- if (! linux_auto_config)
- kfree ((vm_offset_t) bh, sizeof (*bh));
+ kfree ((vm_offset_t) bh, sizeof (*bh));
}
/* Allocate a buffer of SIZE bytes and fill it with data