/* Return the path to an export point in the pseudo filesystem namespace Returned string is safe to use as long as the caller holds a reference to @exp.  */
static char* nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *stat)
/* Return the path to an export point in the pseudo filesystem namespace Returned string is safe to use as long as the caller holds a reference to @exp.  */
static char* nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *stat)
{
	struct svc_fh tmp_fh;
	char *path = NULL, *rootpath;
	size_t rootlen;
	fh_init(&tmp_fh, NFS4_FHSIZE);
	*stat = exp_pseudoroot(rqstp, &tmp_fh);
	if (*stat)
		return NULL;
	rootpath = tmp_fh.fh_export->ex_pathname;
	path = exp->ex_pathname;
	rootlen = strlen(rootpath);
	if (strncmp(path, rootpath, rootlen)) {
		dprintk("nfsd: fs_locations failed;"
			"%s is not contained in %s\n", path, rootpath);
		*stat = nfserr_notsupp;
		path = NULL;
		goto out;
	}
	path += rootlen;
out:
	fh_put(&tmp_fh);
	return path;
}