[ARVADOS] updated: 1.1.2-34-gf805036
Git user
git at public.curoverse.com
Wed Jan 3 09:19:07 EST 2018
Summary of changes:
cmd/arvados-client/cmd.go | 3 +++
lib/mount/command.go | 16 ++++++++++++----
sdk/go/arvados/fs_base.go | 12 +++++++++++-
sdk/go/arvados/fs_collection.go | 15 ++++++---------
4 files changed, 32 insertions(+), 14 deletions(-)
via f805036cee9d8316b609fa4d73b46d3e1a14ab16 (commit)
via 56ff8f92f0028b1274db9f66c291f52b6492ccb1 (commit)
from 9c6b4501a9c1c686ecac72fed5026686171d9d29 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit f805036cee9d8316b609fa4d73b46d3e1a14ab16
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Wed Jan 3 03:27:36 2018 -0500
12308: Move SetParent() responsibility from Child() to caller.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/go/arvados/fs_base.go b/sdk/go/arvados/fs_base.go
index 419be7f..fd8c18b 100644
--- a/sdk/go/arvados/fs_base.go
+++ b/sdk/go/arvados/fs_base.go
@@ -103,6 +103,14 @@ type inode interface {
// the child inode is replaced with the one returned by
// replace().
//
+ // If replace(x) returns an inode (besides x or nil) that is
+ // subsequently returned by Child(), then Child()'s caller
+ // must ensure the new child's name and parent are set/updated
+ // to Child()'s name argument and its receiver respectively.
+ // This is not necessarily done before replace(x) returns, but
+ // it must be done before Child()'s caller releases the
+ // parent's lock.
+ //
// Nil represents "no child". replace(nil) signifies that no
// child with this name exists yet. If replace() returns nil,
// the existing child should be deleted if possible.
@@ -232,7 +240,6 @@ func (n *treenode) Child(name string, replace func(inode) inode) (child inode) {
if newchild == nil {
delete(n.inodes, name)
} else if newchild != child {
- newchild.SetParent(n, name)
n.inodes[name] = newchild
n.fileinfo.modTime = time.Now()
child = newchild
@@ -323,6 +330,7 @@ func (fs *fileSystem) openFile(name string, flag int, perm os.FileMode) (*fileha
var err error
n = parent.Child(name, func(inode) inode {
n, err = parent.FS().newNode(name, perm|0755, time.Now())
+ n.SetParent(parent, name)
return n
})
if err != nil {
@@ -371,6 +379,7 @@ func (fs *fileSystem) Mkdir(name string, perm os.FileMode) (err error) {
}
child := n.Child(name, func(inode) (child inode) {
child, err = n.FS().newNode(name, perm|os.ModeDir, time.Now())
+ child.SetParent(n, name)
return
})
if err != nil {
@@ -464,6 +473,7 @@ func (fs *fileSystem) Rename(oldname, newname string) error {
// Leave oldinode in olddir.
return oldinode
}
+ accepted.SetParent(newdirf.inode, newname)
return nil
})
return err
diff --git a/sdk/go/arvados/fs_collection.go b/sdk/go/arvados/fs_collection.go
index 27ea904..fbd9775 100644
--- a/sdk/go/arvados/fs_collection.go
+++ b/sdk/go/arvados/fs_collection.go
@@ -532,19 +532,14 @@ func (dn *dirnode) Child(name string, replace func(inode) inode) inode {
}
data, err := json.Marshal(&coll)
if err == nil {
- data = append(data, 10)
+ data = append(data, '\n')
}
return data, err
}}
gn.SetParent(dn, name)
return gn
}
- oldchild := dn.treenode.Child(name, nil)
- child := dn.treenode.Child(name, replace)
- if child != nil && child != oldchild {
- child.SetParent(dn, name)
- }
- return child
+ return dn.treenode.Child(name, replace)
}
// sync flushes in-memory data (for all files in the tree rooted at
@@ -844,8 +839,9 @@ func (dn *dirnode) createFileAndParents(path string) (fn *filenode, err error) {
}
node.Child(name, func(child inode) inode {
if child == nil {
- node, err = node.FS().newNode(name, 0755|os.ModeDir, node.Parent().FileInfo().ModTime())
- child = node
+ child, err = node.FS().newNode(name, 0755|os.ModeDir, node.Parent().FileInfo().ModTime())
+ child.SetParent(node, name)
+ node = child
} else if !child.IsDir() {
err = ErrFileExists
} else {
@@ -861,6 +857,7 @@ func (dn *dirnode) createFileAndParents(path string) (fn *filenode, err error) {
switch child := child.(type) {
case nil:
child, err = node.FS().newNode(basename, 0755, node.FileInfo().ModTime())
+ child.SetParent(node, basename)
fn = child.(*filenode)
return child
case *filenode:
commit 56ff8f92f0028b1274db9f66c291f52b6492ccb1
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Wed Jan 3 02:40:54 2018 -0500
12308: Add "arvados-client mount" command.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/cmd/arvados-client/cmd.go b/cmd/arvados-client/cmd.go
index b616b54..c9068fb 100644
--- a/cmd/arvados-client/cmd.go
+++ b/cmd/arvados-client/cmd.go
@@ -13,6 +13,7 @@ import (
"git.curoverse.com/arvados.git/lib/cli"
"git.curoverse.com/arvados.git/lib/cmd"
+ "git.curoverse.com/arvados.git/lib/mount"
)
var (
@@ -58,6 +59,8 @@ var (
"user": cli.APICall,
"virtual_machine": cli.APICall,
"workflow": cli.APICall,
+
+ "mount": mount.Command,
})
)
diff --git a/lib/mount/command.go b/lib/mount/command.go
index 498d1c2..b8e2791 100644
--- a/lib/mount/command.go
+++ b/lib/mount/command.go
@@ -6,6 +6,7 @@ package mount
import (
"flag"
+ "io"
"log"
"os"
@@ -15,23 +16,30 @@ import (
"github.com/curoverse/cgofuse/fuse"
)
-func Run(prog string, args []string) int {
+var Command = cmd{}
+
+type cmd struct{}
+
+func (cmd) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
+ logger := log.New(stderr, prog+" ", 0)
flags := flag.NewFlagSet(args[0], flag.ContinueOnError)
ro := flags.Bool("ro", false, "read-only")
err := flags.Parse(args)
if err != nil {
- log.Print(err)
+ logger.Print(err)
return 2
}
client := arvados.NewClientFromEnv()
ac, err := arvadosclient.New(client)
if err != nil {
- log.Fatal(err)
+ logger.Print(err)
+ return 1
}
kc, err := keepclient.MakeKeepClient(ac)
if err != nil {
- log.Fatal(err)
+ logger.Print(err)
+ return 1
}
host := fuse.NewFileSystemHost(&keepFS{
Client: client,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list