Lines Matching refs: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)) in nlmclnt_put_lockowner()
65 spin_unlock(&lockowner->host->h_lock); in nlmclnt_put_lockowner()
66 nlmclnt_release_host(lockowner->host); in nlmclnt_put_lockowner()
70 static inline int nlm_pidbusy(struct nlm_host *host, uint32_t pid) in nlm_pidbusy() argument
73 list_for_each_entry(lockowner, &host->h_lockowners, list) { in nlm_pidbusy()
80 static inline uint32_t __nlm_alloc_pid(struct nlm_host *host) in __nlm_alloc_pid() argument
84 res = host->h_pidcount++; in __nlm_alloc_pid()
85 } while (nlm_pidbusy(host, res) < 0); in __nlm_alloc_pid()
89 static struct nlm_lockowner *__nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner) in __nlmclnt_find_lockowner() argument
92 list_for_each_entry(lockowner, &host->h_lockowners, list) { in __nlmclnt_find_lockowner()
100 static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner) in nlmclnt_find_lockowner() argument
104 spin_lock(&host->h_lock); in nlmclnt_find_lockowner()
105 res = __nlmclnt_find_lockowner(host, owner); in nlmclnt_find_lockowner()
107 spin_unlock(&host->h_lock); in nlmclnt_find_lockowner()
109 spin_lock(&host->h_lock); in nlmclnt_find_lockowner()
110 res = __nlmclnt_find_lockowner(host, owner); in nlmclnt_find_lockowner()
115 new->pid = __nlm_alloc_pid(host); in nlmclnt_find_lockowner()
116 new->host = nlm_get_host(host); in nlmclnt_find_lockowner()
117 list_add(&new->list, &host->h_lockowners); in nlmclnt_find_lockowner()
121 spin_unlock(&host->h_lock); in nlmclnt_find_lockowner()
162 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data) in nlmclnt_proc() argument
166 const struct nlmclnt_operations *nlmclnt_ops = host->h_nlmclnt_ops; in nlmclnt_proc()
168 call = nlm_alloc_call(host); in nlmclnt_proc()
175 nlmclnt_locks_init_private(fl, host); in nlmclnt_proc()
206 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) in nlm_alloc_call() argument
216 call->a_host = nlm_get_host(host); in nlm_alloc_call()
267 struct nlm_host *host = req->a_host; in nlmclnt_call() local
279 (int)proc, host->h_name); in nlmclnt_call()
282 if (host->h_reclaiming && !argp->reclaim) in nlmclnt_call()
286 if ((clnt = nlm_bind_host(host)) == NULL) in nlmclnt_call()
300 nlm_rebind_host(host); in nlmclnt_call()
320 wake_up_all(&host->h_gracewait); in nlmclnt_call()
334 status = nlm_wait_on_grace(&host->h_gracewait); in nlmclnt_call()
345 struct nlm_host *host = req->a_host; in __nlm_async_call() local
355 (int)proc, host->h_name); in __nlm_async_call()
358 clnt = nlm_bind_host(host); in __nlm_async_call()
467 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
470 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); in nlmclnt_locks_copy_lock()
471 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_copy_lock()
476 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
478 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); in nlmclnt_locks_release_private()
487 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host) in nlmclnt_locks_init_private() argument
490 fl->fl_u.nfs_fl.owner = nlmclnt_find_lockowner(host, in nlmclnt_locks_init_private()
525 struct nlm_host *host = req->a_host; in nlmclnt_lock() local
533 if (nsm_monitor(host) < 0) in nlmclnt_lock()
543 nlmclnt_prepare_block(&block, host, fl); in nlmclnt_lock()
559 fl->fl_u.nfs_fl.state = host->h_state; in nlmclnt_lock()
585 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0) in nlmclnt_lock()
590 down_read(&host->h_rwsem); in nlmclnt_lock()
592 if (fl->fl_u.nfs_fl.state != host->h_state) { in nlmclnt_lock()
593 up_read(&host->h_rwsem); in nlmclnt_lock()
600 up_read(&host->h_rwsem); in nlmclnt_lock()
630 down_read(&host->h_rwsem); in nlmclnt_lock()
632 up_read(&host->h_rwsem); in nlmclnt_lock()
643 nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl, in nlmclnt_reclaim() argument
651 req->a_host = host; in nlmclnt_reclaim()
688 struct nlm_host *host = req->a_host; in nlmclnt_unlock() local
699 down_read(&host->h_rwsem); in nlmclnt_unlock()
701 up_read(&host->h_rwsem); in nlmclnt_unlock()
786 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) in nlmclnt_cancel() argument
794 req = nlm_alloc_call(host); in nlmclnt_cancel()