From owner-freebsd-current Mon Oct 16 04:42:07 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id EAA05600 for current-outgoing; Mon, 16 Oct 1995 04:42:07 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id EAA05588 for ; Mon, 16 Oct 1995 04:42:01 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id VAA24539 for current@freebsd.org; Mon, 16 Oct 1995 21:38:02 +1000 Date: Mon, 16 Oct 1995 21:38:02 +1000 From: Bruce Evans Message-Id: <199510161138.VAA24539@godzilla.zeta.org.au> To: current@freebsd.org Subject: lstat flushes namei cache entry Sender: owner-current@freebsd.org Precedence: bulk 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;