Commit cb10e93d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 8bfc931c
......@@ -18,8 +18,8 @@ func main() {
deldirname := flag.String(
"deletion_dirname", "GOUNIONFS_DELETIONS", "Directory name to use for deletions.")
hide_readonly_link := flag.Bool("hide_readonly_link", true,
"Hides READONLY link from the top mountpoints. " +
"Enabled by default.")
"Hides READONLY link from the top mountpoints. "+
"Enabled by default.")
flag.Parse()
if *version {
......@@ -48,7 +48,7 @@ func main() {
PathNodeFsOptions: fuse.PathNodeFsOptions{
ClientInodes: *hardlinks,
},
HideReadonly: *hide_readonly_link,
HideReadonly: *hide_readonly_link,
}
fmt.Printf("AutoUnionFs - Go-FUSE Version %v.\n", fuse.Version())
......
......@@ -17,7 +17,6 @@ type BufferPool interface {
}
type GcBufferPool struct {
}
// NewGcBufferPool is just a fallback to the standard allocation routines.
......
......@@ -40,7 +40,7 @@ func (me *FileSystemConnector) internalLookup(parent *Inode, name string, contex
} else {
fi, fsNode, code = parent.fsInode.Lookup(name, context)
}
if child == nil && fsNode != nil {
child = fsNode.Inode()
}
......@@ -51,7 +51,7 @@ func (me *FileSystemConnector) internalLookup(parent *Inode, name string, contex
func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *EntryOut, code Status) {
parent := me.toInode(header.NodeId)
if !parent.IsDir() {
log.Printf("Lookup %q called on non-Directory node %d", name, header.NodeId)
log.Printf("Lookup %q called on non-Directory node %d", name, header.NodeId)
return nil, ENOTDIR
}
context := &header.Context
......
......@@ -33,6 +33,7 @@ type Handled struct {
}
const _ALREADY_MSG = "Object already has a handle"
////////////////////////////////////////////////////////////////
// portable version using 32 bit integers.
......
......@@ -283,9 +283,9 @@ func TestLinkExisting(t *testing.T) {
CheckSuccess(err)
var s1, s2 syscall.Stat_t
err = syscall.Lstat(me.mnt + "/file1", &s1)
err = syscall.Lstat(me.mnt+"/file1", &s1)
CheckSuccess(err)
err = syscall.Lstat(me.mnt + "/file2", &s2)
err = syscall.Lstat(me.mnt+"/file2", &s2)
CheckSuccess(err)
if s1.Ino != s2.Ino {
......@@ -313,12 +313,12 @@ func TestLinkForget(t *testing.T) {
CheckSuccess(err)
var s1, s2 syscall.Stat_t
err = syscall.Lstat(me.mnt + "/file1", &s1)
err = syscall.Lstat(me.mnt+"/file1", &s1)
CheckSuccess(err)
me.pathFs.ForgetClientInodes()
err = syscall.Lstat(me.mnt + "/file2", &s2)
err = syscall.Lstat(me.mnt+"/file2", &s2)
CheckSuccess(err)
if s1.Ino == s2.Ino {
t.Error("After forget, we should not export links")
......
......@@ -36,11 +36,11 @@ func TestLinkAt(t *testing.T) {
}
var s1, s2 syscall.Stat_t
err := syscall.Lstat(dir + "/a", &s1)
err := syscall.Lstat(dir+"/a", &s1)
if err != nil {
t.Fatalf("Lstat a: %v", err)
}
err = syscall.Lstat(dir + "/b", &s2)
err = syscall.Lstat(dir+"/b", &s2)
if err != nil {
t.Fatalf("Lstat b: %v", err)
}
......
......@@ -166,7 +166,7 @@ func doGetXAttr(state *MountState, req *request) {
sz, code := state.fileSystem.GetXAttrSize(req.inHeader, req.filenames[0])
if code.Ok() {
out := &GetXAttrOut{
Size: uint32(sz),
Size: uint32(sz),
}
req.outData = unsafe.Pointer(out)
req.status = ERANGE
......@@ -182,7 +182,7 @@ func doGetXAttr(state *MountState, req *request) {
if len(data) > int(input.Size) {
req.status = ERANGE
}
if !req.status.Ok() {
return
}
......
......@@ -46,7 +46,7 @@ func TestOwnerDefault(t *testing.T) {
defer cleanup()
var stat syscall.Stat_t
err := syscall.Lstat(wd + "/foo", &stat)
err := syscall.Lstat(wd+"/foo", &stat)
CheckSuccess(err)
if int(stat.Uid) != os.Getuid() || int(stat.Gid) != os.Getgid() {
......@@ -59,7 +59,7 @@ func TestOwnerRoot(t *testing.T) {
defer cleanup()
var st syscall.Stat_t
err := syscall.Lstat(wd + "/foo", &st)
err := syscall.Lstat(wd+"/foo", &st)
CheckSuccess(err)
if st.Uid != _RANDOM_OWNER || st.Gid != _RANDOM_OWNER {
......@@ -72,7 +72,7 @@ func TestOwnerOverride(t *testing.T) {
defer cleanup()
var stat syscall.Stat_t
err := syscall.Lstat(wd + "/foo", &stat)
err := syscall.Lstat(wd+"/foo", &stat)
CheckSuccess(err)
if stat.Uid != 42 || stat.Gid != 43 {
......
......@@ -21,16 +21,16 @@ func init() {
RELEASE_FLUSH: "FLUSH",
}
openFlagNames = map[int]string{
os.O_WRONLY: "WRONLY",
os.O_RDWR: "RDWR",
os.O_APPEND: "APPEND",
os.O_WRONLY: "WRONLY",
os.O_RDWR: "RDWR",
os.O_APPEND: "APPEND",
syscall.O_ASYNC: "ASYNC",
os.O_CREATE: "CREAT",
os.O_EXCL: "EXCL",
os.O_CREATE: "CREAT",
os.O_EXCL: "EXCL",
syscall.O_NOCTTY: "NOCTTY",
syscall.O_NONBLOCK: "NONBLOCK",
os.O_SYNC: "SYNC",
os.O_TRUNC: "TRUNC",
os.O_SYNC: "SYNC",
os.O_TRUNC: "TRUNC",
syscall.O_CLOEXEC: "CLOEXEC",
syscall.O_DIRECT: "DIRECT",
......
......@@ -5,7 +5,6 @@ import (
"syscall"
)
const (
FUSE_ROOT_ID = 1
......
......@@ -82,7 +82,7 @@ func (me *AutoUnionFs) String() string {
func (me *AutoUnionFs) OnMount(nodeFs *fuse.PathNodeFs) {
me.nodeFs = nodeFs
if me.options.UpdateOnMount {
time.AfterFunc(100 * time.Millisecond, func() { me.updateKnownFses() })
time.AfterFunc(100*time.Millisecond, func() { me.updateKnownFses() })
}
}
......@@ -356,9 +356,9 @@ func (me *AutoUnionFs) DebugData() string {
}
setting := me.mountState.KernelSettings()
msg := fmt.Sprintf(
"Version: %v\n" +
"Bufferpool: %v\n" +
"Kernel: %v\n",
"Version: %v\n"+
"Bufferpool: %v\n"+
"Kernel: %v\n",
fuse.Version(),
me.mountState.BufferPoolStats(),
&setting)
......
......@@ -14,7 +14,6 @@ import (
"time"
)
func filePathHash(path string) string {
dir, base := filepath.Split(path)
......
......@@ -26,7 +26,7 @@ var testOpts = UnionFsOptions{
DeletionCacheTTL: entryTtl,
DeletionDirName: "DELETIONS",
BranchCacheTTL: entryTtl,
HiddenFiles: []string{ "hidden" },
HiddenFiles: []string{"hidden"},
}
func freezeRo(dir string) {
......@@ -64,8 +64,8 @@ func setupUfs(t *testing.T) (workdir string, cleanup func()) {
// We configure timeouts are smaller, so we can check for
// UnionFs's cache consistency.
opts := &fuse.FileSystemOptions{
EntryTimeout: entryTtl / 2,
AttrTimeout: entryTtl / 2,
EntryTimeout: entryTtl / 2,
AttrTimeout: entryTtl / 2,
NegativeTimeout: entryTtl / 2,
}
......@@ -302,7 +302,7 @@ func TestUnionFsBasic(t *testing.T) {
names = dirNames(wd + "/rw")
checkMapEq(t, names, map[string]bool{
testOpts.DeletionDirName: true,
"rw": true, "ro1": true,
"rw": true, "ro1": true,
})
names = dirNames(wd + "/rw/" + testOpts.DeletionDirName)
if len(names) != 0 {
......@@ -763,7 +763,7 @@ func TestUnionFsRmRf(t *testing.T) {
bin, err := exec.LookPath("rm")
CheckSuccess(err)
command := fmt.Sprintf("%s -f %s/mnt/dir", bin, wd);
command := fmt.Sprintf("%s -f %s/mnt/dir", bin, wd)
log.Printf("Command: %s", command)
names, _ := Readdirnames(wd + "/mnt/dir")
log.Printf("Contents of %s/mnt/dir: %s", wd, strings.Join(names, ", "))
......@@ -886,8 +886,8 @@ func TestUnionFsDisappearing(t *testing.T) {
ufs := NewUnionFs(fses, testOpts)
opts := &fuse.FileSystemOptions{
EntryTimeout: entryTtl,
AttrTimeout: entryTtl,
EntryTimeout: entryTtl,
AttrTimeout: entryTtl,
NegativeTimeout: entryTtl,
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment