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()
152 (*daemon)->file = file; in ecryptfs_spawn_daemon()
153 mutex_init(&(*daemon)->mux); in ecryptfs_spawn_daemon()
154 INIT_LIST_HEAD(&(*daemon)->msg_ctx_out_queue); in ecryptfs_spawn_daemon()
155 init_waitqueue_head(&(*daemon)->wait); in ecryptfs_spawn_daemon()
156 (*daemon)->num_queued_msg_ctx = 0; in ecryptfs_spawn_daemon()
157 hlist_add_head(&(*daemon)->euid_chain, in ecryptfs_spawn_daemon()
169 int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon) in ecryptfs_exorcise_daemon() argument
174 mutex_lock(&daemon->mux); in ecryptfs_exorcise_daemon()
175 if ((daemon->flags & ECRYPTFS_DAEMON_IN_READ) in ecryptfs_exorcise_daemon()
176 || (daemon->flags & ECRYPTFS_DAEMON_IN_POLL)) { in ecryptfs_exorcise_daemon()
178 mutex_unlock(&daemon->mux); in ecryptfs_exorcise_daemon()
182 &daemon->msg_ctx_out_queue, daemon_out_list) { in ecryptfs_exorcise_daemon()
184 daemon->num_queued_msg_ctx--; in ecryptfs_exorcise_daemon()
189 hlist_del(&daemon->euid_chain); in ecryptfs_exorcise_daemon()
190 mutex_unlock(&daemon->mux); in ecryptfs_exorcise_daemon()
191 kzfree(daemon); in ecryptfs_exorcise_daemon()
218 int ecryptfs_process_response(struct ecryptfs_daemon *daemon, in ecryptfs_process_response() argument
276 struct ecryptfs_daemon *daemon; in ecryptfs_send_message_locked() local
279 rc = ecryptfs_find_daemon_by_euid(&daemon); in ecryptfs_send_message_locked()
296 daemon); in ecryptfs_send_message_locked()
438 struct ecryptfs_daemon *daemon; in ecryptfs_release_messaging() local
446 hlist_for_each_entry_safe(daemon, n, in ecryptfs_release_messaging()
449 rc = ecryptfs_exorcise_daemon(daemon); in ecryptfs_release_messaging()