From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@open-mesh.net>
Subject: Re: [B.A.T.M.A.N.] [PATCH] Sync hash implementation of batgat and batman-adv
Date: Thu, 25 Sep 2008 23:42:34 +0200 [thread overview]
Message-ID: <200809252342.38150.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <20080925191508.GA8854@sven-desktop.lazhur.ath.cx>
[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]
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);
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-09-25 21:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-25 19:15 [B.A.T.M.A.N.] [PATCH] Sync hash implementation of batgat and batman-adv Sven Eckelmann
2008-09-25 21:42 ` Sven Eckelmann [this message]
2008-09-26 16:03 ` Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809252342.38150.sven.eckelmann@gmx.de \
--to=sven.eckelmann@gmx.de \
--cc=b.a.t.m.a.n@open-mesh.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox