aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/root_node.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/root_node.go')
-rw-r--r--internal/fusefrontend/root_node.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go
index c82078d..46bee4a 100644
--- a/internal/fusefrontend/root_node.go
+++ b/internal/fusefrontend/root_node.go
@@ -50,7 +50,13 @@ type RootNode struct {
dirCache dirCache
// inoMap translates inode numbers from different devices to unique inode
// numbers.
- inoMap inomap.TranslateStater
+ inoMap *inomap.InoMap
+ // gen is the node generation numbers. Normally, it is always set to 1,
+ // but -sharestorage uses an incrementing counter for new nodes.
+ // This makes each directory entry unique (even hard links),
+ // makes go-fuse hand out separate FUSE Node IDs for each, and prevents
+ // bizarre problems when inode numbers are reused behind our back.
+ gen uint64
}
func NewRootNode(args Args, c *contentenc.ContentEnc, n *nametransform.NameTransform) *RootNode {
@@ -71,11 +77,6 @@ func NewRootNode(args Args, c *contentenc.ContentEnc, n *nametransform.NameTrans
inoMap: inomap.New(),
dirCache: dirCache{ivLen: ivLen},
}
- // In `-sharedstorage` mode we always set the inode number to zero.
- // This makes go-fuse generate a new inode number for each lookup.
- if args.SharedStorage {
- rn.inoMap = &inomap.TranslateStatZero{}
- }
return rn
}