backports: add lockdep_rtnl_is_held() for < 3.13 without CONFIG_PROVE_LOCKING
authorLuca Coelho <luciano.coelho@intel.com>
Wed, 31 May 2017 08:30:10 +0000 (11:30 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2017 12:59:41 +0000 (14:59 +0200)
In kernels earlier than 3.13, lockdep_rtnl_is_held() is only declared
in rtnetlink.h when CONFIG_PROVE_LOCKING is not set.  Backport this
function if that's the case.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/rtnetlink.h

index 9b68be820049fc1eafb2fd108be3fe5930918d9e..59beffa8316ae30cb0ad248bfc23ce8a92abacbd 100644 (file)
        ndo_dflt_fdb_add(ndm, tb, dev, addr, flags)
 #endif
 
+#if LINUX_VERSION_IS_LESS(3,13,0) &&           \
+       !defined(CONFIG_PROVE_LOCKING)
+static inline bool lockdep_rtnl_is_held(void)
+{
+       return true;
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_RTNETLINK_H */