• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/fs/ecryptfs/

Lines Matching defs:daemon

108  * @euid: The effective user id which maps to the desired daemon id
110 * @daemon: If return value is zero, points to the desired daemon pointer
118 int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon, uid_t euid,
124 hlist_for_each_entry(*daemon, elem,
127 if ((*daemon)->euid == euid && (*daemon)->user_ns == user_ns) {
138 * ecryptfs_spawn_daemon - Create and initialize a new daemon struct
139 * @daemon: Pointer to set to newly allocated daemon struct
140 * @euid: Effective user id for the daemon
142 * @pid: Process id for the daemon
150 ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, uid_t euid,
155 (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL);
156 if (!(*daemon)) {
159 "GFP_KERNEL memory\n", __func__, sizeof(**daemon));
162 (*daemon)->euid = euid;
163 (*daemon)->user_ns = get_user_ns(user_ns);
164 (*daemon)->pid = get_pid(pid);
165 (*daemon)->task = current;
166 mutex_init(&(*daemon)->mux);
167 INIT_LIST_HEAD(&(*daemon)->msg_ctx_out_queue);
168 init_waitqueue_head(&(*daemon)->wait);
169 (*daemon)->num_queued_msg_ctx = 0;
170 hlist_add_head(&(*daemon)->euid_chain,
177 * ecryptfs_exorcise_daemon - Destroy the daemon struct
180 * ecryptfs_daemon_hash_mux and the daemon's own mux.
182 int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon)
187 mutex_lock(&daemon->mux);
188 if ((daemon->flags & ECRYPTFS_DAEMON_IN_READ)
189 || (daemon->flags & ECRYPTFS_DAEMON_IN_POLL)) {
191 printk(KERN_WARNING "%s: Attempt to destroy daemon with pid "
193 __func__, daemon->pid);
194 mutex_unlock(&daemon->mux);
198 &daemon->msg_ctx_out_queue, daemon_out_list) {
200 daemon->num_queued_msg_ctx--;
202 "the out queue of a dying daemon\n", __func__);
205 hlist_del(&daemon->euid_chain);
206 if (daemon->task)
207 wake_up_process(daemon->task);
208 if (daemon->pid)
209 put_pid(daemon->pid);
210 if (daemon->user_ns)
211 put_user_ns(daemon->user_ns);
212 mutex_unlock(&daemon->mux);
213 kzfree(daemon);
225 * Deletes the corresponding daemon for the given euid and pid, if
227 * after deleting the desired daemon; non-zero otherwise.
232 struct ecryptfs_daemon *daemon;
236 rc = ecryptfs_find_daemon_by_euid(&daemon, euid, user_ns);
237 if (rc || !daemon) {
240 "unregister unrecognized daemon [0x%p]\n", euid, pid);
243 rc = ecryptfs_exorcise_daemon(daemon);
277 struct ecryptfs_daemon *uninitialized_var(daemon);
308 rc = ecryptfs_find_daemon_by_euid(&daemon, ctx_euid, tsk_user_ns);
315 "not have a registered daemon\n", __func__,
333 if (daemon->pid != pid) {
385 struct ecryptfs_daemon *daemon;
389 rc = ecryptfs_find_daemon_by_euid(&daemon, euid, current_user_ns());
390 if (rc || !daemon) {
392 printk(KERN_ERR "%s: User [%d] does not have a daemon "
408 daemon);
411 "userspace daemon; rc = [%d]\n", __func__, rc);
554 struct ecryptfs_daemon *daemon;
561 hlist_for_each_entry(daemon, elem,
564 rc = ecryptfs_exorcise_daemon(daemon);
567 "attempting to destroy daemon; "