Lines Matching defs:host
34 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
62 if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock))
65 spin_unlock(&lockowner->host->h_lock);
66 nlmclnt_release_host(lockowner->host);
70 static inline int nlm_pidbusy(struct nlm_host *host, uint32_t pid)
73 list_for_each_entry(lockowner, &host->h_lockowners, list) {
80 static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)
84 res = host->h_pidcount++;
85 } while (nlm_pidbusy(host, res) < 0);
89 static struct nlm_lockowner *__nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
92 list_for_each_entry(lockowner, &host->h_lockowners, list) {
100 static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
104 spin_lock(&host->h_lock);
105 res = __nlmclnt_find_lockowner(host, owner);
107 spin_unlock(&host->h_lock);
109 spin_lock(&host->h_lock);
110 res = __nlmclnt_find_lockowner(host, owner);
115 new->pid = __nlm_alloc_pid(host);
116 new->host = nlm_get_host(host);
117 list_add(&new->list, &host->h_lockowners);
121 spin_unlock(&host->h_lock);
155 * @host: address of a valid nlm_host context representing the NLM server
161 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data)
165 const struct nlmclnt_operations *nlmclnt_ops = host->h_nlmclnt_ops;
167 call = nlm_alloc_call(host);
174 nlmclnt_locks_init_private(fl, host);
205 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
215 call->a_host = nlm_get_host(host);
266 struct nlm_host *host = req->a_host;
278 (int)proc, host->h_name);
281 if (host->h_reclaiming && !argp->reclaim)
285 if ((clnt = nlm_bind_host(host)) == NULL)
299 nlm_rebind_host(host);
319 wake_up_all(&host->h_gracewait);
333 status = nlm_wait_on_grace(&host->h_gracewait);
344 struct nlm_host *host = req->a_host;
354 (int)proc, host->h_name);
357 clnt = nlm_bind_host(host);
465 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
468 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted);
469 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
474 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
476 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
485 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host)
488 fl->fl_u.nfs_fl.owner = nlmclnt_find_lockowner(host, fl->fl_owner);
522 struct nlm_host *host = req->a_host;
530 if (nsm_monitor(host) < 0)
540 nlmclnt_prepare_block(&block, host, fl);
556 fl->fl_u.nfs_fl.state = host->h_state;
582 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0)
587 down_read(&host->h_rwsem);
589 if (fl->fl_u.nfs_fl.state != host->h_state) {
590 up_read(&host->h_rwsem);
597 up_read(&host->h_rwsem);
627 down_read(&host->h_rwsem);
629 up_read(&host->h_rwsem);
640 nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl,
648 req->a_host = host;
683 struct nlm_host *host = req->a_host;
694 down_read(&host->h_rwsem);
696 up_read(&host->h_rwsem);
781 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl)
789 req = nlm_alloc_call(host);