/* Returns pointer to an appropriate nlm_host struct, or an ERR_PTR value.  */
struct nlm_host* nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
/* Returns pointer to an appropriate nlm_host struct, or an ERR_PTR value.  */
struct nlm_host* nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
{
	struct nlm_host *host;
	u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4;
	int status;
	status = lockd_up();
	if (status < 0)
		return ERR_PTR(status);
	host = nlmclnt_lookup_host(nlm_init->address, nlm_init->addrlen,
				   nlm_init->protocol, nlm_version,
				   nlm_init->hostname, nlm_init->noresvport);
	if (host == NULL) {
		lockd_down();
		return ERR_PTR(-ENOLCK);
	}
	return host;
}