cache: use vrefact for '.' lookups and refing the rdir in fullpath

This commit is contained in:
Mateusz Guzik 2017-01-30 03:20:05 +00:00
parent 3071469d57
commit dfecf51dd0

View File

@ -1124,7 +1124,7 @@ retry:
timespecclear(tsp); timespecclear(tsp);
if (ticksp != NULL) if (ticksp != NULL)
*ticksp = ticks; *ticksp = ticks;
VREF(*vpp); vrefact(*vpp);
/* /*
* When we lookup "." we still can be asked to lock it * When we lookup "." we still can be asked to lock it
* differently... * differently...
@ -2115,7 +2115,7 @@ vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf)
fdp = td->td_proc->p_fd; fdp = td->td_proc->p_fd;
FILEDESC_SLOCK(fdp); FILEDESC_SLOCK(fdp);
rdir = fdp->fd_rdir; rdir = fdp->fd_rdir;
VREF(rdir); vrefact(rdir);
FILEDESC_SUNLOCK(fdp); FILEDESC_SUNLOCK(fdp);
error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN);
vrele(rdir); vrele(rdir);