compat: backport of lock_map_acquire_read()
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 13 Feb 2013 19:50:02 +0000 (20:50 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 13 Feb 2013 19:56:56 +0000 (20:56 +0100)
This is a backport of:

commit e159489baa717dbae70f9903770a6a4990865887
Author: Tejun Heo <tj@kernel.org>
Date:   Sun Jan 9 23:32:15 2011 +0100

    workqueue: relax lockdep annotation on flush_work()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.38.h

index 8dfeed63773bd892f93734b2d25d30019c424dec..e936c42780e9bbc322ffb8605efb9283bf3ebaeb 100644 (file)
@@ -174,6 +174,24 @@ extern int __build_bug_on_failed;
        } while(0)
 #endif
 
+/* Backport of:
+ *
+ * commit e159489baa717dbae70f9903770a6a4990865887
+ * Author: Tejun Heo <tj@kernel.org>
+ * Date:   Sun Jan 9 23:32:15 2011 +0100
+ *
+ *     workqueue: relax lockdep annotation on flush_work()
+ */
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define lock_map_acquire_read(l)     lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
+# else
+#  define lock_map_acquire_read(l)     lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
+# endif
+#else
+# define lock_map_acquire_read(l)              do { } while (0)
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */
 
 #endif /* LINUX_26_38_COMPAT_H */