Lines Matching refs:daemon
94 * @daemon: If return value is zero, points to the desired daemon pointer
102 int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon)
106 hlist_for_each_entry(*daemon,
109 if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) {
120 * ecryptfs_spawn_daemon - Create and initialize a new daemon struct
121 * @daemon: Pointer to set to newly allocated daemon struct
130 ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file)
134 (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL);
135 if (!(*daemon)) {
139 (*daemon)->file = file;
140 mutex_init(&(*daemon)->mux);
141 INIT_LIST_HEAD(&(*daemon)->msg_ctx_out_queue);
142 init_waitqueue_head(&(*daemon)->wait);
143 (*daemon)->num_queued_msg_ctx = 0;
144 hlist_add_head(&(*daemon)->euid_chain,
151 * ecryptfs_exorcise_daemon - Destroy the daemon struct
154 * ecryptfs_daemon_hash_mux and the daemon's own mux.
156 int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon)
161 mutex_lock(&daemon->mux);
162 if ((daemon->flags & ECRYPTFS_DAEMON_IN_READ)
163 || (daemon->flags & ECRYPTFS_DAEMON_IN_POLL)) {
165 mutex_unlock(&daemon->mux);
169 &daemon->msg_ctx_out_queue, daemon_out_list) {
171 daemon->num_queued_msg_ctx--;
173 "the out queue of a dying daemon\n", __func__);
176 hlist_del(&daemon->euid_chain);
177 mutex_unlock(&daemon->mux);
178 kfree_sensitive(daemon);
185 * @daemon: eCryptfs daemon object
206 int ecryptfs_process_response(struct ecryptfs_daemon *daemon,
265 struct ecryptfs_daemon *daemon;
268 rc = ecryptfs_find_daemon_by_euid(&daemon);
285 daemon);
288 "userspace daemon; rc = [%d]\n", __func__, rc);
426 struct ecryptfs_daemon *daemon;
434 hlist_for_each_entry_safe(daemon, n,
437 rc = ecryptfs_exorcise_daemon(daemon);
440 "attempting to destroy daemon; "