Lines Matching defs:msg_ctx
134 * @msg_ctx: Message context, which is used to handle the reply. If
140 * Add msg_ctx to queue and then, if it exists, notify the blocked
147 struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type,
156 mutex_lock(&msg_ctx->mux);
157 msg_ctx->msg = msg;
158 msg_ctx->msg->index = msg_ctx->index;
159 msg_ctx->msg->data_len = data_size;
160 msg_ctx->type = msg_type;
161 memcpy(msg_ctx->msg->data, data, data_size);
162 msg_ctx->msg_size = (sizeof(*msg_ctx->msg) + data_size);
163 list_add_tail(&msg_ctx->daemon_out_list, &daemon->msg_ctx_out_queue);
164 mutex_unlock(&msg_ctx->mux);
177 * Octets 1-4: network byte order msg_ctx->counter
214 struct ecryptfs_msg_ctx *msg_ctx;
255 msg_ctx = list_first_entry(&daemon->msg_ctx_out_queue,
257 BUG_ON(!msg_ctx);
258 mutex_lock(&msg_ctx->mux);
259 if (msg_ctx->msg) {
261 msg_ctx->msg_size,
271 msg_ctx->msg_size = 0;
274 + msg_ctx->msg_size);
283 if (put_user(msg_ctx->type, buf))
285 if (put_user(cpu_to_be32(msg_ctx->counter),
289 if (msg_ctx->msg) {
293 if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
295 i += msg_ctx->msg_size;
298 list_del(&msg_ctx->daemon_out_list);
299 kfree(msg_ctx->msg);
300 msg_ctx->msg = NULL;
303 if (msg_ctx->type != ECRYPTFS_MSG_REQUEST)
304 ecryptfs_msg_ctx_alloc_to_free(msg_ctx);
306 mutex_unlock(&msg_ctx->mux);