aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file2_allocate_truncate.go
diff options
context:
space:
mode:
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.