summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file2_allocate_truncate.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-26 18:35:12 +0200
committerJakob Unterwurzacher2020-07-26 18:35:12 +0200
commit777b95f82ffea8a25b95089343b07b29378110da (patch)
tree641adf67d3969a2b87c52ef62b384f022b7362d7 /internal/fusefrontend/file2_allocate_truncate.go
parent81fb42b9124e0d8e59d67ff2072d4388ce42ff77 (diff)
v2api: delete (most) fusefrontend v1 files
All the functionality in these files has been reimplemented for the v2 api. Drop the old files.
Diffstat (limited to 'internal/fusefrontend/file2_allocate_truncate.go')
-rw-r--r--internal/fusefrontend/file2_allocate_truncate.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/fusefrontend/file2_allocate_truncate.go b/internal/fusefrontend/file2_allocate_truncate.go
index b504c50..cdda974 100644
--- a/internal/fusefrontend/file2_allocate_truncate.go
+++ b/internal/fusefrontend/file2_allocate_truncate.go
@@ -6,6 +6,7 @@ package fusefrontend
import (
"context"
"log"
+ "sync"
"syscall"
"github.com/hanwen/go-fuse/v2/fs"
@@ -14,6 +15,15 @@ import (
"github.com/rfjakob/gocryptfs/internal/tlog"
)
+// FALLOC_DEFAULT is a "normal" fallocate operation
+const FALLOC_DEFAULT = 0x00
+
+// FALLOC_FL_KEEP_SIZE allocates disk space while not modifying the file size
+const FALLOC_FL_KEEP_SIZE = 0x01
+
+// Only warn once
+var allocateWarnOnce sync.Once
+
// Allocate - FUSE call for fallocate(2)
//
// mode=FALLOC_FL_KEEP_SIZE is implemented directly.