From patchwork Thu Feb 3 14:43:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 750 Return-Path: X-Greylist: delayed 327 seconds by postgrey-1.31 at open-mesh; Thu, 03 Feb 2011 15:46:31 CET Received: from ascomax.hasler.ascom.ch (ascomax.hasler.ascom.ch [139.79.135.1]) by open-mesh.org (Postfix) with ESMTPS id 4A21315409F for ; Thu, 3 Feb 2011 15:46:31 +0100 (CET) Received: from eiger.ma.tech.ascom.ch (eiger.ma.tech.ascom.ch [139.79.100.1]) by ascomax.hasler.ascom.ch (8.14.4/8.14.4) with ESMTP id p13EhaTm028482; Thu, 3 Feb 2011 15:43:36 +0100 (MET) Received: from [139.79.100.249] (helo=localhost) by eiger.ma.tech.ascom.ch with esmtp (Exim 3.16 #1) id 1Pl0PG-0004GQ-00; Thu, 03 Feb 2011 15:43:34 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 3 Feb 2011 15:43:20 +0100 Message-Id: <1296744201-11542-2-git-send-email-linus.luessing@ascom.ch> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1296668238-19323-1-git-send-email-linus.luessing@ascom.ch> References: <1296668238-19323-1-git-send-email-linus.luessing@ascom.ch> MIME-Version: 1.0 Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: add __rcu annotations for gw_node X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 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: Thu, 03 Feb 2011 14:46:31 -0000 Add __rcu annotations for rcu protected pointers in the gateway code to allow sparse checking. Signed-off-by: Linus Lüssing --- compat.h | 6 ++++++ types.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/batman-adv/compat.h b/batman-adv/compat.h index a76d0be..4e89049 100644 --- a/batman-adv/compat.h +++ b/batman-adv/compat.h @@ -270,4 +270,10 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...); #endif /* < KERNEL_VERSION(2, 6, 33) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) + +#define __rcu + +#endif /* < KERNEL_VERSION(2, 6, 36) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */ diff --git a/batman-adv/types.h b/batman-adv/types.h index 30d10c0..2cb0c31 100644 --- a/batman-adv/types.h +++ b/batman-adv/types.h @@ -98,7 +98,7 @@ struct orig_node { struct gw_node { struct hlist_node list; - struct orig_node *orig_node; + struct orig_node __rcu *orig_node; /* rcu protected pointer */ unsigned long deleted; atomic_t refcount; struct rcu_head rcu; @@ -172,7 +172,7 @@ struct bat_priv { struct delayed_work hna_work; struct delayed_work orig_work; struct delayed_work vis_work; - struct gw_node *curr_gw; + struct gw_node __rcu *curr_gw; /* rcu protected pointer */ struct vis_info *my_vis_info; };