diff --git a/fstree/refresh.go b/fstree/refresh.go index ebf6fe5..25671e9 100644 --- a/fstree/refresh.go +++ b/fstree/refresh.go @@ -23,7 +23,7 @@ var _ = (fs.NodeOpener)((*refreshNode)(nil)) func newRefreshNode(source GroupSource, param *FSParam) *refreshNode { return &refreshNode{ - ino: <-param.staticInoChan, + ino: 0, source: source, } } diff --git a/fstree/root.go b/fstree/root.go index e044507..9a882f4 100644 --- a/fstree/root.go +++ b/fstree/root.go @@ -12,10 +12,6 @@ import ( "github.com/hanwen/go-fuse/v2/fuse" ) -const ( - staticInodeStart = uint64(int(^(uint(0))>>1)) + 1 -) - type staticNode interface { fs.InodeEmbedder Ino() uint64 @@ -35,8 +31,7 @@ type FSParam struct { GitClient GitClient GitForge GitForge - logger *slog.Logger - staticInoChan chan uint64 + logger *slog.Logger } type rootNode struct { @@ -54,13 +49,10 @@ func Start(logger *slog.Logger, mountpoint string, mountoptions []string, param opts.Debug = debug param.logger = logger - param.staticInoChan = make(chan uint64) root := &rootNode{ param: param, } - go staticInoGenerator(root.param.staticInoChan) - server, err := fs.Mount(mountpoint, root, opts) if err != nil { return fmt.Errorf("mount failed: %v", err) @@ -88,7 +80,7 @@ func (n *rootNode) OnAdd(ctx context.Context) { ctx, groupNode, fs.StableAttr{ - Ino: <-n.param.staticInoChan, + Ino: 0, Mode: fuse.S_IFDIR, }, ) @@ -98,14 +90,6 @@ func (n *rootNode) OnAdd(ctx context.Context) { n.param.logger.Info("Mounted and ready to use") } -func staticInoGenerator(staticInoChan chan<- uint64) { - i := staticInodeStart - for { - staticInoChan <- i - i++ - } -} - func signalHandler(logger *slog.Logger, signalChan <-chan os.Signal, server *fuse.Server) { err := server.WaitMount() if err != nil {