FreeBSD/sys/kern/vfs_cache.c
/*
 * Retrieve the full filesystem path that correspond to a vnode from the name
 * cache (if available)
 */
Retrieve the full filesystem path that correspond to a vnode from the name
cache (if available)
Retrieve the full filesystem path that correspond to a vnode from the name cache ( if available )
int
vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf)
{
	char *buf;
	struct filedesc *fdp;
	struct vnode *rdir;
	int error;
	if (disablefullpath)
		return (ENODEV);
	if (vn == NULL)
		return (EINVAL);
	buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
	fdp = td->td_proc->p_fd;
	FILEDESC_SLOCK(fdp);
	rdir = fdp->fd_rdir;
	VREF(rdir);
	FILEDESC_SUNLOCK(fdp);
	error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN);
	vrele(rdir);
	if (!error)
		*freebuf = buf;
	else
		free(buf, M_TEMP);
	return (error);
}
int vn_fullpath ( struct thread * td , struct vnode * vn , char * * retbuf , char * * freebuf ) { char * buf ; struct filedesc * fdp ; struct vnode * rdir ; int error ; if ( disablefullpath ) return ( ENODEV ) ; if ( vn == NULL ) return ( EINVAL ) ; buf = malloc ( MAXPATHLEN , M_TEMP , M_WAITOK ) ; fdp = td -> td_proc -> p_fd ; FILEDESC_SLOCK ( fdp ) ; rdir = fdp -> fd_rdir ; VREF ( rdir ) ; FILEDESC_SUNLOCK ( fdp ) ; error = vn_fullpath1 ( td , vn , rdir , buf , retbuf , MAXPATHLEN ) ; vrele ( rdir ) ; if ( ! error ) * freebuf = buf ; else free ( buf , M_TEMP ) ; return ( error ) ; }
Retrieve the full filesystem path that correspond to a vnode from the name
 cache (if available)
Retrieve the full filesystem path that correspond to a vnode from the name cache ( if available )