aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/root_node.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-06-21 12:42:18 +0200
committerJakob Unterwurzacher2020-06-21 12:42:18 +0200
commitebdf58b9ebf366ac6dbf500c0f4f4d211451bb44 (patch)
treed30c80ae667d844ce0081820b9b07e48940d4cf0 /internal/fusefrontend/root_node.go
parent77632b7554000f2e832a0e9fded1a3894b2502c3 (diff)
v2api: implement GetAttr and Readdir
Diffstat (limited to 'internal/fusefrontend/root_node.go')
-rw-r--r--internal/fusefrontend/root_node.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go
new file mode 100644
index 0000000..94fd021
--- /dev/null
+++ b/internal/fusefrontend/root_node.go
@@ -0,0 +1,24 @@
+package fusefrontend
+
+import (
+ "time"
+
+ "github.com/rfjakob/gocryptfs/internal/tlog"
+)
+
+// reportMitigatedCorruption is used to report a corruption that was transparently
+// mitigated and did not return an error to the user. Pass the name of the corrupt
+// item (filename for OpenDir(), xattr name for ListXAttr() etc).
+// See the MitigatedCorruptions channel for more info.
+func (rn *RootNode) reportMitigatedCorruption(item string) {
+ if rn.MitigatedCorruptions == nil {
+ return
+ }
+ select {
+ case rn.MitigatedCorruptions <- item:
+ case <-time.After(1 * time.Second):
+ tlog.Warn.Printf("BUG: reportCorruptItem: timeout")
+ //debug.PrintStack()
+ return
+ }
+}