Lines Matching refs:ctx

49 	struct ww_acquire_ctx *ctx;
102 lock->ctx = NULL;
110 * @ctx: w/w acquire context to initialize
132 static inline void ww_acquire_init(struct ww_acquire_ctx *ctx,
135 ctx->task = current;
136 ctx->stamp = atomic_long_inc_return_relaxed(&ww_class->stamp);
137 ctx->acquired = 0;
138 ctx->wounded = false;
139 ctx->is_wait_die = ww_class->is_wait_die;
141 ctx->ww_class = ww_class;
142 ctx->done_acquire = 0;
143 ctx->contending_lock = NULL;
146 debug_check_no_locks_freed((void *)ctx, sizeof(*ctx));
147 lockdep_init_map(&ctx->dep_map, ww_class->acquire_name,
149 mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_);
152 ctx->deadlock_inject_interval = 1;
153 ctx->deadlock_inject_countdown = ctx->stamp & 0xf;
159 * @ctx: the acquire context
168 static inline void ww_acquire_done(struct ww_acquire_ctx *ctx)
171 lockdep_assert_held(ctx);
173 DEBUG_LOCKS_WARN_ON(ctx->done_acquire);
174 ctx->done_acquire = 1;
180 * @ctx: the acquire context to free
185 static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
188 mutex_release(&ctx->dep_map, _THIS_IP_);
191 DEBUG_LOCKS_WARN_ON(ctx->acquired);
197 ctx->done_acquire = 1;
201 ctx->acquired = ~0U;
208 * @ctx: w/w acquire context, or NULL to acquire only a single lock.
234 extern int /* __must_check */ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx);
239 * @ctx: w/w acquire context
267 struct ww_acquire_ctx *ctx);
272 * @ctx: w/w acquire context
293 ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
297 DEBUG_LOCKS_WARN_ON(!ctx->contending_lock);
299 ret = ww_mutex_lock(lock, ctx);
306 * @ctx: w/w acquire context
330 struct ww_acquire_ctx *ctx)
333 DEBUG_LOCKS_WARN_ON(!ctx->contending_lock);
335 return ww_mutex_lock_interruptible(lock, ctx);
341 struct ww_acquire_ctx *ctx);