mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-11 03:09:41 +08:00
Without this, all entries will have nlink==0, which confuses a bunch of tools. Most dramatically, systemd-nspawn enters a busy loop in its lock utility function. License: MIT Signed-off-by: Tommi Virtanen <tv@eagain.net>
29 lines
621 B
Go
29 lines
621 B
Go
// +build !nofuse
|
|
|
|
package ipns
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
)
|
|
|
|
type Link struct {
|
|
Target string
|
|
}
|
|
|
|
func (l *Link) Attr(ctx context.Context, a *fuse.Attr) error {
|
|
log.Debug("Link attr.")
|
|
a.Mode = os.ModeSymlink | 0555
|
|
return nil
|
|
}
|
|
|
|
func (l *Link) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error) {
|
|
log.Debugf("ReadLink: %s", l.Target)
|
|
return l.Target, nil
|
|
}
|
|
|
|
var _ fs.NodeReadlinker = (*Link)(nil)
|