189 nfs4_shutdown_client(clp);
190
191
192 if (!IS_ERR(clp->cl_rpcclient))
193 rpc_shutdown_client(clp->cl_rpcclient);
194
195 if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
196 nfs_callback_down();
197
198 if (clp->cl_machine_cred != NULL)
199 put_rpccred(clp->cl_machine_cred);
200
201 kfree(clp->cl_hostname);
202 kfree(clp);
203
204 dprintk("<-- nfs_free_client()\n");
205}
206
207
208
209
210void nfs_put_client(struct nfs_client *clp)
211{
212 if (!clp)
213 return;
214
215 dprintk("--> nfs_put_client({%d})\n", atomic_read(&clp->cl_count));
216
217 if (atomic_dec_and_lock(&clp->cl_count, &nfs_client_lock)) {
218 list_del(&clp->cl_share_link);
219 spin_unlock(&nfs_client_lock);
220
221 BUG_ON(!list_empty(&clp->cl_superblocks));
222
223 nfs_free_client(clp);
224 }
225}
226
227static int nfs_sockaddr_match_ipaddr4(const struct sockaddr_in *sa1,
228 const struct sockaddr_in *sa2)
229{