From 1e665ba9d06c7eae745416c6d04b78adae37f7c0 Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 2 Dec 2005 17:41:56 +0000 Subject: [PATCH] 2005-12-02 Martin Hunt * procfs.c (_stp_set_buffers): kmalloc the buffers instead of vmalloc. (_stp_register_procfs): Ditto. (_stp_unregister_procfs): kfree the buffers. --- runtime/transport/ChangeLog | 7 +++++++ runtime/transport/procfs.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index 4353fb934..677a22ab9 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,3 +1,10 @@ +2005-12-02 Martin Hunt + + * procfs.c (_stp_set_buffers): kmalloc the buffers instead + of vmalloc. + (_stp_register_procfs): Ditto. + (_stp_unregister_procfs): kfree the buffers. + 2005-11-30 Martin Hunt * transport.h (STP_WORK_TIMER): Declare. diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c index 7db6e6582..7818c4913 100644 --- a/runtime/transport/procfs.c +++ b/runtime/transport/procfs.c @@ -237,7 +237,7 @@ static int _stp_set_buffers(int num) spin_lock(&_stp_pool_lock); if (num > _stp_current_buffers) { for (i = 0; i < num - _stp_current_buffers; i++) { - p = (struct list_head *)vmalloc(sizeof(struct _stp_buffer)); + p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),GFP_KERNEL); if (!p) { _stp_current_buffers += i; goto err; @@ -248,7 +248,7 @@ static int _stp_set_buffers(int num) for (i = 0; i < _stp_current_buffers - num; i++) { p = _stp_pool_q.next; list_del(p); - vfree(p); + kfree(p); } } _stp_current_buffers = num; @@ -273,7 +273,7 @@ static int _stp_register_procfs (void) /* allocate buffers */ for (i = 0; i < STP_DEFAULT_BUFFERS; i++) { - p = (struct list_head *)vmalloc(sizeof(struct _stp_buffer)); + p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),GFP_KERNEL); // printk("allocated buffer at %lx\n", (long)p); if (!p) goto err2; @@ -328,7 +328,7 @@ static int _stp_register_procfs (void) err2: list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - vfree(p); + kfree(p); } err1: @@ -372,11 +372,11 @@ static void _stp_unregister_procfs (void) /* free memory pools */ list_for_each_safe(p, tmp, &_stp_pool_q) { list_del(p); - vfree(p); + kfree(p); } list_for_each_safe(p, tmp, &_stp_ready_q) { list_del(p); - vfree(p); + kfree(p); } } -- 2.43.5