• Home
  • Raw
  • Download

Lines Matching refs:lock

47 static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock);
145 nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock) in nlmsvc_lookup_block() argument
151 file, lock->fl.fl_pid, in nlmsvc_lookup_block()
152 (long long)lock->fl.fl_start, in nlmsvc_lookup_block()
153 (long long)lock->fl.fl_end, lock->fl.fl_type); in nlmsvc_lookup_block()
155 fl = &block->b_call->a_args.lock.fl; in nlmsvc_lookup_block()
161 if (block->b_file == file && nlm_compare_locks(fl, &lock->fl)) { in nlmsvc_lookup_block()
217 struct nlm_file *file, struct nlm_lock *lock, in nlmsvc_create_block() argument
235 if (!nlmsvc_setgrantargs(call, lock)) in nlmsvc_create_block()
239 call->a_args.lock.fl.fl_flags |= FL_SLEEP; in nlmsvc_create_block()
240 call->a_args.lock.fl.fl_lmops = &nlmsvc_lock_operations; in nlmsvc_create_block()
279 status = locks_delete_block(&block->b_call->a_args.lock.fl); in nlmsvc_unlink_block()
392 nlmsvc_release_lockowner(struct nlm_lock *lock) in nlmsvc_release_lockowner() argument
394 if (lock->fl.fl_owner) in nlmsvc_release_lockowner()
395 nlmsvc_put_lockowner(lock->fl.fl_owner); in nlmsvc_release_lockowner()
426 static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock) in nlmsvc_setgrantargs() argument
428 locks_copy_lock(&call->a_args.lock.fl, &lock->fl); in nlmsvc_setgrantargs()
429 memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh)); in nlmsvc_setgrantargs()
430 call->a_args.lock.caller = utsname()->nodename; in nlmsvc_setgrantargs()
431 call->a_args.lock.oh.len = lock->oh.len; in nlmsvc_setgrantargs()
434 call->a_args.lock.oh.data = call->a_owner; in nlmsvc_setgrantargs()
435 call->a_args.lock.svid = ((struct nlm_lockowner *)lock->fl.fl_owner)->pid; in nlmsvc_setgrantargs()
437 if (lock->oh.len > NLMCLNT_OHSIZE) { in nlmsvc_setgrantargs()
438 void *data = kmalloc(lock->oh.len, GFP_KERNEL); in nlmsvc_setgrantargs()
441 call->a_args.lock.oh.data = (u8 *) data; in nlmsvc_setgrantargs()
444 memcpy(call->a_args.lock.oh.data, lock->oh.data, lock->oh.len); in nlmsvc_setgrantargs()
450 if (call->a_args.lock.oh.data != call->a_owner) in nlmsvc_freegrantargs()
451 kfree(call->a_args.lock.oh.data); in nlmsvc_freegrantargs()
453 locks_release_private(&call->a_args.lock.fl); in nlmsvc_freegrantargs()
487 struct nlm_host *host, struct nlm_lock *lock, int wait, in nlmsvc_lock() argument
497 lock->fl.fl_type, lock->fl.fl_pid, in nlmsvc_lock()
498 (long long)lock->fl.fl_start, in nlmsvc_lock()
499 (long long)lock->fl.fl_end, in nlmsvc_lock()
507 block = nlmsvc_lookup_block(file, lock); in nlmsvc_lock()
509 block = nlmsvc_create_block(rqstp, host, file, lock, cookie); in nlmsvc_lock()
513 lock = &block->b_call->a_args.lock; in nlmsvc_lock()
515 lock->fl.fl_flags &= ~FL_SLEEP; in nlmsvc_lock()
544 lock->fl.fl_flags &= ~FL_SLEEP; in nlmsvc_lock()
545 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL); in nlmsvc_lock()
546 lock->fl.fl_flags &= ~FL_SLEEP; in nlmsvc_lock()
594 struct nlm_host *host, struct nlm_lock *lock, in nlmsvc_testlock() argument
604 lock->fl.fl_type, in nlmsvc_testlock()
605 (long long)lock->fl.fl_start, in nlmsvc_testlock()
606 (long long)lock->fl.fl_end); in nlmsvc_testlock()
614 test_owner = (struct nlm_lockowner *)lock->fl.fl_owner; in nlmsvc_testlock()
616 error = vfs_test_lock(file->f_file, &lock->fl); in nlmsvc_testlock()
626 if (lock->fl.fl_type == F_UNLCK) { in nlmsvc_testlock()
632 lock->fl.fl_type, (long long)lock->fl.fl_start, in nlmsvc_testlock()
633 (long long)lock->fl.fl_end); in nlmsvc_testlock()
637 conflock->svid = ((struct nlm_lockowner *)lock->fl.fl_owner)->pid; in nlmsvc_testlock()
638 conflock->fl.fl_type = lock->fl.fl_type; in nlmsvc_testlock()
639 conflock->fl.fl_start = lock->fl.fl_start; in nlmsvc_testlock()
640 conflock->fl.fl_end = lock->fl.fl_end; in nlmsvc_testlock()
641 locks_release_private(&lock->fl); in nlmsvc_testlock()
644 lock->fl.fl_owner = NULL; in nlmsvc_testlock()
660 nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock) in nlmsvc_unlock() argument
667 lock->fl.fl_pid, in nlmsvc_unlock()
668 (long long)lock->fl.fl_start, in nlmsvc_unlock()
669 (long long)lock->fl.fl_end); in nlmsvc_unlock()
672 nlmsvc_cancel_blocked(net, file, lock); in nlmsvc_unlock()
674 lock->fl.fl_type = F_UNLCK; in nlmsvc_unlock()
675 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL); in nlmsvc_unlock()
688 nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *lock) in nlmsvc_cancel_blocked() argument
696 lock->fl.fl_pid, in nlmsvc_cancel_blocked()
697 (long long)lock->fl.fl_start, in nlmsvc_cancel_blocked()
698 (long long)lock->fl.fl_end); in nlmsvc_cancel_blocked()
704 block = nlmsvc_lookup_block(file, lock); in nlmsvc_cancel_blocked()
708 &block->b_call->a_args.lock.fl); in nlmsvc_cancel_blocked()
741 if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) { in nlmsvc_grant_deferred()
780 if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) { in nlmsvc_notify_blocked()
811 struct nlm_lock *lock = &block->b_call->a_args.lock; in nlmsvc_grant_blocked() local
834 lock->fl.fl_flags |= FL_SLEEP; in nlmsvc_grant_blocked()
835 fl_start = lock->fl.fl_start; in nlmsvc_grant_blocked()
836 fl_end = lock->fl.fl_end; in nlmsvc_grant_blocked()
837 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL); in nlmsvc_grant_blocked()
838 lock->fl.fl_flags &= ~FL_SLEEP; in nlmsvc_grant_blocked()
839 lock->fl.fl_start = fl_start; in nlmsvc_grant_blocked()
840 lock->fl.fl_end = fl_end; in nlmsvc_grant_blocked()