summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2001-10-21 15:52:51 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2001-10-21 15:52:51 +0000
commit45fb069ac9730a8c42265d14f9a26367c91db53f (patch)
treed8af2c3623d47b65e76c1d0e052b7e8c6ddd8209 /sys
parenteedecb60e8e3cb93f5aabb3f33d204040690140c (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_cache.c18
-rw-r--r--sys/sys/vnode.h6
2 files changed, 13 insertions, 11 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);
}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 58221812482a..37eab8093c89 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -567,8 +567,10 @@ int getnewvnode __P((enum vtagtype tag,
int lease_check __P((struct vop_lease_args *ap));
int spec_vnoperate __P((struct vop_generic_args *));
int speedup_syncer __P((void));
-int textvp_fullpath __P((struct proc *p, char **retbuf,
- char **retfreebuf));
+#define textvp_fullpath(p, rb, rfb) \
+ vn_fullpath(&(p)->p_thread, (p)->p_textvp, rb, rfb)
+int vn_fullpath __P((struct thread *td, struct vnode *vn,
+ char **retbuf, char **freebuf));
int vaccess __P((enum vtype type, mode_t file_mode, uid_t uid, gid_t gid,
mode_t acc_mode, struct ucred *cred, int *privused));
int vaccess_acl_posix1e __P((enum vtype type, uid_t file_uid,