summaryrefslogtreecommitdiff
path: root/cryptfs/names_diriv.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-02-06 12:27:09 +0100
committerJakob Unterwurzacher2016-02-06 12:27:55 +0100
commitadcfbd79a8b8bb85cbee25996ab622a05de0dbc1 (patch)
tree975b053ba075ba1d6ec5236dd580848a39334b1b /cryptfs/names_diriv.go
parent1573efec98bd96a078afdf5d1584436b07dac165 (diff)
Rename DirIVCacheEnc to just DirIVCache
...and unexport dirIVCache
Diffstat (limited to 'cryptfs/names_diriv.go')
-rw-r--r--cryptfs/names_diriv.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cryptfs/names_diriv.go b/cryptfs/names_diriv.go
index 45abfce..276316c 100644
--- a/cryptfs/names_diriv.go
+++ b/cryptfs/names_diriv.go
@@ -10,7 +10,7 @@ import (
)
// A simple one-entry DirIV cache
-type DirIVCache struct {
+type dirIVCache struct {
// Invalidated?
cleared bool
// The DirIV
@@ -24,7 +24,7 @@ type DirIVCache struct {
}
// lookup - fetch entry for "dir" from the cache
-func (c *DirIVCache) lookup(dir string) (bool, []byte, string) {
+func (c *dirIVCache) lookup(dir string) (bool, []byte, string) {
c.lock.RLock()
defer c.lock.RUnlock()
if !c.cleared && c.dir == dir {
@@ -34,7 +34,7 @@ func (c *DirIVCache) lookup(dir string) (bool, []byte, string) {
}
// store - write entry for "dir" into the caches
-func (c *DirIVCache) store(dir string, iv []byte, translatedDir string) {
+func (c *dirIVCache) store(dir string, iv []byte, translatedDir string) {
c.lock.Lock()
defer c.lock.Unlock()
c.cleared = false
@@ -43,7 +43,7 @@ func (c *DirIVCache) store(dir string, iv []byte, translatedDir string) {
c.translatedDir = translatedDir
}
-func (c *DirIVCache) Clear() {
+func (c *dirIVCache) Clear() {
c.lock.Lock()
defer c.lock.Unlock()
c.cleared = true
@@ -90,7 +90,7 @@ func (be *CryptFS) EncryptPathDirIV(plainPath string, rootDir string, eme bool)
}
// Check if the DirIV is cached
parentDir := filepath.Dir(plainPath)
- found, iv, cParentDir := be.DirIVCacheEnc.lookup(parentDir)
+ found, iv, cParentDir := be.DirIVCache.lookup(parentDir)
if found {
//fmt.Print("h")
baseName := filepath.Base(plainPath)
@@ -114,7 +114,7 @@ func (be *CryptFS) EncryptPathDirIV(plainPath string, rootDir string, eme bool)
// Cache the final DirIV
cipherPath = strings.Join(encryptedNames, "/")
cParentDir = filepath.Dir(cipherPath)
- be.DirIVCacheEnc.store(parentDir, iv, cParentDir)
+ be.DirIVCache.store(parentDir, iv, cParentDir)
return cipherPath, nil
}