patches/ipfs: patchset for 0.10.0

This commit is contained in:
Max Headroom 2021-12-02 22:14:44 +01:00
parent 40a33a1450
commit ed766b76fe
3 changed files with 1 additions and 67 deletions

View file

@ -1,23 +0,0 @@
diff --git a/fuse/mount/fuse.go b/fuse/mount/fuse.go
index c317f5e7d..6e3951757 100644
--- a/fuse/mount/fuse.go
+++ b/fuse/mount/fuse.go
@@ -33,11 +33,15 @@ func NewMount(p goprocess.Process, fsys fs.FS, mountpoint string, allow_other bo
var conn *fuse.Conn
var err error
+ var mountOpts = []fuse.MountOption{
+ fuse.MaxReadahead(64*1024*1024),
+ fuse.AsyncRead(),
+ }
+
if allow_other {
- conn, err = fuse.Mount(mountpoint, fuse.AllowOther())
- } else {
- conn, err = fuse.Mount(mountpoint)
+ mountOpts = append(mountOpts,fuse.AllowOther())
}
+ conn, err = fuse.Mount(mountpoint, mountOpts...)
if err != nil {
return nil, err

View file

@ -1,43 +0,0 @@
diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go
index 866cdca1a..3a2269393 100644
--- a/fuse/readonly/readonly_unix.go
+++ b/fuse/readonly/readonly_unix.go
@@ -73,7 +73,7 @@ func (s *Root) Lookup(ctx context.Context, name string) (fs.Node, error) {
switch nd := nd.(type) {
case *mdag.ProtoNode, *mdag.RawNode:
- return &Node{Ipfs: s.Ipfs, Nd: nd}, nil
+ return &Node{Ipfs: s.Ipfs, Nd: nd, children: make(map[string]fs.Node)}, nil
default:
log.Error("fuse node was not a protobuf node")
return nil, fuse.ENOTSUP
@@ -92,6 +92,7 @@ type Node struct {
Ipfs *core.IpfsNode
Nd ipld.Node
cached *ft.FSNode
+ children map[string]fs.Node
}
func (s *Node) loadData() error {
@@ -144,6 +145,9 @@ func (s *Node) Attr(ctx context.Context, a *fuse.Attr) error {
// Lookup performs a lookup under this node.
func (s *Node) Lookup(ctx context.Context, name string) (fs.Node, error) {
log.Debugf("Lookup '%s'", name)
+ if childNode, ok := s.children[name] ; ok {
+ return childNode, nil
+ }
link, _, err := uio.ResolveUnixfsOnce(ctx, s.Ipfs.DAG, s.Nd, []string{name})
switch err {
case os.ErrNotExist, mdag.ErrLinkNotFound:
@@ -165,8 +169,9 @@ func (s *Node) Lookup(ctx context.Context, name string) (fs.Node, error) {
case nil:
// noop
}
-
- return &Node{Ipfs: s.Ipfs, Nd: nd}, nil
+ childNode := &Node{Ipfs: s.Ipfs, Nd: nd, children: make(map[string]fs.Node)}
+ s.children[name] = childNode
+ return childNode, nil
}
// ReadDirAll reads the link structure as directory entries

View file

@ -4,7 +4,7 @@
package corehttp package corehttp
// TODO: move to IPNS // TODO: move to IPNS
-const WebUIPath = "/ipfs/bafybeiflkjt66aetfgcrgvv75izymd5kc47g6luepqmfq6zsf5w6ueth6y" // v2.12.4 -const WebUIPath = "/ipfs/bafybeihcyruaeza7uyjd6ugicbcrqumejf6uf353e5etdkhotqffwtguva" // v2.13.0
+const WebUIPath = "/ipns/webui.ipfs.privatevoid.net" +const WebUIPath = "/ipns/webui.ipfs.privatevoid.net"
// this is a list of all past webUI paths. // this is a list of all past webUI paths.