On Thursday 25 September 2008 21:15:08 Sven Eckelmann wrote:
The compare functions had a different interpretation of its return value and kmalloc can sleep inside batgat because we are running in user context of kernel.
This patch can ignored if not wanted. It is just a copy of batman-adv- kernelland/batman-core/hash.c to batman/linux/modules/hash.c so they have nearly the same implementations. The only difference should now that the one in batman-adv-kernelland uses GFP_ATOMIC in kmallocs and the one in batgat uses GFP_KERNEL. Most changes are coding style changes and a different interpretation of the return value of the compare functions.
Sven
Current differences: diff batman/linux/modules/hash.c batman-adv-kernelland/batman-core/hash.c 24,25c24 < #include <linux/string.h> /* strlen, strstr, strncmp ... */ < #include <linux/slab.h> ---
#include "main.h"
80c79 < iter = kmalloc(sizeof(struct hash_it_t), GFP_KERNEL); ---
iter = kmalloc(sizeof(struct hash_it_t), GFP_ATOMIC);
148c147 < hash = kmalloc(sizeof(struct hashtable_t) , GFP_KERNEL); ---
hash = kmalloc(sizeof(struct hashtable_t) , GFP_ATOMIC);
154c153 < hash->table = kmalloc(sizeof(struct element_t *) * size, GFP_KERNEL); ---
hash->table = kmalloc(sizeof(struct element_t *) * size, GFP_ATOMIC);
187c186 < bucket = kmalloc(sizeof(struct element_t),GFP_KERNEL); ---
bucket = kmalloc(sizeof(struct element_t),GFP_ATOMIC);