• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/fs/ecryptfs/

Lines Matching defs:msg_ctx

40  * @msg_ctx: The context that was acquired from the free list
47 static int ecryptfs_acquire_free_msg_ctx(struct ecryptfs_msg_ctx **msg_ctx)
62 *msg_ctx = list_entry(p, struct ecryptfs_msg_ctx, node);
63 if (mutex_trylock(&(*msg_ctx)->mux)) {
64 (*msg_ctx)->task = current;
76 * @msg_ctx: The context to move from the free list to the alloc list
81 static void ecryptfs_msg_ctx_free_to_alloc(struct ecryptfs_msg_ctx *msg_ctx)
83 list_move(&msg_ctx->node, &ecryptfs_msg_ctx_alloc_list);
84 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_PENDING;
85 msg_ctx->counter = ++ecryptfs_msg_counter;
90 * @msg_ctx: The context to move from the alloc list to the free list
95 static void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx)
97 list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list);
98 if (msg_ctx->msg)
99 kfree(msg_ctx->msg);
100 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE;
253 struct ecryptfs_msg_ctx *msg_ctx;
265 msg_ctx = &ecryptfs_msg_ctx_arr[msg->index];
266 mutex_lock(&msg_ctx->mux);
267 if (ecryptfs_find_daemon_id(msg_ctx->task->euid, &id)) {
272 msg_ctx->task->euid, pid);
275 if (msg_ctx->task->euid != uid) {
279 uid, msg_ctx->task->euid);
286 "process [%d]\n", msg_ctx->task->euid, pid);
289 if (msg_ctx->state != ECRYPTFS_MSG_CTX_STATE_PENDING) {
294 } else if (msg_ctx->counter != seq) {
298 msg_ctx->counter, seq);
302 msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL);
303 if (!msg_ctx->msg) {
308 memcpy(msg_ctx->msg, msg, msg_size);
309 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE;
312 wake_up_process(msg_ctx->task);
314 mutex_unlock(&msg_ctx->mux);
325 * @msg_ctx: The message context allocated for the send
328 struct ecryptfs_msg_ctx **msg_ctx)
343 rc = ecryptfs_acquire_free_msg_ctx(msg_ctx);
350 ecryptfs_msg_ctx_free_to_alloc(*msg_ctx);
351 mutex_unlock(&(*msg_ctx)->mux);
355 rc = ecryptfs_send_netlink(data, data_len, *msg_ctx,
373 * @msg_ctx: The context that was assigned when sending a message
382 int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx,
391 mutex_lock(&msg_ctx->mux);
392 if (msg_ctx->state != ECRYPTFS_MSG_CTX_STATE_DONE) {
394 mutex_unlock(&msg_ctx->mux);
400 *msg = msg_ctx->msg;
401 msg_ctx->msg = NULL;
403 ecryptfs_msg_ctx_alloc_to_free(msg_ctx);
404 mutex_unlock(&msg_ctx->mux);