summaryrefslogtreecommitdiff
path: root/cryptfs/cryptfs_names.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-11-29 19:57:48 +0100
committerJakob Unterwurzacher2015-11-29 20:03:37 +0100
commit1d0a442405e8fc7a0742a8f8db2ea0f874f750a5 (patch)
treeb2ff9e44da9792f7a0abbc9abdf99f6a6e2cef2e /cryptfs/cryptfs_names.go
parent6f764b386786b92023fa696594105f702226b3ff (diff)
OpenDir performance: Read DirIV once and reuse it for all names
Formerly, we called decryptPath for every name. That resulted in a directory walk that reads in all diriv files on the way. Massive improvement for RM and LS (check performance.txt for details) VERSION UNTAR RM LS v0.4 48 5 1.5 v0.5-rc1 56 19 7 v0.5-rc1-1 54 9 4.1 <---- THIS VERSION
Diffstat (limited to 'cryptfs/cryptfs_names.go')
-rw-r--r--cryptfs/cryptfs_names.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cryptfs/cryptfs_names.go b/cryptfs/cryptfs_names.go
index 2a5f158..8f8486b 100644
--- a/cryptfs/cryptfs_names.go
+++ b/cryptfs/cryptfs_names.go
@@ -17,7 +17,7 @@ const (
)
// DecryptName - decrypt base64-encoded encrypted filename "cipherName"
-func (be *CryptFS) decryptName(cipherName string, iv []byte) (string, error) {
+func (be *CryptFS) DecryptName(cipherName string, iv []byte) (string, error) {
// Make sure relative symlinks still work after encryption
// by passing these through unchanged
@@ -91,7 +91,7 @@ func (be *CryptFS) TranslatePathZeroIV(path string, op int) (string, error) {
if op == OpEncrypt {
newPart = be.encryptName(part, zeroIV)
} else {
- newPart, err = be.decryptName(part, zeroIV)
+ newPart, err = be.DecryptName(part, zeroIV)
if err != nil {
return "", err
}