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 { ...@@ -343,7 +343,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) Status {
// This operation is rare, so we kludge it to avoid // This operation is rare, so we kludge it to avoid
// contention. // contention.
time.Sleep(delay) time.Sleep(delay)
delay = delay * 2 + 1 delay = delay*2 + 1
if !c.inodeMap.Has(nodeId) { if !c.inodeMap.Has(nodeId) {
break break
} }
......
...@@ -87,7 +87,7 @@ func TestMemoryPressure(t *testing.T) { ...@@ -87,7 +87,7 @@ func TestMemoryPressure(t *testing.T) {
t.Logf("Have %d read bufs", state.outstandingReadBufs) t.Logf("Have %d read bufs", state.outstandingReadBufs)
// +1 due to batch forget? // +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) t.Errorf("created %d buffers, max reader %d", created, _MAX_READERS)
} }
......
...@@ -6,4 +6,3 @@ import ( ...@@ -6,4 +6,3 @@ import (
const syscall_O_LARGEFILE = syscall.O_LARGEFILE const syscall_O_LARGEFILE = syscall.O_LARGEFILE
const syscall_O_NOATIME = syscall.O_NOATIME const syscall_O_NOATIME = syscall.O_NOATIME
...@@ -39,7 +39,6 @@ func init() { ...@@ -39,7 +39,6 @@ func init() {
CAP_AUTO_INVAL_DATA: "AUTO_INVAL_DATA", CAP_AUTO_INVAL_DATA: "AUTO_INVAL_DATA",
CAP_READDIRPLUS: "READDIRPLUS", CAP_READDIRPLUS: "READDIRPLUS",
CAP_READDIRPLUS_AUTO: "READDIRPLUS_AUTO", CAP_READDIRPLUS_AUTO: "READDIRPLUS_AUTO",
} }
releaseFlagNames = map[int64]string{ releaseFlagNames = map[int64]string{
RELEASE_FLUSH: "FLUSH", RELEASE_FLUSH: "FLUSH",
......
package raw package raw
import ( import (
"fmt" "fmt"
) )
func init() { func init() {
......
package raw package raw
import ( import (
"fmt" "fmt"
"syscall" "syscall"
......
...@@ -92,8 +92,6 @@ const ( ...@@ -92,8 +92,6 @@ const (
FOPEN_DIRECT_IO = (1 << 0) FOPEN_DIRECT_IO = (1 << 0)
FOPEN_KEEP_CACHE = (1 << 1) FOPEN_KEEP_CACHE = (1 << 1)
FOPEN_NONSEEKABLE = (1 << 2) FOPEN_NONSEEKABLE = (1 << 2)
) )
type OpenOut struct { type OpenOut struct {
......
...@@ -40,7 +40,7 @@ type SetAttrIn struct { ...@@ -40,7 +40,7 @@ type SetAttrIn struct {
} }
const ( const (
FOPEN_PURGE_ATTR =(1 << 30) FOPEN_PURGE_ATTR = (1 << 30)
FOPEN_PURGE_UBC = (1 << 31) FOPEN_PURGE_UBC = (1 << 31)
) )
......
...@@ -41,7 +41,6 @@ func (g *GetAttrIn) Fh() uint64 { ...@@ -41,7 +41,6 @@ func (g *GetAttrIn) Fh() uint64 {
return g.Fh_ return g.Fh_
} }
type ReadIn struct { type ReadIn struct {
Fh uint64 Fh uint64
Offset uint64 Offset uint64
...@@ -52,7 +51,6 @@ type ReadIn struct { ...@@ -52,7 +51,6 @@ type ReadIn struct {
Padding uint32 Padding uint32
} }
type WriteIn struct { type WriteIn struct {
Fh uint64 Fh uint64
Offset uint64 Offset uint64
......
...@@ -11,11 +11,10 @@ type Pair struct { ...@@ -11,11 +11,10 @@ type Pair struct {
} }
func (p *Pair) MaxGrow() { 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 { func (p *Pair) Grow(n int) error {
if n <= p.size { if n <= p.size {
return nil return nil
...@@ -63,5 +62,3 @@ func (p *Pair) WriteFd() uintptr { ...@@ -63,5 +62,3 @@ func (p *Pair) WriteFd() uintptr {
func (p *Pair) Write(d []byte) (n int, err error) { func (p *Pair) Write(d []byte) (n int, err error) {
return p.w.Write(d) return p.w.Write(d)
} }
package splice package splice
import ( import ()
)
func (p *Pair) LoadFromAt(fd uintptr, sz int, off int64) (int, error) { func (p *Pair) LoadFromAt(fd uintptr, sz int, off int64) (int, error) {
panic("not implemented") panic("not implemented")
......
...@@ -9,8 +9,8 @@ import ( ...@@ -9,8 +9,8 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings"
"strconv" "strconv"
"strings"
"syscall" "syscall"
"testing" "testing"
"time" "time"
...@@ -44,7 +44,9 @@ func setRecursiveWritable(t *testing.T, dir string, writable bool) { ...@@ -44,7 +44,9 @@ func setRecursiveWritable(t *testing.T, dir string, writable bool) {
} else { } else {
newMode = uint32(fi.Mode().Perm()) &^ 0222 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)) return os.Chmod(path, os.FileMode(newMode))
}) })
if err != nil { if err != nil {
......
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