Fixes for changes to basil.org/fuse
This commit is contained in:
parent
87690e4c4c
commit
01210a4577
@ -67,7 +67,7 @@ type fileNode struct {
|
|||||||
TorrentOffset int64
|
TorrentOffset int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fn fileNode) Attr() (attr fuse.Attr) {
|
func (fn fileNode) Attr(attr *fuse.Attr) {
|
||||||
attr.Size = fn.size
|
attr.Size = fn.size
|
||||||
attr.Mode = defaultMode
|
attr.Mode = defaultMode
|
||||||
return
|
return
|
||||||
@ -232,7 +232,7 @@ 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(attr *fuse.Attr) {
|
||||||
attr.Mode = os.ModeDir | defaultMode
|
attr.Mode = os.ModeDir | defaultMode
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -279,10 +279,8 @@ func (me rootNode) ReadDir(ctx context.Context) (dirents []fuse.Dirent, err erro
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rootNode) Attr() fuse.Attr {
|
func (rootNode) Attr(attr *fuse.Attr) {
|
||||||
return fuse.Attr{
|
attr.Mode = os.ModeDir
|
||||||
Mode: os.ModeDir,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(anacrolix): Why should rootNode implement this?
|
// TODO(anacrolix): Why should rootNode implement this?
|
||||||
|
@ -230,12 +230,14 @@ func TestDownloadOnDemand(t *testing.T) {
|
|||||||
defer fs.Destroy()
|
defer fs.Destroy()
|
||||||
root, _ := fs.Root()
|
root, _ := fs.Root()
|
||||||
node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
|
node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
|
||||||
size := int(node.Attr().Size)
|
var attr fuse.Attr
|
||||||
|
node.Attr(&attr)
|
||||||
|
size := attr.Size
|
||||||
resp := &fuse.ReadResponse{
|
resp := &fuse.ReadResponse{
|
||||||
Data: make([]byte, size),
|
Data: make([]byte, size),
|
||||||
}
|
}
|
||||||
node.(fusefs.HandleReader).Read(context.Background(), &fuse.ReadRequest{
|
node.(fusefs.HandleReader).Read(context.Background(), &fuse.ReadRequest{
|
||||||
Size: size,
|
Size: int(size),
|
||||||
}, resp)
|
}, resp)
|
||||||
content := resp.Data
|
content := resp.Data
|
||||||
if string(content) != testutil.GreetingFileContents {
|
if string(content) != testutil.GreetingFileContents {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user