Lines Matching refs:daemon

115 int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon)  in ecryptfs_find_daemon_by_euid()  argument
119 hlist_for_each_entry(*daemon, in ecryptfs_find_daemon_by_euid()
122 if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) { in ecryptfs_find_daemon_by_euid()
143 ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file) in ecryptfs_spawn_daemon() argument
147 (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL); in ecryptfs_spawn_daemon()
148 if (!(*daemon)) { in ecryptfs_spawn_daemon()
151 "GFP_KERNEL memory\n", __func__, sizeof(**daemon)); in ecryptfs_spawn_daemon()
154 (*daemon)->file = file; in ecryptfs_spawn_daemon()
155 mutex_init(&(*daemon)->mux); in ecryptfs_spawn_daemon()
156 INIT_LIST_HEAD(&(*daemon)->msg_ctx_out_queue); in ecryptfs_spawn_daemon()
157 init_waitqueue_head(&(*daemon)->wait); in ecryptfs_spawn_daemon()
158 (*daemon)->num_queued_msg_ctx = 0; in ecryptfs_spawn_daemon()
159 hlist_add_head(&(*daemon)->euid_chain, in ecryptfs_spawn_daemon()
171 int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon) in ecryptfs_exorcise_daemon() argument
176 mutex_lock(&daemon->mux); in ecryptfs_exorcise_daemon()
177 if ((daemon->flags & ECRYPTFS_DAEMON_IN_READ) in ecryptfs_exorcise_daemon()
178 || (daemon->flags & ECRYPTFS_DAEMON_IN_POLL)) { in ecryptfs_exorcise_daemon()
180 mutex_unlock(&daemon->mux); in ecryptfs_exorcise_daemon()
184 &daemon->msg_ctx_out_queue, daemon_out_list) { in ecryptfs_exorcise_daemon()
186 daemon->num_queued_msg_ctx--; in ecryptfs_exorcise_daemon()
191 hlist_del(&daemon->euid_chain); in ecryptfs_exorcise_daemon()
192 mutex_unlock(&daemon->mux); in ecryptfs_exorcise_daemon()
193 kzfree(daemon); in ecryptfs_exorcise_daemon()
220 int ecryptfs_process_response(struct ecryptfs_daemon *daemon, in ecryptfs_process_response() argument
280 struct ecryptfs_daemon *daemon; in ecryptfs_send_message_locked() local
283 rc = ecryptfs_find_daemon_by_euid(&daemon); in ecryptfs_send_message_locked()
300 daemon); in ecryptfs_send_message_locked()
444 struct ecryptfs_daemon *daemon; in ecryptfs_release_messaging() local
451 hlist_for_each_entry(daemon, in ecryptfs_release_messaging()
454 rc = ecryptfs_exorcise_daemon(daemon); in ecryptfs_release_messaging()