Date: Mon, 16 Oct 1995 21:38:02 +1000 From: Bruce Evans <bde@zeta.org.au> To: current@freebsd.org Subject: lstat flushes namei cache entry Message-ID: <199510161138.VAA24539@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
lstat() has been inefficient since symlinks were POSIXified. Bruce *** vfs_lookup.c~ Fri Aug 25 16:05:33 1995 --- vfs_lookup.c Mon Oct 16 21:06:30 1995 *************** *** 267,272 **** wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; if (cnp->cn_nameiop == DELETE || ! (wantparent && cnp->cn_nameiop != CREATE)) docache = 0; rdonly = cnp->cn_flags & RDONLY; --- 280,297 ---- wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; + /* + * XXX the following seems to be just to recover from not setting + * NOCACHE for the DELETE cases (unlink, rmdir and the rename + * source). In BSD4.4lite[2], docache was also cleared for the + * (wantparent && cnp->cn_nameiop == LOOKUP) case. This case + * seems to only occur for lstat and olstat, when it is wrong + * to clear docache. This case probably didn't occur before + * BSD4.4lite. LOCKPARENT was introduced for lstat to support + * the new behaviour of symlinks (attributes inherited from the + * parent. + */ if (cnp->cn_nameiop == DELETE || ! (wantparent && cnp->cn_nameiop != CREATE && ! cnp->cn_nameiop != LOOKUP)) docache = 0; rdonly = cnp->cn_flags & RDONLY;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510161138.VAA24539>