Upstream bazil.org/fuse changes again...
This commit is contained in:
parent
5de6abd6a7
commit
9a0f830395
|
@ -70,10 +70,10 @@ type fileNode struct {
|
||||||
TorrentOffset int64
|
TorrentOffset int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fn fileNode) Attr(attr *fuse.Attr) {
|
func (fn fileNode) Attr(ctx context.Context, attr *fuse.Attr) error {
|
||||||
attr.Size = fn.size
|
attr.Size = fn.size
|
||||||
attr.Mode = defaultMode
|
attr.Mode = defaultMode
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *node) fsPath() string {
|
func (n *node) fsPath() string {
|
||||||
|
@ -230,9 +230,9 @@ func (dn dirNode) Lookup(ctx context.Context, name string) (_node fusefs.Node, e
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dn dirNode) Attr(attr *fuse.Attr) {
|
func (dn dirNode) Attr(ctx context.Context, attr *fuse.Attr) error {
|
||||||
attr.Mode = os.ModeDir | defaultMode
|
attr.Mode = os.ModeDir | defaultMode
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me rootNode) Lookup(ctx context.Context, name string) (_node fusefs.Node, err error) {
|
func (me rootNode) Lookup(ctx context.Context, name string) (_node fusefs.Node, err error) {
|
||||||
|
@ -279,8 +279,9 @@ func (me rootNode) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err e
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rootNode) Attr(attr *fuse.Attr) {
|
func (rootNode) Attr(ctx context.Context, attr *fuse.Attr) error {
|
||||||
attr.Mode = os.ModeDir
|
attr.Mode = os.ModeDir
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(anacrolix): Why should rootNode implement this?
|
// TODO(anacrolix): Why should rootNode implement this?
|
||||||
|
|
|
@ -17,7 +17,8 @@ import (
|
||||||
|
|
||||||
"bazil.org/fuse"
|
"bazil.org/fuse"
|
||||||
fusefs "bazil.org/fuse/fs"
|
fusefs "bazil.org/fuse/fs"
|
||||||
"golang.org/x/net/context"
|
"github.com/gorilla/context"
|
||||||
|
netContext "golang.org/x/net/context"
|
||||||
|
|
||||||
"github.com/anacrolix/torrent"
|
"github.com/anacrolix/torrent"
|
||||||
"github.com/anacrolix/torrent/data"
|
"github.com/anacrolix/torrent/data"
|
||||||
|
@ -234,7 +235,7 @@ func TestDownloadOnDemand(t *testing.T) {
|
||||||
root, _ := fs.Root()
|
root, _ := fs.Root()
|
||||||
node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
|
node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
|
||||||
var attr fuse.Attr
|
var attr fuse.Attr
|
||||||
node.Attr(&attr)
|
node.Attr(netContext.Background(), &attr)
|
||||||
size := attr.Size
|
size := attr.Size
|
||||||
resp := &fuse.ReadResponse{
|
resp := &fuse.ReadResponse{
|
||||||
Data: make([]byte, size),
|
Data: make([]byte, size),
|
||||||
|
|
Loading…
Reference in New Issue