@@ -49,6 +49,13 @@ static inline void complete_release_commit(struct completion *x)
49
49
lock_commit_crosslock ((struct lockdep_map * )& x -> map );
50
50
}
51
51
52
+ #define init_completion_map (x , m ) \
53
+ do { \
54
+ lockdep_init_map_crosslock((struct lockdep_map *)&(x)->map, \
55
+ (m)->name, (m)->key, 0); \
56
+ __init_completion(x); \
57
+ } while (0)
58
+
52
59
#define init_completion (x ) \
53
60
do { \
54
61
static struct lock_class_key __key; \
58
65
__init_completion(x); \
59
66
} while (0)
60
67
#else
68
+ #define init_completion_map (x , m ) __init_completion(x)
61
69
#define init_completion (x ) __init_completion(x)
62
70
static inline void complete_acquire (struct completion * x ) {}
63
71
static inline void complete_release (struct completion * x ) {}
@@ -73,6 +81,9 @@ static inline void complete_release_commit(struct completion *x) {}
73
81
{ 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
74
82
#endif
75
83
84
+ #define COMPLETION_INITIALIZER_ONSTACK_MAP (work , map ) \
85
+ (*({ init_completion_map(&(work), &(map)); &(work); }))
86
+
76
87
#define COMPLETION_INITIALIZER_ONSTACK (work ) \
77
88
(*({ init_completion(&work); &work; }))
78
89
@@ -102,8 +113,11 @@ static inline void complete_release_commit(struct completion *x) {}
102
113
#ifdef CONFIG_LOCKDEP
103
114
# define DECLARE_COMPLETION_ONSTACK (work ) \
104
115
struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
116
+ # define DECLARE_COMPLETION_ONSTACK_MAP (work , map ) \
117
+ struct completion work = COMPLETION_INITIALIZER_ONSTACK_MAP(work, map)
105
118
#else
106
119
# define DECLARE_COMPLETION_ONSTACK (work ) DECLARE_COMPLETION(work)
120
+ # define DECLARE_COMPLETION_ONSTACK_MAP (work , map ) DECLARE_COMPLETION(work)
107
121
#endif
108
122
109
123
/**
0 commit comments