diff options
author | des <des@FreeBSD.org> | 2001-10-21 15:52:51 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-10-21 15:52:51 +0000 |
commit | e059ccc10a26586dbdabe8c2fc079b7db562bb4a (patch) | |
tree | d8af2c3623d47b65e76c1d0e052b7e8c6ddd8209 /sys/kern/vfs_cache.c | |
parent | c675cb3a129fa9f4d0bf4e9dda7f5124c0f2834d (diff) | |
download | FreeBSD-src-e059ccc10a26586dbdabe8c2fc079b7db562bb4a.zip FreeBSD-src-e059ccc10a26586dbdabe8c2fc079b7db562bb4a.tar.gz |
Convert textvp_fullpath() into the more generic vn_fullpath() which takes a
struct thread * and a struct vnode * instead of a struct proc *.
Temporarily add a textvp_fullpath macro for compatibility.
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 8301821..85bb632 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); } |