]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Upstream bazil.org/fuse changes again...
authorMatt Joiner <anacrolix@gmail.com>
Tue, 2 Jun 2015 13:59:25 +0000 (23:59 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 2 Jun 2015 13:59:25 +0000 (23:59 +1000)
fs/torrentfs.go
fs/torrentfs_test.go

index 5fcd8eea1ab79024c37a76d6f094c0c2896d257f..261dbc3870998f5a8bb44ee0b71dbc816b3c74c2 100644 (file)
@@ -70,10 +70,10 @@ type fileNode struct {
        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.Mode = defaultMode
-       return
+       return nil
 }
 
 func (n *node) fsPath() string {
@@ -230,9 +230,9 @@ func (dn dirNode) Lookup(ctx context.Context, name string) (_node fusefs.Node, e
        return
 }
 
-func (dn dirNode) Attr(attr *fuse.Attr) {
+func (dn dirNode) Attr(ctx context.Context, attr *fuse.Attr) error {
        attr.Mode = os.ModeDir | defaultMode
-       return
+       return nil
 }
 
 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
 }
 
-func (rootNode) Attr(attr *fuse.Attr) {
+func (rootNode) Attr(ctx context.Context, attr *fuse.Attr) error {
        attr.Mode = os.ModeDir
+       return nil
 }
 
 // TODO(anacrolix): Why should rootNode implement this?
index 5f77d206aeb4fa1bd95eb626124698ad11576b53..20bea21b74ba1db892305f95fe5377f4803ef340 100644 (file)
@@ -17,7 +17,8 @@ import (
 
        "bazil.org/fuse"
        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/data"
@@ -234,7 +235,7 @@ func TestDownloadOnDemand(t *testing.T) {
        root, _ := fs.Root()
        node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
        var attr fuse.Attr
-       node.Attr(&attr)
+       node.Attr(netContext.Background(), &attr)
        size := attr.Size
        resp := &fuse.ReadResponse{
                Data: make([]byte, size),