[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1284584835.2462.69.camel@edumazet-laptop>
Date: Wed, 15 Sep 2010 23:07:15 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>
Subject: [PATCH net-next-2.6 1/3] net: add rtnl_dereference()
We sometime want to dereference an rcu protected pointer while
holding RTNL. Use a macro to hide all lockdep details.
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
---
include/linux/rtnetlink.h | 9 +++++++++
1 files changed, 9 insertions(+)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 263690d..68c436b 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -760,6 +760,15 @@ extern int lockdep_rtnl_is_held(void);
rcu_dereference_check(p, rcu_read_lock_held() || \
lockdep_rtnl_is_held())
+/**
+ * rtnl_dereference - rcu_dereference with debug checking
+ * @p: The pointer to read, prior to dereferencing
+ *
+ * Do an rcu_dereference(p), but check caller holds RTNL
+ */
+#define rtnl_dereference(p) \
+ rcu_dereference_check(p, lockdep_rtnl_is_held())
+
extern void rtnetlink_init(void);
extern void __rtnl_unlock(void);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists