Lines Matching refs:clp
139 static bool is_client_expired(struct nfs4_client *clp) in is_client_expired() argument
141 return clp->cl_time == 0; in is_client_expired()
144 static __be32 get_client_locked(struct nfs4_client *clp) in get_client_locked() argument
146 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in get_client_locked()
150 if (is_client_expired(clp)) in get_client_locked()
152 atomic_inc(&clp->cl_rpc_users); in get_client_locked()
158 renew_client_locked(struct nfs4_client *clp) in renew_client_locked() argument
160 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in renew_client_locked()
162 if (is_client_expired(clp)) { in renew_client_locked()
166 clp->cl_clientid.cl_boot, in renew_client_locked()
167 clp->cl_clientid.cl_id); in renew_client_locked()
171 list_move_tail(&clp->cl_lru, &nn->client_lru); in renew_client_locked()
172 clp->cl_time = ktime_get_boottime_seconds(); in renew_client_locked()
175 static void put_client_renew_locked(struct nfs4_client *clp) in put_client_renew_locked() argument
177 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in put_client_renew_locked()
181 if (!atomic_dec_and_test(&clp->cl_rpc_users)) in put_client_renew_locked()
183 if (!is_client_expired(clp)) in put_client_renew_locked()
184 renew_client_locked(clp); in put_client_renew_locked()
189 static void put_client_renew(struct nfs4_client *clp) in put_client_renew() argument
191 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in put_client_renew()
193 if (!atomic_dec_and_lock(&clp->cl_rpc_users, &nn->client_lock)) in put_client_renew()
195 if (!is_client_expired(clp)) in put_client_renew()
196 renew_client_locked(clp); in put_client_renew()
217 struct nfs4_client *clp = ses->se_client; in nfsd4_put_session_locked() local
218 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in nfsd4_put_session_locked()
224 put_client_renew_locked(clp); in nfsd4_put_session_locked()
229 struct nfs4_client *clp = ses->se_client; in nfsd4_put_session() local
230 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in nfsd4_put_session()
291 struct nfs4_client *clp = lo->lo_owner.so_client; in remove_blocked_locks() local
292 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in remove_blocked_locks()
372 struct nfs4_client *clp) in find_openstateowner_str_locked() argument
376 lockdep_assert_held(&clp->cl_lock); in find_openstateowner_str_locked()
378 list_for_each_entry(so, &clp->cl_ownerstr_hashtbl[hashval], in find_openstateowner_str_locked()
390 struct nfs4_client *clp) in find_openstateowner_str() argument
394 spin_lock(&clp->cl_lock); in find_openstateowner_str()
395 oo = find_openstateowner_str_locked(hashval, open, clp); in find_openstateowner_str()
396 spin_unlock(&clp->cl_lock); in find_openstateowner_str()
641 alloc_clnt_odstate(struct nfs4_client *clp) in alloc_clnt_odstate() argument
647 co->co_client = clp; in alloc_clnt_odstate()
833 static struct nfs4_ol_stateid * nfs4_alloc_open_stateid(struct nfs4_client *clp) in nfs4_alloc_open_stateid() argument
837 stid = nfs4_alloc_stid(clp, stateid_slab, nfs4_free_ol_stateid); in nfs4_alloc_open_stateid()
928 alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp, in alloc_init_deleg() argument
941 dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab, nfs4_free_deleg)); in alloc_init_deleg()
972 struct nfs4_client *clp = s->sc_client; in nfs4_put_stid() local
974 might_lock(&clp->cl_lock); in nfs4_put_stid()
976 if (!refcount_dec_and_lock(&s->sc_count, &clp->cl_lock)) { in nfs4_put_stid()
980 idr_remove(&clp->cl_stateids, s->sc_stateid.si_opaque.so_id); in nfs4_put_stid()
981 nfs4_free_cpntf_statelist(clp->net, s); in nfs4_put_stid()
982 spin_unlock(&clp->cl_lock); in nfs4_put_stid()
1046 nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp) in nfs4_delegation_exists() argument
1056 if (clp == searchclp) { in nfs4_delegation_exists()
1079 struct nfs4_client *clp = dp->dl_stid.sc_client; in hash_delegation_locked() local
1084 if (nfs4_delegation_exists(clp, fp)) in hash_delegation_locked()
1089 list_add(&dp->dl_perclnt, &clp->cl_delegations); in hash_delegation_locked()
1132 struct nfs4_client *clp = dp->dl_stid.sc_client; in revoke_delegation() local
1136 if (clp->cl_minorversion) { in revoke_delegation()
1139 spin_lock(&clp->cl_lock); in revoke_delegation()
1140 list_add(&dp->dl_recall_lru, &clp->cl_revoked); in revoke_delegation()
1141 spin_unlock(&clp->cl_lock); in revoke_delegation()
1321 struct nfs4_client *clp = sop->so_client; in nfs4_put_stateowner() local
1323 might_lock(&clp->cl_lock); in nfs4_put_stateowner()
1325 if (!atomic_dec_and_lock(&sop->so_count, &clp->cl_lock)) in nfs4_put_stateowner()
1328 spin_unlock(&clp->cl_lock); in nfs4_put_stateowner()
1390 struct nfs4_client *clp = s->sc_client; in put_ol_stateid_locked() local
1392 lockdep_assert_held(&clp->cl_lock); in put_ol_stateid_locked()
1401 idr_remove(&clp->cl_stateids, s->sc_stateid.si_opaque.so_id); in put_ol_stateid_locked()
1418 struct nfs4_client *clp = stp->st_stid.sc_client; in release_lock_stateid() local
1421 spin_lock(&clp->cl_lock); in release_lock_stateid()
1423 spin_unlock(&clp->cl_lock); in release_lock_stateid()
1430 struct nfs4_client *clp = lo->lo_owner.so_client; in unhash_lockowner_locked() local
1432 lockdep_assert_held(&clp->cl_lock); in unhash_lockowner_locked()
1499 struct nfs4_client *clp = oo->oo_owner.so_client; in unhash_openowner_locked() local
1501 lockdep_assert_held(&clp->cl_lock); in unhash_openowner_locked()
1527 struct nfs4_client *clp = oo->oo_owner.so_client; in release_openowner() local
1532 spin_lock(&clp->cl_lock); in release_openowner()
1540 spin_unlock(&clp->cl_lock); in release_openowner()
1594 struct nfs4_client *clp = ses->se_client; in gen_sessionid() local
1598 sid->clientid = clp->cl_clientid; in gen_sessionid()
1738 struct nfs4_client *clp = c->cn_session->se_client; in nfsd4_conn_lost() local
1740 spin_lock(&clp->cl_lock); in nfsd4_conn_lost()
1745 nfsd4_probe_callback(clp); in nfsd4_conn_lost()
1746 spin_unlock(&clp->cl_lock); in nfsd4_conn_lost()
1771 struct nfs4_client *clp = ses->se_client; in nfsd4_hash_conn() local
1773 spin_lock(&clp->cl_lock); in nfsd4_hash_conn()
1775 spin_unlock(&clp->cl_lock); in nfsd4_hash_conn()
1809 struct nfs4_client *clp = s->se_client; in nfsd4_del_conns() local
1812 spin_lock(&clp->cl_lock); in nfsd4_del_conns()
1816 spin_unlock(&clp->cl_lock); in nfsd4_del_conns()
1821 spin_lock(&clp->cl_lock); in nfsd4_del_conns()
1823 spin_unlock(&clp->cl_lock); in nfsd4_del_conns()
1839 static void init_session(struct svc_rqst *rqstp, struct nfsd4_session *new, struct nfs4_client *clp… in init_session() argument
1844 new->se_client = clp; in init_session()
1856 spin_lock(&clp->cl_lock); in init_session()
1857 list_add(&new->se_perclnt, &clp->cl_sessions); in init_session()
1858 spin_unlock(&clp->cl_lock); in init_session()
1869 rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa); in init_session()
1870 clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa); in init_session()
1920 struct nfs4_client *clp = ses->se_client; in unhash_session() local
1921 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in unhash_session()
1953 struct nfs4_client *clp; in alloc_client() local
1956 clp = kmem_cache_zalloc(client_slab, GFP_KERNEL); in alloc_client()
1957 if (clp == NULL) in alloc_client()
1959 xdr_netobj_dup(&clp->cl_name, &name, GFP_KERNEL); in alloc_client()
1960 if (clp->cl_name.data == NULL) in alloc_client()
1962 clp->cl_ownerstr_hashtbl = kmalloc_array(OWNER_HASH_SIZE, in alloc_client()
1965 if (!clp->cl_ownerstr_hashtbl) in alloc_client()
1968 INIT_LIST_HEAD(&clp->cl_ownerstr_hashtbl[i]); in alloc_client()
1969 INIT_LIST_HEAD(&clp->cl_sessions); in alloc_client()
1970 idr_init(&clp->cl_stateids); in alloc_client()
1971 atomic_set(&clp->cl_rpc_users, 0); in alloc_client()
1972 clp->cl_cb_state = NFSD4_CB_UNKNOWN; in alloc_client()
1973 INIT_LIST_HEAD(&clp->cl_idhash); in alloc_client()
1974 INIT_LIST_HEAD(&clp->cl_openowners); in alloc_client()
1975 INIT_LIST_HEAD(&clp->cl_delegations); in alloc_client()
1976 INIT_LIST_HEAD(&clp->cl_lru); in alloc_client()
1977 INIT_LIST_HEAD(&clp->cl_revoked); in alloc_client()
1979 INIT_LIST_HEAD(&clp->cl_lo_states); in alloc_client()
1981 INIT_LIST_HEAD(&clp->async_copies); in alloc_client()
1982 spin_lock_init(&clp->async_lock); in alloc_client()
1983 spin_lock_init(&clp->cl_lock); in alloc_client()
1984 rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); in alloc_client()
1985 return clp; in alloc_client()
1987 kfree(clp->cl_name.data); in alloc_client()
1989 kmem_cache_free(client_slab, clp); in alloc_client()
1996 struct nfs4_client *clp = container_of(c, struct nfs4_client, cl_nfsdfs); in __free_client() local
1998 free_svc_cred(&clp->cl_cred); in __free_client()
1999 kfree(clp->cl_ownerstr_hashtbl); in __free_client()
2000 kfree(clp->cl_name.data); in __free_client()
2001 kfree(clp->cl_nii_domain.data); in __free_client()
2002 kfree(clp->cl_nii_name.data); in __free_client()
2003 idr_destroy(&clp->cl_stateids); in __free_client()
2004 kmem_cache_free(client_slab, clp); in __free_client()
2007 static void drop_client(struct nfs4_client *clp) in drop_client() argument
2009 kref_put(&clp->cl_nfsdfs.cl_ref, __free_client); in drop_client()
2013 free_client(struct nfs4_client *clp) in free_client() argument
2015 while (!list_empty(&clp->cl_sessions)) { in free_client()
2017 ses = list_entry(clp->cl_sessions.next, struct nfsd4_session, in free_client()
2023 rpc_destroy_wait_queue(&clp->cl_cb_waitq); in free_client()
2024 if (clp->cl_nfsd_dentry) { in free_client()
2025 nfsd_client_rmdir(clp->cl_nfsd_dentry); in free_client()
2026 clp->cl_nfsd_dentry = NULL; in free_client()
2029 drop_client(clp); in free_client()
2034 unhash_client_locked(struct nfs4_client *clp) in unhash_client_locked() argument
2036 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in unhash_client_locked()
2042 clp->cl_time = 0; in unhash_client_locked()
2044 if (!list_empty(&clp->cl_idhash)) { in unhash_client_locked()
2045 list_del_init(&clp->cl_idhash); in unhash_client_locked()
2046 if (test_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags)) in unhash_client_locked()
2047 rb_erase(&clp->cl_namenode, &nn->conf_name_tree); in unhash_client_locked()
2049 rb_erase(&clp->cl_namenode, &nn->unconf_name_tree); in unhash_client_locked()
2051 list_del_init(&clp->cl_lru); in unhash_client_locked()
2052 spin_lock(&clp->cl_lock); in unhash_client_locked()
2053 list_for_each_entry(ses, &clp->cl_sessions, se_perclnt) in unhash_client_locked()
2055 spin_unlock(&clp->cl_lock); in unhash_client_locked()
2059 unhash_client(struct nfs4_client *clp) in unhash_client() argument
2061 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in unhash_client()
2064 unhash_client_locked(clp); in unhash_client()
2068 static __be32 mark_client_expired_locked(struct nfs4_client *clp) in mark_client_expired_locked() argument
2070 if (atomic_read(&clp->cl_rpc_users)) in mark_client_expired_locked()
2072 unhash_client_locked(clp); in mark_client_expired_locked()
2077 __destroy_client(struct nfs4_client *clp) in __destroy_client() argument
2086 while (!list_empty(&clp->cl_delegations)) { in __destroy_client()
2087 dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt); in __destroy_client()
2097 while (!list_empty(&clp->cl_revoked)) { in __destroy_client()
2098 dp = list_entry(clp->cl_revoked.next, struct nfs4_delegation, dl_recall_lru); in __destroy_client()
2102 while (!list_empty(&clp->cl_openowners)) { in __destroy_client()
2103 oo = list_entry(clp->cl_openowners.next, struct nfs4_openowner, oo_perclient); in __destroy_client()
2110 list_for_each_entry_safe(so, tmp, &clp->cl_ownerstr_hashtbl[i], in __destroy_client()
2117 nfsd4_return_all_client_layouts(clp); in __destroy_client()
2118 nfsd4_shutdown_copy(clp); in __destroy_client()
2119 nfsd4_shutdown_callback(clp); in __destroy_client()
2120 if (clp->cl_cb_conn.cb_xprt) in __destroy_client()
2121 svc_xprt_put(clp->cl_cb_conn.cb_xprt); in __destroy_client()
2122 free_client(clp); in __destroy_client()
2127 destroy_client(struct nfs4_client *clp) in destroy_client() argument
2129 unhash_client(clp); in destroy_client()
2130 __destroy_client(clp); in destroy_client()
2133 static void inc_reclaim_complete(struct nfs4_client *clp) in inc_reclaim_complete() argument
2135 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in inc_reclaim_complete()
2139 if (!nfsd4_find_reclaim_client(clp->cl_name, nn)) in inc_reclaim_complete()
2144 clp->net->ns.inum); in inc_reclaim_complete()
2149 static void expire_client(struct nfs4_client *clp) in expire_client() argument
2151 unhash_client(clp); in expire_client()
2152 nfsd4_client_record_remove(clp); in expire_client()
2153 __destroy_client(clp); in expire_client()
2286 static void gen_confirm(struct nfs4_client *clp, struct nfsd_net *nn) in gen_confirm() argument
2296 memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data)); in gen_confirm()
2299 static void gen_clid(struct nfs4_client *clp, struct nfsd_net *nn) in gen_clid() argument
2301 clp->cl_clientid.cl_boot = (u32)nn->boot_time; in gen_clid()
2302 clp->cl_clientid.cl_id = nn->clientid_counter++; in gen_clid()
2303 gen_confirm(clp, nn); in gen_clid()
2353 struct nfs4_client *clp; in client_info_show() local
2356 clp = get_nfsdfs_clp(inode); in client_info_show()
2357 if (!clp) in client_info_show()
2359 memcpy(&clid, &clp->cl_clientid, sizeof(clid)); in client_info_show()
2361 seq_printf(m, "address: \"%pISpc\"\n", (struct sockaddr *)&clp->cl_addr); in client_info_show()
2363 seq_quote_mem(m, clp->cl_name.data, clp->cl_name.len); in client_info_show()
2364 seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion); in client_info_show()
2365 if (clp->cl_nii_domain.data) { in client_info_show()
2367 seq_quote_mem(m, clp->cl_nii_domain.data, in client_info_show()
2368 clp->cl_nii_domain.len); in client_info_show()
2370 seq_quote_mem(m, clp->cl_nii_name.data, clp->cl_nii_name.len); in client_info_show()
2372 clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec); in client_info_show()
2374 drop_client(clp); in client_info_show()
2392 __acquires(&clp->cl_lock) in states_start()
2394 struct nfs4_client *clp = s->private; in states_start() local
2398 spin_lock(&clp->cl_lock); in states_start()
2399 ret = idr_get_next_ul(&clp->cl_stateids, &id); in states_start()
2406 struct nfs4_client *clp = s->private; in states_next() local
2412 ret = idr_get_next_ul(&clp->cl_stateids, &id); in states_next()
2418 __releases(&clp->cl_lock) in states_stop()
2420 struct nfs4_client *clp = s->private; in states_stop() local
2422 spin_unlock(&clp->cl_lock); in states_stop()
2613 struct nfs4_client *clp; in client_states_open() local
2616 clp = get_nfsdfs_clp(inode); in client_states_open()
2617 if (!clp) in client_states_open()
2624 s->private = clp; in client_states_open()
2631 struct nfs4_client *clp = m->private; in client_opens_release() local
2634 drop_client(clp); in client_opens_release()
2651 static void force_expire_client(struct nfs4_client *clp) in force_expire_client() argument
2653 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in force_expire_client()
2657 clp->cl_time = 0; in force_expire_client()
2660 wait_event(expiry_wq, atomic_read(&clp->cl_rpc_users) == 0); in force_expire_client()
2662 already_expired = list_empty(&clp->cl_lru); in force_expire_client()
2664 unhash_client_locked(clp); in force_expire_client()
2668 expire_client(clp); in force_expire_client()
2670 wait_event(expiry_wq, clp->cl_nfsd_dentry == NULL); in force_expire_client()
2677 struct nfs4_client *clp; in client_ctl_write() local
2684 clp = get_nfsdfs_clp(file_inode(file)); in client_ctl_write()
2685 if (!clp) in client_ctl_write()
2687 force_expire_client(clp); in client_ctl_write()
2688 drop_client(clp); in client_ctl_write()
2707 struct nfs4_client *clp; in create_client() local
2713 clp = alloc_client(name); in create_client()
2714 if (clp == NULL) in create_client()
2717 ret = copy_cred(&clp->cl_cred, &rqstp->rq_cred); in create_client()
2719 free_client(clp); in create_client()
2722 gen_clid(clp, nn); in create_client()
2723 kref_init(&clp->cl_nfsdfs.cl_ref); in create_client()
2724 nfsd4_init_cb(&clp->cl_cb_null, clp, NULL, NFSPROC4_CLNT_CB_NULL); in create_client()
2725 clp->cl_time = ktime_get_boottime_seconds(); in create_client()
2726 clear_bit(0, &clp->cl_cb_slot_busy); in create_client()
2727 copy_verf(clp, verf); in create_client()
2728 memcpy(&clp->cl_addr, sa, sizeof(struct sockaddr_storage)); in create_client()
2729 clp->cl_cb_session = NULL; in create_client()
2730 clp->net = net; in create_client()
2731 clp->cl_nfsd_dentry = nfsd_client_mkdir(nn, &clp->cl_nfsdfs, in create_client()
2732 clp->cl_clientid.cl_id - nn->clientid_base, in create_client()
2734 if (!clp->cl_nfsd_dentry) { in create_client()
2735 free_client(clp); in create_client()
2738 return clp; in create_client()
2745 struct nfs4_client *clp; in add_clp_to_name_tree() local
2748 clp = rb_entry(*new, struct nfs4_client, cl_namenode); in add_clp_to_name_tree()
2751 if (compare_blob(&clp->cl_name, &new_clp->cl_name) > 0) in add_clp_to_name_tree()
2766 struct nfs4_client *clp; in find_clp_in_name_tree() local
2769 clp = rb_entry(node, struct nfs4_client, cl_namenode); in find_clp_in_name_tree()
2770 cmp = compare_blob(&clp->cl_name, name); in find_clp_in_name_tree()
2776 return clp; in find_clp_in_name_tree()
2782 add_to_unconfirmed(struct nfs4_client *clp) in add_to_unconfirmed() argument
2785 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in add_to_unconfirmed()
2789 clear_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags); in add_to_unconfirmed()
2790 add_clp_to_name_tree(clp, &nn->unconf_name_tree); in add_to_unconfirmed()
2791 idhashval = clientid_hashval(clp->cl_clientid.cl_id); in add_to_unconfirmed()
2792 list_add(&clp->cl_idhash, &nn->unconf_id_hashtbl[idhashval]); in add_to_unconfirmed()
2793 renew_client_locked(clp); in add_to_unconfirmed()
2797 move_to_confirmed(struct nfs4_client *clp) in move_to_confirmed() argument
2799 unsigned int idhashval = clientid_hashval(clp->cl_clientid.cl_id); in move_to_confirmed()
2800 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); in move_to_confirmed()
2804 dprintk("NFSD: move_to_confirm nfs4_client %p\n", clp); in move_to_confirmed()
2805 list_move(&clp->cl_idhash, &nn->conf_id_hashtbl[idhashval]); in move_to_confirmed()
2806 rb_erase(&clp->cl_namenode, &nn->unconf_name_tree); in move_to_confirmed()
2807 add_clp_to_name_tree(clp, &nn->conf_name_tree); in move_to_confirmed()
2808 set_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags); in move_to_confirmed()
2809 renew_client_locked(clp); in move_to_confirmed()
2815 struct nfs4_client *clp; in find_client_in_id_table() local
2818 list_for_each_entry(clp, &tbl[idhashval], cl_idhash) { in find_client_in_id_table()
2819 if (same_clid(&clp->cl_clientid, clid)) { in find_client_in_id_table()
2820 if ((bool)clp->cl_minorversion != sessions) in find_client_in_id_table()
2822 renew_client_locked(clp); in find_client_in_id_table()
2823 return clp; in find_client_in_id_table()
2847 static bool clp_used_exchangeid(struct nfs4_client *clp) in clp_used_exchangeid() argument
2849 return clp->cl_exchange_flags != 0; in clp_used_exchangeid()
2867 gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se, struct svc_rqst *rqstp) in gen_callback() argument
2869 struct nfs4_cb_conn *conn = &clp->cl_cb_conn; in gen_callback()
2884 conn->cb_addrlen = rpc_uaddr2sockaddr(clp->net, se->se_callback_addr_val, in gen_callback()
2898 trace_nfsd_cb_args(clp, conn); in gen_callback()
2903 trace_nfsd_cb_nodelegs(clp); in gen_callback()
3024 static bool client_has_openowners(struct nfs4_client *clp) in client_has_openowners() argument
3028 list_for_each_entry(oo, &clp->cl_openowners, oo_perclient) { in client_has_openowners()
3035 static bool client_has_state(struct nfs4_client *clp) in client_has_state() argument
3037 return client_has_openowners(clp) in client_has_state()
3039 || !list_empty(&clp->cl_lo_states) in client_has_state()
3041 || !list_empty(&clp->cl_delegations) in client_has_state()
3042 || !list_empty(&clp->cl_sessions) in client_has_state()
3043 || !list_empty(&clp->async_copies); in client_has_state()
3046 static __be32 copy_impl_id(struct nfs4_client *clp, in copy_impl_id() argument
3051 xdr_netobj_dup(&clp->cl_nii_domain, &exid->nii_domain, GFP_KERNEL); in copy_impl_id()
3052 if (!clp->cl_nii_domain.data) in copy_impl_id()
3054 xdr_netobj_dup(&clp->cl_nii_name, &exid->nii_name, GFP_KERNEL); in copy_impl_id()
3055 if (!clp->cl_nii_name.data) in copy_impl_id()
3057 clp->cl_nii_time = exid->nii_time; in copy_impl_id()
3524 struct nfs4_client *clp = session->se_client; in nfsd4_match_existing_connection() local
3530 spin_lock(&clp->cl_lock); in nfsd4_match_existing_connection()
3544 spin_unlock(&clp->cl_lock); in nfsd4_match_existing_connection()
3649 struct nfs4_client *clp = ses->se_client; in nfsd4_sequence_check_conn() local
3654 spin_lock(&clp->cl_lock); in nfsd4_sequence_check_conn()
3659 if (clp->cl_mach_cred) in nfsd4_sequence_check_conn()
3662 spin_unlock(&clp->cl_lock); in nfsd4_sequence_check_conn()
3669 spin_unlock(&clp->cl_lock); in nfsd4_sequence_check_conn()
3730 struct nfs4_client *clp; in nfsd4_sequence() local
3753 clp = session->se_client; in nfsd4_sequence()
3786 cstate->clp = clp; in nfsd4_sequence()
3821 cstate->clp = clp; in nfsd4_sequence()
3824 switch (clp->cl_cb_state) { in nfsd4_sequence()
3834 if (!list_empty(&clp->cl_revoked)) in nfsd4_sequence()
3858 } else if (cs->clp) in nfsd4_sequence_done()
3859 put_client_renew(cs->clp); in nfsd4_sequence_done()
3869 struct nfs4_client *clp = NULL; in nfsd4_destroy_clientid() local
3886 clp = conf; in nfsd4_destroy_clientid()
3888 clp = unconf; in nfsd4_destroy_clientid()
3893 if (!nfsd4_mach_creds_match(clp, rqstp)) { in nfsd4_destroy_clientid()
3894 clp = NULL; in nfsd4_destroy_clientid()
3898 unhash_client_locked(clp); in nfsd4_destroy_clientid()
3901 if (clp) in nfsd4_destroy_clientid()
3902 expire_client(clp); in nfsd4_destroy_clientid()
4195 … void *alloc_stateowner(struct kmem_cache *slab, struct xdr_netobj *owner, struct nfs4_client *clp) in alloc_stateowner() argument
4210 sop->so_client = clp; in alloc_stateowner()
4216 static void hash_openowner(struct nfs4_openowner *oo, struct nfs4_client *clp, unsigned int strhash… in hash_openowner() argument
4218 lockdep_assert_held(&clp->cl_lock); in hash_openowner()
4221 &clp->cl_ownerstr_hashtbl[strhashval]); in hash_openowner()
4222 list_add(&oo->oo_perclient, &clp->cl_openowners); in hash_openowner()
4316 struct nfs4_client *clp = cstate->clp; in alloc_init_open_stateowner() local
4319 oo = alloc_stateowner(openowner_slab, &open->op_owner, clp); in alloc_init_open_stateowner()
4331 spin_lock(&clp->cl_lock); in alloc_init_open_stateowner()
4332 ret = find_openstateowner_str_locked(strhashval, open, clp); in alloc_init_open_stateowner()
4334 hash_openowner(oo, clp, strhashval); in alloc_init_open_stateowner()
4339 spin_unlock(&clp->cl_lock); in alloc_init_open_stateowner()
4624 struct nfs4_client *clp; in nfsd_breaker_owns_lease() local
4632 clp = *(rqst->rq_lease_breaker); in nfsd_breaker_owns_lease()
4633 return dl->dl_stid.sc_client == clp; in nfsd_breaker_owns_lease()
4670 if (cstate->clp) { in lookup_clientid()
4671 found = cstate->clp; in lookup_clientid()
4696 cstate->clp = found; in lookup_clientid()
4705 struct nfs4_client *clp = NULL; in nfsd4_process_open1() local
4723 clp = cstate->clp; in nfsd4_process_open1()
4726 oo = find_openstateowner_str(strhashval, open, clp); in nfsd4_process_open1()
4747 open->op_stp = nfs4_alloc_open_stateid(clp); in nfsd4_process_open1()
4753 open->op_odstate = alloc_clnt_odstate(clp); in nfsd4_process_open1()
4950 static bool nfsd4_cb_channel_good(struct nfs4_client *clp) in nfsd4_cb_channel_good() argument
4952 if (clp->cl_cb_state == NFSD4_CB_UP) in nfsd4_cb_channel_good()
4959 return clp->cl_minorversion && clp->cl_cb_state == NFSD4_CB_UNKNOWN; in nfsd4_cb_channel_good()
4981 nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, in nfs4_set_delegation() argument
5005 if (nfs4_delegation_exists(clp, fp)) in nfs4_set_delegation()
5023 dp = alloc_init_deleg(clp, fp, fh, odstate); in nfs4_set_delegation()
5093 struct nfs4_client *clp = stp->st_stid.sc_client; in nfs4_open_delegation() local
5113 if (locks_in_grace(clp->net)) in nfs4_open_delegation()
5132 dp = nfs4_set_delegation(clp, fh, stp->st_stid.sc_file, stp->st_clnt_odstate); in nfs4_open_delegation()
5305 struct nfs4_client *clp; in nfsd4_renew() local
5313 clp = cstate->clp; in nfsd4_renew()
5315 if (!list_empty(&clp->cl_delegations) in nfsd4_renew()
5316 && clp->cl_cb_state != NFSD4_CB_UP) in nfsd4_renew()
5384 struct nfs4_client *clp; in nfs4_laundromat() local
5414 clp = list_entry(pos, struct nfs4_client, cl_lru); in nfs4_laundromat()
5415 if (clp->cl_time > cutoff) { in nfs4_laundromat()
5416 t = clp->cl_time - cutoff; in nfs4_laundromat()
5420 if (mark_client_expired_locked(clp)) { in nfs4_laundromat()
5421 trace_nfsd_clid_expired(&clp->cl_clientid); in nfs4_laundromat()
5424 list_add(&clp->cl_lru, &reaplist); in nfs4_laundromat()
5428 clp = list_entry(pos, struct nfs4_client, cl_lru); in nfs4_laundromat()
5429 trace_nfsd_clid_purged(&clp->cl_clientid); in nfs4_laundromat()
5430 list_del_init(&clp->cl_lru); in nfs4_laundromat()
5431 expire_client(clp); in nfs4_laundromat()
5705 *s = find_stateid_by_type(cstate->clp, stateid, typemask); in nfsd4_lookup_stateid()
5792 struct nfs4_client *clp, in manage_cpntf_state() argument
5809 if (!clp) in manage_cpntf_state()
5818 if (!clp && state) in manage_cpntf_state()
5842 put_client_renew(cstate.clp); in find_cpntf_state()
6209 struct nfs4_client *clp = s->st_stid.sc_client; in nfsd4_close_open_stateid() local
6214 spin_lock(&clp->cl_lock); in nfsd4_close_open_stateid()
6217 if (clp->cl_minorversion) { in nfsd4_close_open_stateid()
6220 spin_unlock(&clp->cl_lock); in nfsd4_close_open_stateid()
6222 nfs4_free_cpntf_statelist(clp->net, &stp->st_stid); in nfsd4_close_open_stateid()
6225 spin_unlock(&clp->cl_lock); in nfsd4_close_open_stateid()
6228 move_to_close_lru(s, clp->net); in nfsd4_close_open_stateid()
6427 find_lockowner_str_locked(struct nfs4_client *clp, struct xdr_netobj *owner) in find_lockowner_str_locked() argument
6432 lockdep_assert_held(&clp->cl_lock); in find_lockowner_str_locked()
6434 list_for_each_entry(so, &clp->cl_ownerstr_hashtbl[strhashval], in find_lockowner_str_locked()
6445 find_lockowner_str(struct nfs4_client *clp, struct xdr_netobj *owner) in find_lockowner_str() argument
6449 spin_lock(&clp->cl_lock); in find_lockowner_str()
6450 lo = find_lockowner_str_locked(clp, owner); in find_lockowner_str()
6451 spin_unlock(&clp->cl_lock); in find_lockowner_str()
6480 alloc_init_lock_stateowner(unsigned int strhashval, struct nfs4_client *clp, in alloc_init_lock_stateowner() argument
6486 lo = alloc_stateowner(lockowner_slab, &lock->lk_new_owner, clp); in alloc_init_lock_stateowner()
6494 spin_lock(&clp->cl_lock); in alloc_init_lock_stateowner()
6495 ret = find_lockowner_str_locked(clp, &lock->lk_new_owner); in alloc_init_lock_stateowner()
6498 &clp->cl_ownerstr_hashtbl[strhashval]); in alloc_init_lock_stateowner()
6503 spin_unlock(&clp->cl_lock); in alloc_init_lock_stateowner()
6531 struct nfs4_client *clp = lo->lo_owner.so_client; in init_lock_stateid() local
6537 spin_lock(&clp->cl_lock); in init_lock_stateid()
6556 spin_unlock(&clp->cl_lock); in init_lock_stateid()
6559 spin_unlock(&clp->cl_lock); in init_lock_stateid()
6568 spin_unlock(&clp->cl_lock); in init_lock_stateid()
6581 struct nfs4_client *clp = oo->oo_owner.so_client; in find_or_create_lock_stateid() local
6584 spin_lock(&clp->cl_lock); in find_or_create_lock_stateid()
6586 spin_unlock(&clp->cl_lock); in find_or_create_lock_stateid()
6592 ns = nfs4_alloc_stid(clp, stateid_slab, nfs4_free_lock_stateid); in find_or_create_lock_stateid()
6963 lo = find_lockowner_str(cstate->clp, &lockt->lt_owner); in nfsd4_lockt()
7111 struct nfs4_client *clp; in nfsd4_release_lockowner() local
7121 clp = cstate->clp; in nfsd4_release_lockowner()
7123 spin_lock(&clp->cl_lock); in nfsd4_release_lockowner()
7124 list_for_each_entry(sop, &clp->cl_ownerstr_hashtbl[hashval], in nfsd4_release_lockowner()
7131 spin_unlock(&clp->cl_lock); in nfsd4_release_lockowner()
7140 spin_unlock(&clp->cl_lock); in nfsd4_release_lockowner()
7152 spin_unlock(&clp->cl_lock); in nfsd4_release_lockowner()
7261 if (test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &cstate->clp->cl_flags)) in nfs4_check_open_reclaim()
7264 if (nfsd4_client_record_check(cstate->clp)) in nfs4_check_open_reclaim()
7351 struct nfs4_client *clp = NULL; in nfs4_state_destroy_net() local
7356 clp = list_entry(nn->conf_id_hashtbl[i].next, struct nfs4_client, cl_idhash); in nfs4_state_destroy_net()
7357 destroy_client(clp); in nfs4_state_destroy_net()
7365 clp = list_entry(nn->unconf_id_hashtbl[i].next, struct nfs4_client, cl_idhash); in nfs4_state_destroy_net()
7366 destroy_client(clp); in nfs4_state_destroy_net()