Author: mjg
Date: Mon Aug 10 12:28:56 2020
New Revision: 364080
URL: https://svnweb.freebsd.org/changeset/base/364080

Log:
  cache: let SAVESTART passthrough
  
  The flag is only passed for non-LOOKUP ops and those fallback to the slowpath.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c   Mon Aug 10 12:05:55 2020        (r364079)
+++ head/sys/kern/vfs_cache.c   Mon Aug 10 12:28:56 2020        (r364080)
@@ -3146,7 +3146,7 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro
 
 #define CACHE_FPL_SUPPORTED_CN_FLAGS \
        (LOCKLEAF | LOCKPARENT | WANTPARENT | NOCACHE | FOLLOW | LOCKSHARED | 
SAVENAME | \
-        WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2)
+        SAVESTART | WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | 
AUDITVNODE2)
 
 #define CACHE_FPL_INTERNAL_CN_FLAGS \
        (ISDOTDOT | MAKEENTRY | ISLASTCN)
@@ -3654,7 +3654,7 @@ cache_fplookup_next(struct cache_fpl *fpl)
                /*
                 * If they want to create an entry we need to replace this one.
                 */
-               if (__predict_false(fpl->cnp->cn_nameiop == CREATE)) {
+               if (__predict_false(fpl->cnp->cn_nameiop != LOOKUP)) {
                        return (cache_fpl_partial(fpl));
                }
                negstate = NCP2NEGSTATE(ncp);
@@ -4125,6 +4125,9 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s
        fpl.ndp = ndp;
        fpl.cnp = &ndp->ni_cnd;
        MPASS(curthread == fpl.cnp->cn_thread);
+
+       if ((fpl.cnp->cn_flags & SAVESTART) != 0)
+               MPASS(fpl.cnp->cn_nameiop != LOOKUP);
 
        if (!cache_can_fplookup(&fpl)) {
                SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, 
fpl.status);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to