From patchwork Wed May 4 19:11:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 1017 Return-Path: Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 17029154214 for ; Wed, 4 May 2011 21:11:16 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@narfation.org; dkim-adsp=pass Received: from sven-desktop.home.narfation.org (i59F6AC4E.versanet.de [89.246.172.78]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id BB17C940D7; Wed, 4 May 2011 21:11:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=mail; t=1304536289; bh=Dtw9aV9AbstbiSkKR9IA+C7OJt+8J6QXNMmO4b8CNdE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=MNvdhnIGOtEJinYE9cF8gyQWsmbVfVidev1HVMbtC2wjCtGIHWQ99Xy4mZWZRJyiP aZMgxBgq76x2+kxd4djv8o8/LsoqgPDah6ULVmz/YOjx5LtkBH3ffDA5gfaAHaY/yI 0S04uAAErfOTHG38Cpj4ym+uLSpaGzSfJ1CAqqw0= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 4 May 2011 21:11:06 +0200 Message-Id: <1304536266-21116-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <201105041351.35006.lindner_marek@yahoo.de> References: <201105041351.35006.lindner_marek@yahoo.de> Subject: [B.A.T.M.A.N.] [PATCH-Marek 2/5] batman-adv: Add compatibility code for kfree_rcu X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 19:11:16 -0000 Signed-off-by: Sven Eckelmann --- compat.c | 30 +++++++++++++++++++++++++++++- compat.h | 10 ++++++++++ 2 files changed, 39 insertions(+), 1 deletions(-) diff --git a/compat.c b/compat.c index f4561c3..67c5126 100644 --- a/compat.c +++ b/compat.c @@ -1,4 +1,4 @@ -#include +#include "main.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) @@ -959,3 +959,31 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...) } #endif /* < KERNEL_VERSION(2, 6, 29) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 1234) + +void free_rcu_gw_node(struct rcu_head *rcu) +{ + struct gw_node *gw_node; + + gw_node = container_of(rcu, struct gw_node, rcu); + kfree(gw_node); +} + +void free_rcu_neigh_node(struct rcu_head *rcu) +{ + struct neigh_node *neigh_node; + + neigh_node = container_of(rcu, struct neigh_node, rcu); + kfree(neigh_node); +} + +void free_rcu_softif_neigh(struct rcu_head *rcu) +{ + struct softif_neigh *softif_neigh; + + softif_neigh = container_of(rcu, struct softif_neigh, rcu); + kfree(softif_neigh); +} + +#endif /* < KERNEL_VERSION(2, 6, 1234) */ diff --git a/compat.h b/compat.h index c3fd2cd..62fd968 100644 --- a/compat.h +++ b/compat.h @@ -291,4 +291,14 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...); #endif /* < KERNEL_VERSION(2, 6, 36) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 1234) + +#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, free_rcu_##ptr) + +void free_rcu_gw_node(struct rcu_head *rcu); +void free_rcu_neigh_node(struct rcu_head *rcu); +void free_rcu_softif_neigh(struct rcu_head *rcu); + +#endif /* < KERNEL_VERSION(2, 6, 1234) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */