aboutsummaryrefslogtreecommitdiff
path: root/cryptfs
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-12-06 15:05:52 +0100
committerJakob Unterwurzacher2015-12-06 15:05:52 +0100
commit56888d83dd50a10bad56eaa512ce0b6a2f2d41ed (patch)
tree51343937e7347dfa2d79813bbf9dee8f63168e0f /cryptfs
parentedc289fb7578036ecc7571cb0207ceac17af9eec (diff)
fallocate the space needed for the file header beforehand
This makes sure writing to a file fails early if the underlying filesystem does not support fallocate. It also prevents partial header write due to ENOSPC.
Diffstat (limited to 'cryptfs')
-rw-r--r--cryptfs/names_diriv.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/cryptfs/names_diriv.go b/cryptfs/names_diriv.go
index 3e24a73..035eac1 100644
--- a/cryptfs/names_diriv.go
+++ b/cryptfs/names_diriv.go
@@ -22,6 +22,7 @@ type DirIVCache struct {
lock sync.RWMutex
}
+// lookup - fetch entry for "dir" from the cache
func (c *DirIVCache) lookup(dir string) (bool, []byte, string) {
c.lock.RLock()
defer c.lock.RUnlock()
@@ -31,6 +32,7 @@ func (c *DirIVCache) lookup(dir string) (bool, []byte, string) {
return false, nil, ""
}
+// store - write entry for "dir" into the caches
func (c *DirIVCache) store(dir string, iv []byte, translatedDir string) {
c.lock.Lock()
defer c.lock.Unlock()