diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-10-21 15:52:51 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-10-21 15:52:51 +0000 |
| commit | 45fb069ac9730a8c42265d14f9a26367c91db53f (patch) | |
| tree | d8af2c3623d47b65e76c1d0e052b7e8c6ddd8209 /sys/kern/vfs_cache.c | |
| parent | eedecb60e8e3cb93f5aabb3f33d204040690140c (diff) | |
Notes
Diffstat (limited to 'sys/kern/vfs_cache.c')
| -rw-r--r-- | sys/kern/vfs_cache.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 830182147790..85bb63227f34 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -793,25 +793,25 @@ STATNODE(numfullpathfail4); STATNODE(numfullpathfound); int -textvp_fullpath(struct proc *p, char **retbuf, char **retfreebuf) { +vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf) +{ char *bp, *buf; int i, slash_prefixed; struct filedesc *fdp; struct namecache *ncp; - struct vnode *vp, *textvp; + struct vnode *vp; numfullpathcalls++; if (disablefullpath) return (ENODEV); - textvp = p->p_textvp; - if (textvp == NULL) + if (vn == NULL) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); bp = buf + MAXPATHLEN - 1; *bp = '\0'; - fdp = p->p_fd; + fdp = td->td_proc->p_fd; slash_prefixed = 0; - for (vp = textvp; vp != fdp->fd_rdir && vp != rootvnode;) { + for (vp = vn; vp != fdp->fd_rdir && vp != rootvnode;) { if (vp->v_flag & VROOT) { if (vp->v_mount == NULL) { /* forced unmount */ free(buf, M_TEMP); @@ -820,7 +820,7 @@ textvp_fullpath(struct proc *p, char **retbuf, char **retfreebuf) { vp = vp->v_mount->mnt_vnodecovered; continue; } - if (vp != textvp && vp->v_dd->v_id != vp->v_ddid) { + if (vp != vn && vp->v_dd->v_id != vp->v_ddid) { numfullpathfail1++; free(buf, M_TEMP); return (ENOTDIR); @@ -831,7 +831,7 @@ textvp_fullpath(struct proc *p, char **retbuf, char **retfreebuf) { free(buf, M_TEMP); return (ENOENT); } - if (vp != textvp && ncp->nc_dvp != vp->v_dd) { + if (vp != vn && ncp->nc_dvp != vp->v_dd) { numfullpathfail3++; free(buf, M_TEMP); return (EBADF); @@ -863,6 +863,6 @@ textvp_fullpath(struct proc *p, char **retbuf, char **retfreebuf) { } numfullpathfound++; *retbuf = bp; - *retfreebuf = buf; + *freebuf = buf; return (0); } |
