• Home
  • Raw
  • Download

Lines Matching refs:msg_ctx

51 static int ecryptfs_acquire_free_msg_ctx(struct ecryptfs_msg_ctx **msg_ctx)  in ecryptfs_acquire_free_msg_ctx()  argument
66 *msg_ctx = list_entry(p, struct ecryptfs_msg_ctx, node); in ecryptfs_acquire_free_msg_ctx()
67 if (mutex_trylock(&(*msg_ctx)->mux)) { in ecryptfs_acquire_free_msg_ctx()
68 (*msg_ctx)->task = current; in ecryptfs_acquire_free_msg_ctx()
84 static void ecryptfs_msg_ctx_free_to_alloc(struct ecryptfs_msg_ctx *msg_ctx) in ecryptfs_msg_ctx_free_to_alloc() argument
86 list_move(&msg_ctx->node, &ecryptfs_msg_ctx_alloc_list); in ecryptfs_msg_ctx_free_to_alloc()
87 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_PENDING; in ecryptfs_msg_ctx_free_to_alloc()
88 msg_ctx->counter = ++ecryptfs_msg_counter; in ecryptfs_msg_ctx_free_to_alloc()
97 void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx) in ecryptfs_msg_ctx_alloc_to_free() argument
99 list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list); in ecryptfs_msg_ctx_alloc_to_free()
100 if (msg_ctx->msg) in ecryptfs_msg_ctx_alloc_to_free()
101 kfree(msg_ctx->msg); in ecryptfs_msg_ctx_alloc_to_free()
102 msg_ctx->msg = NULL; in ecryptfs_msg_ctx_alloc_to_free()
103 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE; in ecryptfs_msg_ctx_alloc_to_free()
184 struct ecryptfs_msg_ctx *msg_ctx, *msg_ctx_tmp; in ecryptfs_exorcise_daemon() local
197 list_for_each_entry_safe(msg_ctx, msg_ctx_tmp, in ecryptfs_exorcise_daemon()
199 list_del(&msg_ctx->daemon_out_list); in ecryptfs_exorcise_daemon()
203 ecryptfs_msg_ctx_alloc_to_free(msg_ctx); in ecryptfs_exorcise_daemon()
278 struct ecryptfs_msg_ctx *msg_ctx; in ecryptfs_process_response() local
293 msg_ctx = &ecryptfs_msg_ctx_arr[msg->index]; in ecryptfs_process_response()
294 mutex_lock(&msg_ctx->mux); in ecryptfs_process_response()
297 nsproxy = task_nsproxy(msg_ctx->task); in ecryptfs_process_response()
306 tsk_user_ns = __task_cred(msg_ctx->task)->user->user_ns; in ecryptfs_process_response()
307 ctx_euid = task_euid(msg_ctx->task); in ecryptfs_process_response()
340 if (msg_ctx->state != ECRYPTFS_MSG_CTX_STATE_PENDING) { in ecryptfs_process_response()
345 } else if (msg_ctx->counter != seq) { in ecryptfs_process_response()
349 msg_ctx->counter, seq); in ecryptfs_process_response()
353 msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL); in ecryptfs_process_response()
354 if (!msg_ctx->msg) { in ecryptfs_process_response()
360 memcpy(msg_ctx->msg, msg, msg_size); in ecryptfs_process_response()
361 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE; in ecryptfs_process_response()
364 wake_up_process(msg_ctx->task); in ecryptfs_process_response()
366 mutex_unlock(&msg_ctx->mux); in ecryptfs_process_response()
383 struct ecryptfs_msg_ctx **msg_ctx) in ecryptfs_send_message_locked() argument
397 rc = ecryptfs_acquire_free_msg_ctx(msg_ctx); in ecryptfs_send_message_locked()
404 ecryptfs_msg_ctx_free_to_alloc(*msg_ctx); in ecryptfs_send_message_locked()
405 mutex_unlock(&(*msg_ctx)->mux); in ecryptfs_send_message_locked()
407 rc = ecryptfs_send_miscdev(data, data_len, *msg_ctx, msg_type, 0, in ecryptfs_send_message_locked()
427 struct ecryptfs_msg_ctx **msg_ctx) in ecryptfs_send_message() argument
433 msg_ctx); in ecryptfs_send_message()
449 int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, in ecryptfs_wait_for_response() argument
458 mutex_lock(&msg_ctx->mux); in ecryptfs_wait_for_response()
459 if (msg_ctx->state != ECRYPTFS_MSG_CTX_STATE_DONE) { in ecryptfs_wait_for_response()
461 mutex_unlock(&msg_ctx->mux); in ecryptfs_wait_for_response()
467 *msg = msg_ctx->msg; in ecryptfs_wait_for_response()
468 msg_ctx->msg = NULL; in ecryptfs_wait_for_response()
470 ecryptfs_msg_ctx_alloc_to_free(msg_ctx); in ecryptfs_wait_for_response()
471 mutex_unlock(&msg_ctx->mux); in ecryptfs_wait_for_response()