Cache symlinks in addition to files and directories.
PiperOrigin-RevId: 196051326 Change-Id: I4195b110e9a7d38d1ce1ed9c613971dea1be3bf0
This commit is contained in:
parent
b3bfb24991
commit
c97f0978b7
|
@ -126,9 +126,12 @@ func (s *session) Revalidate(*fs.Dirent) bool {
|
|||
|
||||
// TakeRefs takes an extra reference on dirent if possible.
|
||||
func (s *session) Keep(dirent *fs.Dirent) bool {
|
||||
// NOTE: Only cache files and directories.
|
||||
sattr := dirent.Inode.StableAttr
|
||||
return s.cachePolicy != cacheNone && (fs.IsFile(sattr) || fs.IsDir(sattr))
|
||||
if s.cachePolicy == cacheNone {
|
||||
return false
|
||||
}
|
||||
// NOTE: Only cache files, directories, and symlinks.
|
||||
return fs.IsFile(sattr) || fs.IsDir(sattr) || fs.IsSymlink(sattr)
|
||||
}
|
||||
|
||||
// ResetInodeMappings implements fs.MountSourceOperations.ResetInodeMappings.
|
||||
|
|
Loading…
Reference in New Issue