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

Run gofmt.

parent 4a79a89d
......@@ -64,11 +64,11 @@ func (me *HandleMap) Register(obj *Handled) (handle uint64) {
if unsafe.Sizeof(obj) == 8 {
me.nextFree = me.nextFree & (1<<(64-48+3) - 1)
rest := (handle &^ (1<<48 - 1))
rest := (handle &^ (1<<48 - 1))
if rest != 0 {
panic("more than 48 bits in address")
}
if handle & 0x7 != 0 {
if handle&0x7 != 0 {
panic("unaligned ptr")
}
handle >>= 3
......
......@@ -657,4 +657,3 @@ func TestIoctl(t *testing.T) {
v, e := ioctl(f.Fd(), 0x5401, 42)
fmt.Println("ioctl", v, e)
}
......@@ -8,13 +8,13 @@ import (
"path/filepath"
"io/ioutil"
)
func TestMountOnExisting(t *testing.T) {
ts := new(testCase)
ts.Setup(t)
defer ts.Cleanup()
err := os.Mkdir(ts.mountPoint + "/mnt", 0777)
err := os.Mkdir(ts.mountPoint+"/mnt", 0777)
CheckSuccess(err)
fs := &DefaultFileSystem{}
code := ts.connector.Mount("/mnt", fs, nil)
......@@ -39,7 +39,7 @@ func TestUnmountNoExist(t *testing.T) {
if code != EINVAL {
t.Fatal("expect EINVAL", code)
}
}
}
func TestMountRename(t *testing.T) {
ts := new(testCase)
......@@ -80,9 +80,9 @@ func TestRecursiveMount(t *testing.T) {
ts.Setup(t)
defer ts.Cleanup()
err := ioutil.WriteFile(ts.origDir + "/hello.txt", []byte("blabla"), 0644)
err := ioutil.WriteFile(ts.origDir+"/hello.txt", []byte("blabla"), 0644)
CheckSuccess(err)
fs := NewLoopbackFileSystem(ts.origDir)
code := ts.connector.Mount("/mnt", fs, nil)
if !code.Ok() {
......
......@@ -108,7 +108,7 @@ type inode struct {
Handled
// Constant during lifetime.
NodeId uint64
NodeId uint64
// Number of open files and its protection.
OpenCountMutex sync.Mutex
......@@ -174,8 +174,8 @@ func (me *inode) GetMountDirEntries() (out []DirEntry) {
for k, _ := range me.Mounts {
out = append(out, DirEntry{
Name: k,
Mode: S_IFDIR,
Name: k,
Mode: S_IFDIR,
})
}
return out
......
......@@ -141,7 +141,7 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u
}
de := &Dir{
extra: node.GetMountDirEntries(),
extra: node.GetMountDirEntries(),
stream: stream,
}
h := mount.registerFileHandle(node, de, nil, input.Flags)
......
......@@ -74,7 +74,7 @@ func TestAutoFsSymlink(t *testing.T) {
err := os.Mkdir(wd+"/store/backing1", 0755)
CheckSuccess(err)
os.Symlink(wd+"/ro", wd+"/store/backing1/READONLY")
CheckSuccess(err)
......@@ -89,7 +89,7 @@ func TestAutoFsSymlink(t *testing.T) {
if len(entries) != 3 {
t.Error("readdir mismatch", entries)
}
err = os.Remove(wd + "/mount/config/manual1")
CheckSuccess(err)
......
......@@ -36,7 +36,7 @@ func setupMzfs() (mountPoint string, cleanup func()) {
func TestMultiZipReadonly(t *testing.T) {
mountPoint, cleanup := setupMzfs()
defer cleanup()
_, err := os.Create(mountPoint + "/random")
if err == nil {
t.Error("Must fail writing in root.")
......@@ -61,7 +61,7 @@ func TestMultiZipFs(t *testing.T) {
t.Errorf("wrong names return. %v", entries)
}
err = os.Symlink(zipFile, mountPoint + "/config/zipmount")
err = os.Symlink(zipFile, mountPoint+"/config/zipmount")
CheckSuccess(err)
fi, err := os.Lstat(mountPoint + "/zipmount")
......@@ -74,24 +74,24 @@ func TestMultiZipFs(t *testing.T) {
if len(entries) != 2 {
t.Error("Expect 2 entries", entries)
}
val, err := os.Readlink(mountPoint + "/config/zipmount")
CheckSuccess(err)
if val != zipFile {
t.Errorf("expected %v got %v", zipFile, val)
}
// Check that zipfs itself works.
fi, err = os.Stat(mountPoint + "/zipmount/subdir")
CheckSuccess(err)
if !fi.IsDirectory() {
t.Error("directory type", fi)
}
}
// Removing the config dir unmount
err = os.Remove(mountPoint + "/config/zipmount")
CheckSuccess(err)
// This is ugly but necessary: We don't have ways to signal
// back to FUSE that the file disappeared.
time.Sleep(1.5e9 * testTtl)
......
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