Date: Mon, 24 Aug 2020 08:55:04 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364631 - head/sys/kern Message-ID: <202008240855.07O8t45T090509@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Mon Aug 24 08:55:04 2020 New Revision: 364631 URL: https://svnweb.freebsd.org/changeset/base/364631 Log: cache: populate v_cache_dd for non-VDIR entries It makes v_cache_dd into a little bit of a misnomer and it may be addressed later. Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 08:41:22 2020 (r364630) +++ head/sys/kern/vfs_cache.c Mon Aug 24 08:55:04 2020 (r364631) @@ -2003,24 +2003,22 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } if (vp != NULL) { - if (vp->v_type == VDIR) { - if (flag != NCF_ISDOTDOT) { - /* - * For this case, the cache entry maps both the - * directory name in it and the name ".." for the - * directory's parent. - */ - vn_seqc_write_begin(vp); - if ((ndd = vp->v_cache_dd) != NULL) { - if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) - cache_zap_locked(ndd); - else - ndd = NULL; - } - vp->v_cache_dd = ncp; - vn_seqc_write_end(vp); + if (flag != NCF_ISDOTDOT) { + /* + * For this case, the cache entry maps both the + * directory name in it and the name ".." for the + * directory's parent. + */ + vn_seqc_write_begin(vp); + if ((ndd = vp->v_cache_dd) != NULL) { + if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) + cache_zap_locked(ndd); + else + ndd = NULL; } - } else { + vp->v_cache_dd = ncp; + vn_seqc_write_end(vp); + } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { vn_seqc_write_begin(vp); vp->v_cache_dd = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008240855.07O8t45T090509>