/* Find a client by IP address and protocol version */
struct nfs_client* nfs_find_client(const struct sockaddr *addr, u32 nfsversion)
/* Find a client by IP address and protocol version */
struct nfs_client* nfs_find_client(const struct sockaddr *addr, u32 nfsversion)
{
	struct nfs_client *clp;
	spin_lock(&nfs_client_lock);
	list_for_each_entry(clp, &nfs_client_list, cl_share_link) {
		struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;
		if (!(clp->cl_cons_state == NFS_CS_READY ||
		      clp->cl_cons_state == NFS_CS_SESSION_INITING))
			continue;
		if (clp->rpc_ops->version != nfsversion)
			continue;
		if (!nfs_sockaddr_match_ipaddr(addr, clap))
			continue;
		atomic_inc(&clp->cl_count);
		spin_unlock(&nfs_client_lock);
		return clp;
	}
	spin_unlock(&nfs_client_lock);
	return NULL;
}