Lines Matching refs:host
31 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
59 if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock)) in nlmclnt_put_lockowner()
62 spin_unlock(&lockowner->host->h_lock); in nlmclnt_put_lockowner()
63 nlmclnt_release_host(lockowner->host); in nlmclnt_put_lockowner()
67 static inline int nlm_pidbusy(struct nlm_host *host, uint32_t pid) in nlm_pidbusy() argument
70 list_for_each_entry(lockowner, &host->h_lockowners, list) { in nlm_pidbusy()
77 static inline uint32_t __nlm_alloc_pid(struct nlm_host *host) in __nlm_alloc_pid() argument
81 res = host->h_pidcount++; in __nlm_alloc_pid()
82 } while (nlm_pidbusy(host, res) < 0); in __nlm_alloc_pid()
86 static struct nlm_lockowner *__nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner) in __nlmclnt_find_lockowner() argument
89 list_for_each_entry(lockowner, &host->h_lockowners, list) { in __nlmclnt_find_lockowner()
97 static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner) in nlmclnt_find_lockowner() argument
101 spin_lock(&host->h_lock); in nlmclnt_find_lockowner()
102 res = __nlmclnt_find_lockowner(host, owner); in nlmclnt_find_lockowner()
104 spin_unlock(&host->h_lock); in nlmclnt_find_lockowner()
106 spin_lock(&host->h_lock); in nlmclnt_find_lockowner()
107 res = __nlmclnt_find_lockowner(host, owner); in nlmclnt_find_lockowner()
112 new->pid = __nlm_alloc_pid(host); in nlmclnt_find_lockowner()
113 new->host = nlm_get_host(host); in nlmclnt_find_lockowner()
114 list_add(&new->list, &host->h_lockowners); in nlmclnt_find_lockowner()
118 spin_unlock(&host->h_lock); in nlmclnt_find_lockowner()
158 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data) in nlmclnt_proc() argument
162 const struct nlmclnt_operations *nlmclnt_ops = host->h_nlmclnt_ops; in nlmclnt_proc()
164 call = nlm_alloc_call(host); in nlmclnt_proc()
171 nlmclnt_locks_init_private(fl, host); in nlmclnt_proc()
202 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) in nlm_alloc_call() argument
212 call->a_host = nlm_get_host(host); in nlm_alloc_call()
263 struct nlm_host *host = req->a_host; in nlmclnt_call() local
275 (int)proc, host->h_name); in nlmclnt_call()
278 if (host->h_reclaiming && !argp->reclaim) in nlmclnt_call()
282 if ((clnt = nlm_bind_host(host)) == NULL) in nlmclnt_call()
296 nlm_rebind_host(host); in nlmclnt_call()
316 wake_up_all(&host->h_gracewait); in nlmclnt_call()
330 status = nlm_wait_on_grace(&host->h_gracewait); in nlmclnt_call()
341 struct nlm_host *host = req->a_host; in __nlm_async_call() local
351 (int)proc, host->h_name); in __nlm_async_call()
354 clnt = nlm_bind_host(host); in __nlm_async_call()
459 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
462 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); in nlmclnt_locks_copy_lock()
463 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
468 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
470 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
479 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host) in nlmclnt_locks_init_private() argument
482 fl->fl_u.nfs_fl.owner = nlmclnt_find_lockowner(host, fl->fl_owner); in nlmclnt_locks_init_private()
516 struct nlm_host *host = req->a_host; in nlmclnt_lock() local
523 if (nsm_monitor(host) < 0) in nlmclnt_lock()
533 block = nlmclnt_prepare_block(host, fl); in nlmclnt_lock()
542 fl->fl_u.nfs_fl.state = host->h_state; in nlmclnt_lock()
565 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0) in nlmclnt_lock()
570 down_read(&host->h_rwsem); in nlmclnt_lock()
572 if (fl->fl_u.nfs_fl.state != host->h_state) { in nlmclnt_lock()
573 up_read(&host->h_rwsem); in nlmclnt_lock()
580 up_read(&host->h_rwsem); in nlmclnt_lock()
607 down_read(&host->h_rwsem); in nlmclnt_lock()
609 up_read(&host->h_rwsem); in nlmclnt_lock()
620 nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl, in nlmclnt_reclaim() argument
628 req->a_host = host; in nlmclnt_reclaim()
663 struct nlm_host *host = req->a_host; in nlmclnt_unlock() local
674 down_read(&host->h_rwsem); in nlmclnt_unlock()
676 up_read(&host->h_rwsem); in nlmclnt_unlock()
758 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) in nlmclnt_cancel() argument
766 req = nlm_alloc_call(host); in nlmclnt_cancel()