diff options
Diffstat (limited to 'include/linux/lockdep.h')
-rw-r--r-- | include/linux/lockdep.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index d36619ead3ba..00e46376e28f 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -157,6 +157,24 @@ struct lockdep_map { | |||
157 | #endif | 157 | #endif |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static inline void lockdep_copy_map(struct lockdep_map *to, | ||
161 | struct lockdep_map *from) | ||
162 | { | ||
163 | int i; | ||
164 | |||
165 | *to = *from; | ||
166 | /* | ||
167 | * Since the class cache can be modified concurrently we could observe | ||
168 | * half pointers (64bit arch using 32bit copy insns). Therefore clear | ||
169 | * the caches and take the performance hit. | ||
170 | * | ||
171 | * XXX it doesn't work well with lockdep_set_class_and_subclass(), since | ||
172 | * that relies on cache abuse. | ||
173 | */ | ||
174 | for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++) | ||
175 | to->class_cache[i] = NULL; | ||
176 | } | ||
177 | |||
160 | /* | 178 | /* |
161 | * Every lock has a list of other locks that were taken after it. | 179 | * Every lock has a list of other locks that were taken after it. |
162 | * We only grow the list, never remove from it: | 180 | * We only grow the list, never remove from it: |