+2005-12-02 Martin Hunt <hunt@redhat.com>
+
+ * 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 <hunt@redhat.com>
* transport.h (STP_WORK_TIMER): Declare.
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;
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;
/* 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;
err2:
list_for_each_safe(p, tmp, &_stp_pool_q) {
list_del(p);
- vfree(p);
+ kfree(p);
}
err1:
/* 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);
}
}