Lines Matching full:proc
183 struct dlm_user_proc *proc; in dlm_user_add_ast() local
206 proc = ua->proc; in dlm_user_add_ast()
214 spin_lock_bh(&proc->asts_spin); in dlm_user_add_ast()
229 list_add_tail(&cb->list, &proc->asts); in dlm_user_add_ast()
230 wake_up_interruptible(&proc->wait); in dlm_user_add_ast()
233 spin_unlock_bh(&proc->asts_spin); in dlm_user_add_ast()
237 spin_lock_bh(&proc->locks_spin); in dlm_user_add_ast()
242 spin_unlock_bh(&proc->locks_spin); in dlm_user_add_ast()
248 static int device_user_lock(struct dlm_user_proc *proc, in device_user_lock() argument
256 ls = dlm_find_lockspace_local(proc->lockspace); in device_user_lock()
268 ua->proc = proc; in device_user_lock()
299 static int device_user_unlock(struct dlm_user_proc *proc, in device_user_unlock() argument
306 ls = dlm_find_lockspace_local(proc->lockspace); in device_user_unlock()
313 ua->proc = proc; in device_user_unlock()
328 static int device_user_deadlock(struct dlm_user_proc *proc, in device_user_deadlock() argument
334 ls = dlm_find_lockspace_local(proc->lockspace); in device_user_deadlock()
389 static int device_user_purge(struct dlm_user_proc *proc, in device_user_purge() argument
395 ls = dlm_find_lockspace_local(proc->lockspace); in device_user_purge()
399 error = dlm_user_purge(ls, proc, params->nodeid, params->pid); in device_user_purge()
513 struct dlm_user_proc *proc = file->private_data; in device_write() local
558 if (proc) in device_write()
559 set_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags); in device_write()
568 (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) { in device_write()
578 if (!proc) { in device_write()
582 error = device_user_lock(proc, &kbuf->i.lock); in device_write()
586 if (!proc) { in device_write()
590 error = device_user_unlock(proc, &kbuf->i.lock); in device_write()
594 if (!proc) { in device_write()
598 error = device_user_deadlock(proc, &kbuf->i.lock); in device_write()
602 if (proc) { in device_write()
610 if (proc) { in device_write()
618 if (!proc) { in device_write()
622 error = device_user_purge(proc, &kbuf->i.purge); in device_write()
635 /* Every process that opens the lockspace device has its own "proc" structure
641 struct dlm_user_proc *proc; in device_open() local
648 proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS); in device_open()
649 if (!proc) { in device_open()
654 proc->lockspace = ls; in device_open()
655 INIT_LIST_HEAD(&proc->asts); in device_open()
656 INIT_LIST_HEAD(&proc->locks); in device_open()
657 INIT_LIST_HEAD(&proc->unlocking); in device_open()
658 spin_lock_init(&proc->asts_spin); in device_open()
659 spin_lock_init(&proc->locks_spin); in device_open()
660 init_waitqueue_head(&proc->wait); in device_open()
661 file->private_data = proc; in device_open()
668 struct dlm_user_proc *proc = file->private_data; in device_close() local
671 ls = dlm_find_lockspace_local(proc->lockspace); in device_close()
675 set_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags); in device_close()
677 dlm_clear_proc_locks(ls, proc); in device_close()
681 looking for lkb->ua->proc */ in device_close()
683 kfree(proc); in device_close()
788 struct dlm_user_proc *proc = file->private_data; in device_read() local
798 if (!proc) { in device_read()
811 if (test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)) in device_read()
814 spin_lock_bh(&proc->asts_spin); in device_read()
815 if (list_empty(&proc->asts)) { in device_read()
817 spin_unlock_bh(&proc->asts_spin); in device_read()
821 add_wait_queue(&proc->wait, &wait); in device_read()
825 if (list_empty(&proc->asts) && !signal_pending(current)) { in device_read()
826 spin_unlock_bh(&proc->asts_spin); in device_read()
828 spin_lock_bh(&proc->asts_spin); in device_read()
832 remove_wait_queue(&proc->wait, &wait); in device_read()
835 spin_unlock_bh(&proc->asts_spin); in device_read()
844 cb = list_first_entry(&proc->asts, struct dlm_callback, list); in device_read()
846 spin_unlock_bh(&proc->asts_spin); in device_read()
859 test_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags), in device_read()
867 struct dlm_user_proc *proc = file->private_data; in device_poll() local
869 poll_wait(file, &proc->wait, wait); in device_poll()
871 spin_lock_bh(&proc->asts_spin); in device_poll()
872 if (!list_empty(&proc->asts)) { in device_poll()
873 spin_unlock_bh(&proc->asts_spin); in device_poll()
876 spin_unlock_bh(&proc->asts_spin); in device_poll()