vfs: use vrefact in getcwd and fchdir

This commit is contained in:
Mateusz Guzik 2016-12-12 19:16:35 +00:00
parent 0e638f57e6
commit 25e578de55
2 changed files with 3 additions and 3 deletions

View File

@ -2066,9 +2066,9 @@ kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen,
fdp = td->td_proc->p_fd;
FILEDESC_SLOCK(fdp);
cdir = fdp->fd_cdir;
VREF(cdir);
vrefact(cdir);
rdir = fdp->fd_rdir;
VREF(rdir);
vrefact(rdir);
FILEDESC_SUNLOCK(fdp);
error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen);
vrele(rdir);

View File

@ -754,7 +754,7 @@ sys_fchdir(td, uap)
if (error != 0)
return (error);
vp = fp->f_vnode;
VREF(vp);
vrefact(vp);
fdrop(fp, td);
vn_lock(vp, LK_SHARED | LK_RETRY);
AUDIT_ARG_VNODE1(vp);