]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-fakestat-access-for-nautilus-20080307
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Fri, 7 Mar 2008 17:34:08 +0000 (17:34 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 7 Mar 2008 17:34:08 +0000 (17:34 +0000)
LICENSE IPL10

in order that nautilus' .directory checks can work without stat()ing every damn
thing, do what we do for the mac, basically.

(cherry picked from commit f637b6292d3723cd2cf672ecaba6f179813ab64b)

src/afs/VNOPS/afs_vnop_access.c
src/afs/VNOPS/afs_vnop_lookup.c

index e21d757a930a4e7217ce85ba09542d112c992f2f..0db7b1a5a14064882650d6026ebba5dfeccbe247 100644 (file)
@@ -199,7 +199,16 @@ afs_access(OSI_VC_DECL(avc), register afs_int32 amode,
     if ((code = afs_InitReq(&treq, acred)))
        return code;
 
-    code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+    if (afs_fakestat_enable && avc->mvstat == 1) {
+       code = afs_TryEvalFakeStat(&avc, &fakestate, &treq);
+        if (code == 0 && avc->mvstat == 1) {
+           afs_PutFakeStat(&fakestate);
+           return 0;
+        }
+    } else {
+       code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+    }
+
     if (code) {
        afs_PutFakeStat(&fakestate);
        return code;
index 23b56423b2c28d4d497cdc507458ad743477d650..e66ac6010a67aa02282653eb6911289a29554574 100644 (file)
@@ -1140,6 +1140,11 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct AFS_UCRED
     ndp->ni_dvp = AFSTOV(adp);
 #endif /* AFS_OSF_ENV */
 
+    if (afs_fakestat_enable && adp->mvstat == 1) {
+       if (strcmp(aname, ".directory") == 0)
+           tryEvalOnly = 1;
+    }
+
 #if defined(AFS_DARWIN_ENV)
     /* Workaround for MacOSX Finder, which tries to look for
      * .DS_Store and Contents under every directory.