Commit 51f7cee9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

all: run gofmt.

parent 408ce31f
......@@ -343,7 +343,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) Status {
// This operation is rare, so we kludge it to avoid
// contention.
time.Sleep(delay)
delay = delay * 2 + 1
delay = delay*2 + 1
if !c.inodeMap.Has(nodeId) {
break
}
......@@ -351,10 +351,10 @@ func (c *FileSystemConnector) Unmount(node *Inode) Status {
parentNode.mount.treeLock.Lock()
mount.treeLock.Lock()
}
mount.mountInode = nil
node.mountPoint = nil
return OK
}
......
......@@ -8,7 +8,7 @@ import (
)
// HandleMap translates objects in Go space to 64-bit handles that can
// be given out to -say- the linux kernel.
// be given out to -say- the linux kernel.
//
// The 32 bits version of this is a threadsafe wrapper around a map.
//
......
......@@ -78,7 +78,7 @@ func TestMemoryPressure(t *testing.T) {
}(i)
}
time.Sleep(100 * time.Millisecond)
state.reqMu.Lock()
bufs.lock.Lock()
created := bufs.createdBuffers + state.outstandingReadBufs
......@@ -87,7 +87,7 @@ func TestMemoryPressure(t *testing.T) {
t.Logf("Have %d read bufs", state.outstandingReadBufs)
// +1 due to batch forget?
if created > _MAX_READERS + 1 {
if created > _MAX_READERS+1 {
t.Errorf("created %d buffers, max reader %d", created, _MAX_READERS)
}
......
......@@ -6,4 +6,3 @@ import (
const syscall_O_LARGEFILE = syscall.O_LARGEFILE
const syscall_O_NOATIME = syscall.O_NOATIME
......@@ -24,22 +24,21 @@ func init() {
READ_LOCKOWNER: "LOCKOWNER",
}
initFlagNames = map[int64]string{
CAP_ASYNC_READ: "ASYNC_READ",
CAP_POSIX_LOCKS: "POSIX_LOCKS",
CAP_FILE_OPS: "FILE_OPS",
CAP_ATOMIC_O_TRUNC: "ATOMIC_O_TRUNC",
CAP_EXPORT_SUPPORT: "EXPORT_SUPPORT",
CAP_BIG_WRITES: "BIG_WRITES",
CAP_DONT_MASK: "DONT_MASK",
CAP_SPLICE_WRITE: "SPLICE_WRITE",
CAP_SPLICE_MOVE: "SPLICE_MOVE",
CAP_SPLICE_READ: "SPLICE_READ",
CAP_FLOCK_LOCKS: "FLOCK_LOCKS",
CAP_IOCTL_DIR: "IOCTL_DIR",
CAP_AUTO_INVAL_DATA: "AUTO_INVAL_DATA",
CAP_READDIRPLUS: "READDIRPLUS",
CAP_ASYNC_READ: "ASYNC_READ",
CAP_POSIX_LOCKS: "POSIX_LOCKS",
CAP_FILE_OPS: "FILE_OPS",
CAP_ATOMIC_O_TRUNC: "ATOMIC_O_TRUNC",
CAP_EXPORT_SUPPORT: "EXPORT_SUPPORT",
CAP_BIG_WRITES: "BIG_WRITES",
CAP_DONT_MASK: "DONT_MASK",
CAP_SPLICE_WRITE: "SPLICE_WRITE",
CAP_SPLICE_MOVE: "SPLICE_MOVE",
CAP_SPLICE_READ: "SPLICE_READ",
CAP_FLOCK_LOCKS: "FLOCK_LOCKS",
CAP_IOCTL_DIR: "IOCTL_DIR",
CAP_AUTO_INVAL_DATA: "AUTO_INVAL_DATA",
CAP_READDIRPLUS: "READDIRPLUS",
CAP_READDIRPLUS_AUTO: "READDIRPLUS_AUTO",
}
releaseFlagNames = map[int64]string{
RELEASE_FLUSH: "FLUSH",
......
package raw
import (
"fmt"
)
func init() {
......
package raw
import (
"fmt"
"syscall"
......
......@@ -92,8 +92,6 @@ const (
FOPEN_DIRECT_IO = (1 << 0)
FOPEN_KEEP_CACHE = (1 << 1)
FOPEN_NONSEEKABLE = (1 << 2)
)
type OpenOut struct {
......@@ -104,20 +102,20 @@ type OpenOut struct {
// To be set in InitIn/InitOut.Flags.
const (
CAP_ASYNC_READ = (1 << 0)
CAP_POSIX_LOCKS = (1 << 1)
CAP_FILE_OPS = (1 << 2)
CAP_ATOMIC_O_TRUNC = (1 << 3)
CAP_EXPORT_SUPPORT = (1 << 4)
CAP_BIG_WRITES = (1 << 5)
CAP_DONT_MASK = (1 << 6)
CAP_SPLICE_WRITE = (1 << 7)
CAP_SPLICE_MOVE = (1 << 8)
CAP_SPLICE_READ = (1 << 9)
CAP_FLOCK_LOCKS = (1 << 10)
CAP_IOCTL_DIR = (1 << 11)
CAP_AUTO_INVAL_DATA = (1 << 12)
CAP_READDIRPLUS = (1 << 13)
CAP_ASYNC_READ = (1 << 0)
CAP_POSIX_LOCKS = (1 << 1)
CAP_FILE_OPS = (1 << 2)
CAP_ATOMIC_O_TRUNC = (1 << 3)
CAP_EXPORT_SUPPORT = (1 << 4)
CAP_BIG_WRITES = (1 << 5)
CAP_DONT_MASK = (1 << 6)
CAP_SPLICE_WRITE = (1 << 7)
CAP_SPLICE_MOVE = (1 << 8)
CAP_SPLICE_READ = (1 << 9)
CAP_FLOCK_LOCKS = (1 << 10)
CAP_IOCTL_DIR = (1 << 11)
CAP_AUTO_INVAL_DATA = (1 << 12)
CAP_READDIRPLUS = (1 << 13)
CAP_READDIRPLUS_AUTO = (1 << 14)
)
......@@ -382,9 +380,9 @@ const (
)
type FallocateIn struct {
Fh uint64
Offset uint64
Length uint64
Mode uint32
Fh uint64
Offset uint64
Length uint64
Mode uint32
Padding uint32
}
package raw
type Attr struct {
Ino uint64
Size uint64
Blocks uint64
Atime uint64
Mtime uint64
Ctime uint64
Crtime_ uint64 // OS X
Atimensec uint32
Mtimensec uint32
Ctimensec uint32
Ino uint64
Size uint64
Blocks uint64
Atime uint64
Mtime uint64
Ctime uint64
Crtime_ uint64 // OS X
Atimensec uint32
Mtimensec uint32
Ctimensec uint32
Crtimensec_ uint32 // OS X
Mode uint32
Nlink uint32
Mode uint32
Nlink uint32
Owner
Rdev uint32
Flags_ uint32 // OS X
Rdev uint32
Flags_ uint32 // OS X
}
const (
FATTR_CRTIME = (1 << 28)
FATTR_CHGTIME = (1 << 29)
FATTR_BKUPTIME = (1 << 30)
FATTR_FLAGS = (1 << 31)
FATTR_CRTIME = (1 << 28)
FATTR_CHGTIME = (1 << 29)
FATTR_BKUPTIME = (1 << 30)
FATTR_FLAGS = (1 << 31)
)
type SetAttrIn struct {
......@@ -40,8 +40,8 @@ type SetAttrIn struct {
}
const (
FOPEN_PURGE_ATTR =(1 << 30)
FOPEN_PURGE_UBC = (1 << 31)
FOPEN_PURGE_ATTR = (1 << 30)
FOPEN_PURGE_UBC = (1 << 31)
)
// compat with linux.
......@@ -82,14 +82,14 @@ const (
)
type GetxtimesOut struct {
Bkuptime uint64
Crtime uint64
Bkuptime uint64
Crtime uint64
Bkuptimensec uint32
Crtimensec uint32
Crtimensec uint32
}
type ExchangeIn struct {
Olddir uint64
Newdir uint64
Options uint64
type ExchangeIn struct {
Olddir uint64
Newdir uint64
Options uint64
}
......@@ -29,19 +29,18 @@ const (
type GetAttrIn struct {
Flags_ uint32
Dummy uint32
Dummy uint32
Fh_ uint64
}
func (g *GetAttrIn) Flags() uint32 {
return g.Flags_
return g.Flags_
}
func (g *GetAttrIn) Fh() uint64 {
return g.Fh_
}
type ReadIn struct {
Fh uint64
Offset uint64
......@@ -52,7 +51,6 @@ type ReadIn struct {
Padding uint32
}
type WriteIn struct {
Fh uint64
Offset uint64
......
......@@ -11,11 +11,10 @@ type Pair struct {
}
func (p *Pair) MaxGrow() {
for p.Grow(2 * p.size) == nil {
for p.Grow(2*p.size) == nil {
}
}
func (p *Pair) Grow(n int) error {
if n <= p.size {
return nil
......@@ -63,5 +62,3 @@ func (p *Pair) WriteFd() uintptr {
func (p *Pair) Write(d []byte) (n int, err error) {
return p.w.Write(d)
}
package splice
import (
)
import ()
func (p *Pair) LoadFromAt(fd uintptr, sz int, off int64) (int, error) {
panic("not implemented")
......
......@@ -9,8 +9,8 @@ import (
"os/exec"
"path/filepath"
"regexp"
"strings"
"strconv"
"strings"
"syscall"
"testing"
"time"
......@@ -44,7 +44,9 @@ func setRecursiveWritable(t *testing.T, dir string, writable bool) {
} else {
newMode = uint32(fi.Mode().Perm()) &^ 0222
}
if fi.Mode() | os.ModeSymlink != 0 { return nil }
if fi.Mode()|os.ModeSymlink != 0 {
return nil
}
return os.Chmod(path, os.FileMode(newMode))
})
if err != nil {
......@@ -950,7 +952,7 @@ func TestUnionFsRmRf(t *testing.T) {
if err != nil {
t.Logf("ProgramVersion failed: %v", err)
}
if maj < 8 { // assuming GNU coreutils.
if maj < 8 { // assuming GNU coreutils.
t.Skipf("Skipping test; GNU rm %d.%d is not POSIX compliant.", maj, min)
}
command := fmt.Sprintf("%s -f %s/mnt/dir", bin, wd)
......
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