From: Andrew Deason Date: Thu, 17 Mar 2011 21:32:00 +0000 (-0500) Subject: libafs: Do not osi_FlushPages for dirs X-Git-Tag: upstream/1.6.0.pre6^2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5dac29b0fd07e22d2e145912588858c81f202061;p=packages%2Fo%2Fopenafs.git libafs: Do not osi_FlushPages for dirs Directory contents are never mapped or stored in pages, so dealing with page invalidation on directories is just overhead. So make osi_FlushPages a no-op when we're given a directory, which can avoid a lot of locks and other processing (particularly when we are called in afs_getattr in BOZONLOCK_ENV). Reviewed-on: http://gerrit.openafs.org/4259 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit a6f18413edceed1b0d532005eb62cb1886e7a6f3) Change-Id: I48dafa5fb442cfc92fb673f2b26e1034fc44c0c7 Reviewed-on: http://gerrit.openafs.org/4730 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_osi_vm.c b/src/afs/afs_osi_vm.c index c26df6d6b..66071ac9b 100644 --- a/src/afs/afs_osi_vm.c +++ b/src/afs/afs_osi_vm.c @@ -58,6 +58,11 @@ osi_FlushPages(struct vcache *avc, afs_ucred_t *credp) * citi-tr-01-3. */ #endif + if (vType(avc) == VDIR) { + /* not applicable to directories; they're never mapped or stored in + * pages */ + return; + } ObtainReadLock(&avc->lock); /* If we've already purged this version, or if we're the ones * writing this version, don't flush it (could lose the