Lines Matching refs:host
30 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
57 if (!atomic_dec_and_lock(&lockowner->count, &lockowner->host->h_lock)) in nlm_put_lockowner()
60 spin_unlock(&lockowner->host->h_lock); in nlm_put_lockowner()
61 nlmclnt_release_host(lockowner->host); in nlm_put_lockowner()
65 static inline int nlm_pidbusy(struct nlm_host *host, uint32_t pid) in nlm_pidbusy() argument
68 list_for_each_entry(lockowner, &host->h_lockowners, list) { in nlm_pidbusy()
75 static inline uint32_t __nlm_alloc_pid(struct nlm_host *host) in __nlm_alloc_pid() argument
79 res = host->h_pidcount++; in __nlm_alloc_pid()
80 } while (nlm_pidbusy(host, res) < 0); in __nlm_alloc_pid()
84 static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner) in __nlm_find_lockowner() argument
87 list_for_each_entry(lockowner, &host->h_lockowners, list) { in __nlm_find_lockowner()
95 static struct nlm_lockowner *nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner) in nlm_find_lockowner() argument
99 spin_lock(&host->h_lock); in nlm_find_lockowner()
100 res = __nlm_find_lockowner(host, owner); in nlm_find_lockowner()
102 spin_unlock(&host->h_lock); in nlm_find_lockowner()
104 spin_lock(&host->h_lock); in nlm_find_lockowner()
105 res = __nlm_find_lockowner(host, owner); in nlm_find_lockowner()
110 new->pid = __nlm_alloc_pid(host); in nlm_find_lockowner()
111 new->host = nlm_get_host(host); in nlm_find_lockowner()
112 list_add(&new->list, &host->h_lockowners); in nlm_find_lockowner()
116 spin_unlock(&host->h_lock); in nlm_find_lockowner()
155 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl) in nlmclnt_proc() argument
160 call = nlm_alloc_call(host); in nlmclnt_proc()
164 nlmclnt_locks_init_private(fl, host); in nlmclnt_proc()
194 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) in nlm_alloc_call() argument
204 call->a_host = nlm_get_host(host); in nlm_alloc_call()
251 struct nlm_host *host = req->a_host; in nlmclnt_call() local
263 (int)proc, host->h_name); in nlmclnt_call()
266 if (host->h_reclaiming && !argp->reclaim) in nlmclnt_call()
270 if ((clnt = nlm_bind_host(host)) == NULL) in nlmclnt_call()
284 nlm_rebind_host(host); in nlmclnt_call()
304 wake_up_all(&host->h_gracewait); in nlmclnt_call()
318 status = nlm_wait_on_grace(&host->h_gracewait); in nlmclnt_call()
329 struct nlm_host *host = req->a_host; in __nlm_async_call() local
339 (int)proc, host->h_name); in __nlm_async_call()
342 clnt = nlm_bind_host(host); in __nlm_async_call()
447 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
450 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); in nlmclnt_locks_copy_lock()
451 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
456 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
458 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
467 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host) in nlmclnt_locks_init_private() argument
470 fl->fl_u.nfs_fl.owner = nlm_find_lockowner(host, fl->fl_owner); in nlmclnt_locks_init_private()
504 struct nlm_host *host = req->a_host; in nlmclnt_lock() local
511 if (nsm_monitor(host) < 0) in nlmclnt_lock()
521 block = nlmclnt_prepare_block(host, fl); in nlmclnt_lock()
530 fl->fl_u.nfs_fl.state = host->h_state; in nlmclnt_lock()
553 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0) in nlmclnt_lock()
558 down_read(&host->h_rwsem); in nlmclnt_lock()
560 if (fl->fl_u.nfs_fl.state != host->h_state) { in nlmclnt_lock()
561 up_read(&host->h_rwsem); in nlmclnt_lock()
568 up_read(&host->h_rwsem); in nlmclnt_lock()
595 down_read(&host->h_rwsem); in nlmclnt_lock()
597 up_read(&host->h_rwsem); in nlmclnt_lock()
608 nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl, in nlmclnt_reclaim() argument
616 req->a_host = host; in nlmclnt_reclaim()
651 struct nlm_host *host = req->a_host; in nlmclnt_unlock() local
662 down_read(&host->h_rwsem); in nlmclnt_unlock()
664 up_read(&host->h_rwsem); in nlmclnt_unlock()
732 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) in nlmclnt_cancel() argument
740 req = nlm_alloc_call(host); in nlmclnt_cancel()