/* Called from functions that handle requests; functions that do work on behalf of mountd are passed a single client name to use, and should use exp_get_by_name() or exp_find().  */
struct svc_export* rqst_exp_get_by_name(struct svc_rqst *rqstp, struct path *path)
/* Called from functions that handle requests; functions that do work on behalf of mountd are passed a single client name to use, and should use exp_get_by_name() or exp_find().  */
struct svc_export* rqst_exp_get_by_name(struct svc_rqst *rqstp, struct path *path)
{
	struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
	if (rqstp->rq_client == NULL)
		goto gss;
	exp = exp_get_by_name(rqstp->rq_client, path, &rqstp->rq_chandle);
	if (PTR_ERR(exp) == -ENOENT)
		goto gss;
	if (IS_ERR(exp))
		return exp;
	if (exp->ex_nflavors > 0)
		return exp;
gss:
	if (rqstp->rq_gssclient == NULL)
		return exp;
	gssexp = exp_get_by_name(rqstp->rq_gssclient, path, &rqstp->rq_chandle);
	if (PTR_ERR(gssexp) == -ENOENT)
		return exp;
	if (!IS_ERR(exp))
		exp_put(exp);
	return gssexp;
}