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

Gofmt.

parent bf30f7b8
...@@ -13,7 +13,6 @@ import ( ...@@ -13,7 +13,6 @@ import (
"time" "time"
) )
func ReadLines(name string) []string { func ReadLines(name string) []string {
f, err := os.Open(name) f, err := os.Open(name)
if err != nil { if err != nil {
......
...@@ -157,7 +157,7 @@ func BenchmarkCFuseThreadedStat(b *testing.B) { ...@@ -157,7 +157,7 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
mountPoint) mountPoint)
cmd.Env = append(os.Environ(), cmd.Env = append(os.Environ(),
fmt.Sprintf("STATFS_INPUT=%s", f.Name()), fmt.Sprintf("STATFS_INPUT=%s", f.Name()),
fmt.Sprintf("STATFS_DELAY_USEC=%d", delay / time.Microsecond)) fmt.Sprintf("STATFS_DELAY_USEC=%d", delay/time.Microsecond))
cmd.Start() cmd.Start()
bin, err := exec.LookPath("fusermount") bin, err := exec.LookPath("fusermount")
......
...@@ -73,5 +73,5 @@ func main() { ...@@ -73,5 +73,5 @@ func main() {
gofs.SetFileSystemConnector(conn) gofs.SetFileSystemConnector(conn)
state.Loop() state.Loop()
time.Sleep(1 *time.Second) time.Sleep(1 * time.Second)
} }
...@@ -3,8 +3,8 @@ package main ...@@ -3,8 +3,8 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/benchmark" "github.com/hanwen/go-fuse/benchmark"
"github.com/hanwen/go-fuse/fuse"
"io" "io"
"log" "log"
"os" "os"
......
...@@ -77,7 +77,6 @@ type FsNode interface { ...@@ -77,7 +77,6 @@ type FsNode interface {
StatFs() *StatfsOut StatFs() *StatfsOut
} }
// A filesystem API that uses paths rather than inodes. A minimal // A filesystem API that uses paths rather than inodes. A minimal
// file system should have at least a functional GetAttr method. // file system should have at least a functional GetAttr method.
// Typically, each call happens in its own goroutine, so take care to // Typically, each call happens in its own goroutine, so take care to
...@@ -171,7 +170,7 @@ type File interface { ...@@ -171,7 +170,7 @@ type File interface {
// The methods below may be called on closed files, due to // The methods below may be called on closed files, due to
// concurrency. In that case, you should return EBADF. // concurrency. In that case, you should return EBADF.
Truncate(size uint64) Status Truncate(size uint64) Status
GetAttr(out *Attr) (Status) GetAttr(out *Attr) Status
Chown(uid uint32, gid uint32) Status Chown(uid uint32, gid uint32) Status
Chmod(perms uint32) Status Chmod(perms uint32) Status
Utimens(atimeNs int64, mtimeNs int64) Status Utimens(atimeNs int64, mtimeNs int64) Status
...@@ -288,7 +287,7 @@ type RawFileSystem interface { ...@@ -288,7 +287,7 @@ type RawFileSystem interface {
// Directory handling // Directory handling
OpenDir(out *raw.OpenOut, header *raw.InHeader, input *raw.OpenIn) (status Status) OpenDir(out *raw.OpenOut, header *raw.InHeader, input *raw.OpenIn) (status Status)
ReadDir(out *DirEntryList, header *raw.InHeader, input *ReadIn) (Status) ReadDir(out *DirEntryList, header *raw.InHeader, input *ReadIn) Status
ReleaseDir(header *raw.InHeader, input *raw.ReleaseIn) ReleaseDir(header *raw.InHeader, input *raw.ReleaseIn)
FsyncDir(header *raw.InHeader, input *raw.FsyncIn) (code Status) FsyncDir(header *raw.InHeader, input *raw.FsyncIn) (code Status)
......
...@@ -122,7 +122,6 @@ func (p *BufferPoolImpl) AllocBuffer(size uint32) []byte { ...@@ -122,7 +122,6 @@ func (p *BufferPoolImpl) AllocBuffer(size uint32) []byte {
} }
p.lock.Unlock() p.lock.Unlock()
return b return b
} }
......
...@@ -2,12 +2,12 @@ package fuse ...@@ -2,12 +2,12 @@ package fuse
import ( import (
"bytes" "bytes"
"github.com/hanwen/go-fuse/raw"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"sync" "sync"
"testing" "testing"
"github.com/hanwen/go-fuse/raw"
) )
var _ = log.Println var _ = log.Println
......
...@@ -27,7 +27,7 @@ func CopyFile(srcFs, destFs FileSystem, srcFile, destFile string, context *Conte ...@@ -27,7 +27,7 @@ func CopyFile(srcFs, destFs FileSystem, srcFile, destFile string, context *Conte
defer dst.Release() defer dst.Release()
defer dst.Flush() defer dst.Flush()
buf := make([]byte, 128 * (1 << 10)) buf := make([]byte, 128*(1<<10))
off := int64(0) off := int64(0)
for { for {
res := src.Read(buf, off) res := src.Read(buf, off)
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
var _ = RawFileSystem((*DefaultRawFileSystem)(nil)) var _ = RawFileSystem((*DefaultRawFileSystem)(nil))
func (fs *DefaultRawFileSystem) Init(init *RawFsInit) { func (fs *DefaultRawFileSystem) Init(init *RawFsInit) {
} }
...@@ -116,7 +115,7 @@ func (fs *DefaultRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn) ...@@ -116,7 +115,7 @@ func (fs *DefaultRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn)
return ENOSYS return ENOSYS
} }
func (fs *DefaultRawFileSystem) ReadDir(l *DirEntryList, header *raw.InHeader, input *ReadIn) ( Status) { func (fs *DefaultRawFileSystem) ReadDir(l *DirEntryList, header *raw.InHeader, input *ReadIn) Status {
return ENOSYS return ENOSYS
} }
......
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
var _ = log.Print var _ = log.Print
var eightPadding [8]byte var eightPadding [8]byte
const direntSize = int(unsafe.Sizeof(raw.Dirent{})) const direntSize = int(unsafe.Sizeof(raw.Dirent{}))
// DirEntry is a type for PathFileSystem and NodeFileSystem to return // DirEntry is a type for PathFileSystem and NodeFileSystem to return
...@@ -37,7 +38,7 @@ func (l *DirEntryList) AddDirEntry(e DirEntry) bool { ...@@ -37,7 +38,7 @@ func (l *DirEntryList) AddDirEntry(e DirEntry) bool {
} }
func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool { func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool {
padding := (8 - len(name)&7)&7 padding := (8 - len(name)&7) & 7
delta := padding + direntSize + len(name) delta := padding + direntSize + len(name)
oldLen := len(l.buf) oldLen := len(l.buf)
newLen := delta + oldLen newLen := delta + oldLen
...@@ -47,9 +48,9 @@ func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool { ...@@ -47,9 +48,9 @@ func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool {
} }
l.buf = l.buf[:newLen] l.buf = l.buf[:newLen]
dirent := (*raw.Dirent)(unsafe.Pointer(&l.buf[oldLen])) dirent := (*raw.Dirent)(unsafe.Pointer(&l.buf[oldLen]))
dirent.Off = l.offset+1 dirent.Off = l.offset + 1
dirent.Ino = inode dirent.Ino = inode
dirent.NameLen= uint32(len(name)) dirent.NameLen = uint32(len(name))
dirent.Typ = ModeToType(mode) dirent.Typ = ModeToType(mode)
oldLen += direntSize oldLen += direntSize
copy(l.buf[oldLen:], name) copy(l.buf[oldLen:], name)
...@@ -70,7 +71,7 @@ func (l *DirEntryList) Bytes() []byte { ...@@ -70,7 +71,7 @@ func (l *DirEntryList) Bytes() []byte {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
type rawDir interface { type rawDir interface {
ReadDir(out *DirEntryList, input *ReadIn) (Status) ReadDir(out *DirEntryList, input *ReadIn) Status
Release() Release()
} }
......
...@@ -104,7 +104,7 @@ func (f *LoopbackFile) Read(buf []byte, off int64) (res ReadResult) { ...@@ -104,7 +104,7 @@ func (f *LoopbackFile) Read(buf []byte, off int64) (res ReadResult) {
return ReadResult{ return ReadResult{
Fd: f.File.Fd(), Fd: f.File.Fd(),
FdOff: off, FdOff: off,
FdSize:len(buf), FdSize: len(buf),
Status: OK, Status: OK,
} }
} }
......
...@@ -65,7 +65,7 @@ func (m *fileSystemMount) fillEntry(out *raw.EntryOut) { ...@@ -65,7 +65,7 @@ func (m *fileSystemMount) fillEntry(out *raw.EntryOut) {
splitDuration(m.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec) splitDuration(m.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec)
splitDuration(m.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec) splitDuration(m.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec)
m.setOwner(&out.Attr) m.setOwner(&out.Attr)
if out.Mode & S_IFDIR == 0 && out.Nlink == 0 { if out.Mode&S_IFDIR == 0 && out.Nlink == 0 {
out.Nlink = 1 out.Nlink = 1
} }
} }
......
...@@ -123,7 +123,7 @@ func (c *FileSystemConnector) OpenDir(out *raw.OpenOut, header *raw.InHeader, in ...@@ -123,7 +123,7 @@ func (c *FileSystemConnector) OpenDir(out *raw.OpenOut, header *raw.InHeader, in
return OK return OK
} }
func (c *FileSystemConnector) ReadDir(l *DirEntryList, header *raw.InHeader, input *ReadIn) (Status) { func (c *FileSystemConnector) ReadDir(l *DirEntryList, header *raw.InHeader, input *ReadIn) Status {
node := c.toInode(header.NodeId) node := c.toInode(header.NodeId)
opened := node.mount.getOpenedFile(input.Fh) opened := node.mount.getOpenedFile(input.Fh)
return opened.dir.ReadDir(l, input) return opened.dir.ReadDir(l, input)
...@@ -350,7 +350,7 @@ func (c *FileSystemConnector) Write(header *raw.InHeader, input *WriteIn, data [ ...@@ -350,7 +350,7 @@ func (c *FileSystemConnector) Write(header *raw.InHeader, input *WriteIn, data [
return opened.WithFlags.File.Write(data, int64(input.Offset)) return opened.WithFlags.File.Write(data, int64(input.Offset))
} }
func (c *FileSystemConnector) Read(header *raw.InHeader, input *ReadIn, buf []byte) (ReadResult) { func (c *FileSystemConnector) Read(header *raw.InHeader, input *ReadIn, buf []byte) ReadResult {
node := c.toInode(header.NodeId) node := c.toInode(header.NodeId)
opened := node.mount.getOpenedFile(input.Fh) opened := node.mount.getOpenedFile(input.Fh)
...@@ -372,4 +372,3 @@ func (c *FileSystemConnector) Flush(header *raw.InHeader, input *raw.FlushIn) St ...@@ -372,4 +372,3 @@ func (c *FileSystemConnector) Flush(header *raw.InHeader, input *raw.FlushIn) St
opened := node.mount.getOpenedFile(input.Fh) opened := node.mount.getOpenedFile(input.Fh)
return opened.WithFlags.File.Flush() return opened.WithFlags.File.Flush()
} }
...@@ -296,7 +296,7 @@ func (fs *LockingRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn) ...@@ -296,7 +296,7 @@ func (fs *LockingRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn)
return fs.RawFileSystem.Fsync(header, input) return fs.RawFileSystem.Fsync(header, input)
} }
func (fs *LockingRawFileSystem) ReadDir(out *DirEntryList, header *raw.InHeader, input *ReadIn) (Status) { func (fs *LockingRawFileSystem) ReadDir(out *DirEntryList, header *raw.InHeader, input *ReadIn) Status {
defer fs.locked()() defer fs.locked()()
return fs.RawFileSystem.ReadDir(out, header, input) return fs.RawFileSystem.ReadDir(out, header, input)
} }
......
...@@ -140,7 +140,7 @@ func TestReadLarge(t *testing.T) { ...@@ -140,7 +140,7 @@ func TestReadLarge(t *testing.T) {
defer ts.Cleanup() defer ts.Cleanup()
// Add a bit more to test the splicing at the end. // Add a bit more to test the splicing at the end.
content := make([]byte, 1024*1024 + 43) content := make([]byte, 1024*1024+43)
for i := range content { for i := range content {
content[i] = byte(i) content[i] = byte(i)
} }
......
...@@ -48,7 +48,7 @@ func TestMemNodeFsWrite(t *testing.T) { ...@@ -48,7 +48,7 @@ func TestMemNodeFsWrite(t *testing.T) {
err := ioutil.WriteFile(wd+"/test", []byte(want), 0644) err := ioutil.WriteFile(wd+"/test", []byte(want), 0644)
CheckSuccess(err) CheckSuccess(err)
content, err := ioutil.ReadFile(wd +"/test") content, err := ioutil.ReadFile(wd + "/test")
if string(content) != want { if string(content) != want {
t.Fatalf("content mismatch: got %q, want %q", content, want) t.Fatalf("content mismatch: got %q, want %q", content, want)
} }
......
...@@ -49,4 +49,3 @@ func TestLinkAt(t *testing.T) { ...@@ -49,4 +49,3 @@ func TestLinkAt(t *testing.T) {
t.Fatal("Ino mismatch", s1, s2) t.Fatal("Ino mismatch", s1, s2)
} }
} }
...@@ -2,8 +2,8 @@ package fuse ...@@ -2,8 +2,8 @@ package fuse
import ( import (
"fmt" "fmt"
"log"
"io" "io"
"log"
"os" "os"
"strings" "strings"
"sync" "sync"
...@@ -163,7 +163,7 @@ func (ms *MountState) BufferPoolStats() string { ...@@ -163,7 +163,7 @@ func (ms *MountState) BufferPoolStats() string {
ms.reqMu.Unlock() ms.reqMu.Unlock()
s += fmt.Sprintf(" read buffers: %d (sz %d )", s += fmt.Sprintf(" read buffers: %d (sz %d )",
r, ms.opts.MaxWrite/PAGESIZE + 1) r, ms.opts.MaxWrite/PAGESIZE+1)
return s return s
} }
...@@ -192,7 +192,7 @@ func (ms *MountState) readRequest(exitIdle bool) (req *request, code Status) { ...@@ -192,7 +192,7 @@ func (ms *MountState) readRequest(exitIdle bool) (req *request, code Status) {
dest = ms.readPool[l-1] dest = ms.readPool[l-1]
ms.readPool = ms.readPool[:l-1] ms.readPool = ms.readPool[:l-1]
} else { } else {
dest = make([]byte, ms.opts.MaxWrite + PAGESIZE) dest = make([]byte, ms.opts.MaxWrite+PAGESIZE)
} }
ms.outstandingReadBufs++ ms.outstandingReadBufs++
ms.reqReaders++ ms.reqReaders++
...@@ -272,7 +272,7 @@ func (ms *MountState) Loop() { ...@@ -272,7 +272,7 @@ func (ms *MountState) Loop() {
func (ms *MountState) loop(exitIdle bool) { func (ms *MountState) loop(exitIdle bool) {
defer ms.loops.Done() defer ms.loops.Done()
exit: exit:
for { for {
req, errNo := ms.readRequest(exitIdle) req, errNo := ms.readRequest(exitIdle)
switch errNo { switch errNo {
...@@ -336,7 +336,6 @@ func (ms *MountState) AllocOut(req *request, size uint32) []byte { ...@@ -336,7 +336,6 @@ func (ms *MountState) AllocOut(req *request, size uint32) []byte {
return req.bufferPoolOutputBuf return req.bufferPoolOutputBuf
} }
func (ms *MountState) write(req *request) Status { func (ms *MountState) write(req *request) Status {
// Forget does not wait for reply. // Forget does not wait for reply.
if req.inHeader.Opcode == _OP_FORGET || req.inHeader.Opcode == _OP_BATCH_FORGET { if req.inHeader.Opcode == _OP_FORGET || req.inHeader.Opcode == _OP_BATCH_FORGET {
......
...@@ -216,7 +216,7 @@ func doForget(state *MountState, req *request) { ...@@ -216,7 +216,7 @@ func doForget(state *MountState, req *request) {
func doBatchForget(state *MountState, req *request) { func doBatchForget(state *MountState, req *request) {
in := (*raw.BatchForgetIn)(req.inData) in := (*raw.BatchForgetIn)(req.inData)
wantBytes := uintptr(in.Count)*unsafe.Sizeof(raw.BatchForgetIn{}) wantBytes := uintptr(in.Count) * unsafe.Sizeof(raw.BatchForgetIn{})
if uintptr(len(req.arg)) < wantBytes { if uintptr(len(req.arg)) < wantBytes {
// We have no return value to complain, so log an error. // We have no return value to complain, so log an error.
log.Printf("Too few bytes for batch forget. Got %d bytes, want %d (%d entries)", log.Printf("Too few bytes for batch forget. Got %d bytes, want %d (%d entries)",
...@@ -568,7 +568,7 @@ func init() { ...@@ -568,7 +568,7 @@ func init() {
var r request var r request
sizeOfOutHeader := unsafe.Sizeof(raw.OutHeader{}) sizeOfOutHeader := unsafe.Sizeof(raw.OutHeader{})
for code, h := range operationHandlers { for code, h := range operationHandlers {
if h.OutputSize + sizeOfOutHeader > unsafe.Sizeof(r.outBuf) { if h.OutputSize+sizeOfOutHeader > unsafe.Sizeof(r.outBuf) {
log.Panicf("request output buffer too small: code %v, sz %d + %d %v", code, h.OutputSize, sizeOfOutHeader, h) log.Panicf("request output buffer too small: code %v, sz %d + %d %v", code, h.OutputSize, sizeOfOutHeader, h)
} }
} }
......
...@@ -246,7 +246,7 @@ func (n *pathInode) GetPath() string { ...@@ -246,7 +246,7 @@ func (n *pathInode) GetPath() string {
end := len(pathBytes) end := len(pathBytes)
for p = n; p.Parent != nil; p = p.Parent { for p = n; p.Parent != nil; p = p.Parent {
l := len(p.Name) l := len(p.Name)
copy(pathBytes[end - l:], p.Name) copy(pathBytes[end-l:], p.Name)
end -= len(p.Name) + 1 end -= len(p.Name) + 1
if end > 0 { if end > 0 {
pathBytes[end] = '/' pathBytes[end] = '/'
......
...@@ -46,7 +46,7 @@ func TestMemoryPressure(t *testing.T) { ...@@ -46,7 +46,7 @@ func TestMemoryPressure(t *testing.T) {
os.Lstat(dir) os.Lstat(dir)
var wg sync.WaitGroup var wg sync.WaitGroup
for i := 0; i < 10 * _MAX_READERS; i++ { for i := 0; i < 10*_MAX_READERS; i++ {
wg.Add(1) wg.Add(1)
go func(x int) { go func(x int) {
fn := fmt.Sprintf("%s/%ddir/file%d", dir, x, x) fn := fmt.Sprintf("%s/%ddir/file%d", dir, x, x)
...@@ -60,10 +60,9 @@ func TestMemoryPressure(t *testing.T) { ...@@ -60,10 +60,9 @@ func TestMemoryPressure(t *testing.T) {
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
created := state.buffers.createdBuffers + state.outstandingReadBufs created := state.buffers.createdBuffers + state.outstandingReadBufs
t.Logf("Have %d read bufs", state.outstandingReadBufs) t.Logf("Have %d read bufs", state.outstandingReadBufs)
if created > 2 * _MAX_READERS { if created > 2*_MAX_READERS {
t.Errorf("created %d buffers, max reader %d", created, _MAX_READERS) t.Errorf("created %d buffers, max reader %d", created, _MAX_READERS)
} }
wg.Wait() wg.Wait()
} }
...@@ -198,4 +198,3 @@ func (r *request) serializeHeader() (header []byte) { ...@@ -198,4 +198,3 @@ func (r *request) serializeHeader() (header []byte) {
copy(header[sizeOfOutHeader:], asSlice) copy(header[sizeOfOutHeader:], asSlice)
return header return header
} }
package fuse package fuse
import ( import (
"github.com/hanwen/go-fuse/raw"
"os" "os"
"syscall" "syscall"
"github.com/hanwen/go-fuse/raw"
) )
const ( const (
...@@ -41,7 +41,6 @@ const ( ...@@ -41,7 +41,6 @@ const (
EROFS = Status(syscall.EROFS) EROFS = Status(syscall.EROFS)
) )
type Attr raw.Attr type Attr raw.Attr
type Owner raw.Owner type Owner raw.Owner
...@@ -78,4 +77,3 @@ type WriteIn struct { ...@@ -78,4 +77,3 @@ type WriteIn struct {
Flags uint32 Flags uint32
Padding uint32 Padding uint32
} }
...@@ -17,7 +17,6 @@ var xattrGolden = map[string][]byte{ ...@@ -17,7 +17,6 @@ var xattrGolden = map[string][]byte{
"user.attr2": []byte("val2")} "user.attr2": []byte("val2")}
var xattrFilename = "filename" var xattrFilename = "filename"
type XAttrTestFs struct { type XAttrTestFs struct {
tester *testing.T tester *testing.T
filename string filename string
......
package raw package raw
import ( import (
"fmt" "fmt"
"os" "os"
...@@ -87,7 +88,6 @@ func (me *BatchForgetIn) String() string { ...@@ -87,7 +88,6 @@ func (me *BatchForgetIn) String() string {
return fmt.Sprintf("{%d}", me.Count) return fmt.Sprintf("{%d}", me.Count)
} }
func (me *MkdirIn) String() string { func (me *MkdirIn) String() string {
return fmt.Sprintf("{0%o (0%o)}", me.Mode, me.Umask) return fmt.Sprintf("{0%o (0%o)}", me.Mode, me.Umask)
} }
...@@ -127,7 +127,6 @@ func (me *GetAttrIn) String() string { ...@@ -127,7 +127,6 @@ func (me *GetAttrIn) String() string {
return fmt.Sprintf("{Fh %d}", me.Fh) return fmt.Sprintf("{Fh %d}", me.Fh)
} }
func (me *ReleaseIn) String() string { func (me *ReleaseIn) String() string {
return fmt.Sprintf("{Fh %d %s %s L%d}", return fmt.Sprintf("{Fh %d %s %s L%d}",
me.Fh, FlagString(OpenFlagNames, int(me.Flags), ""), me.Fh, FlagString(OpenFlagNames, int(me.Flags), ""),
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
package raw package raw
type ForgetIn struct { type ForgetIn struct {
Nlookup uint64 Nlookup uint64
} }
...@@ -18,7 +17,6 @@ type BatchForgetIn struct { ...@@ -18,7 +17,6 @@ type BatchForgetIn struct {
Dummy uint32 Dummy uint32
} }
type MkdirIn struct { type MkdirIn struct {
Mode uint32 Mode uint32
Umask uint32 Umask uint32
...@@ -86,7 +84,6 @@ type GetAttrIn struct { ...@@ -86,7 +84,6 @@ type GetAttrIn struct {
Fh uint64 Fh uint64
} }
const RELEASE_FLUSH = (1 << 0) const RELEASE_FLUSH = (1 << 0)
type ReleaseIn struct { type ReleaseIn struct {
...@@ -289,7 +286,6 @@ type CreateIn struct { ...@@ -289,7 +286,6 @@ type CreateIn struct {
Padding uint32 Padding uint32
} }
type NotifyInvalInodeOut struct { type NotifyInvalInodeOut struct {
Ino uint64 Ino uint64
Off int64 Off int64
...@@ -370,7 +366,6 @@ type InHeader struct { ...@@ -370,7 +366,6 @@ type InHeader struct {
Padding uint32 Padding uint32
} }
type Kstatfs struct { type Kstatfs struct {
Blocks uint64 Blocks uint64
Bfree uint64 Bfree uint64
......
package splice package splice
import ( import (
"sync" "sync"
) )
...@@ -46,7 +47,6 @@ func (me *pairPool) used() int { ...@@ -46,7 +47,6 @@ func (me *pairPool) used() int {
return me.usedCount return me.usedCount
} }
func (me *pairPool) get() (p *Pair, err error) { func (me *pairPool) get() (p *Pair, err error) {
me.Lock() me.Lock()
defer me.Unlock() defer me.Unlock()
......
...@@ -12,7 +12,6 @@ import ( ...@@ -12,7 +12,6 @@ import (
var _ = log.Println var _ = log.Println
var maxPipeSize int var maxPipeSize int
var resizable bool var resizable bool
...@@ -86,4 +85,3 @@ func newSplicePair() (p *Pair, err error) { ...@@ -86,4 +85,3 @@ func newSplicePair() (p *Pair, err error) {
} }
return p, nil return p, nil
} }
...@@ -9,7 +9,7 @@ func TestPairSize(t *testing.T) { ...@@ -9,7 +9,7 @@ func TestPairSize(t *testing.T) {
p, _ := Get() p, _ := Get()
defer Done(p) defer Done(p)
p.MaxGrow() p.MaxGrow()
b := make([]byte, p.Cap() + 100) b := make([]byte, p.Cap()+100)
for i := range b { for i := range b {
b[i] = byte(i) b[i] = byte(i)
} }
...@@ -26,7 +26,3 @@ func TestPairSize(t *testing.T) { ...@@ -26,7 +26,3 @@ func TestPairSize(t *testing.T) {
} }
} }
...@@ -424,7 +424,7 @@ func (fs *AutoUnionFs) OpenDir(name string, context *fuse.Context) (stream []fus ...@@ -424,7 +424,7 @@ func (fs *AutoUnionFs) OpenDir(name string, context *fuse.Context) (stream []fus
fs.lock.RLock() fs.lock.RLock()
defer fs.lock.RUnlock() defer fs.lock.RUnlock()
stream = make( []fuse.DirEntry, 0, len(fs.knownFileSystems)+5) stream = make([]fuse.DirEntry, 0, len(fs.knownFileSystems)+5)
if name == _CONFIG { if name == _CONFIG {
for k := range fs.knownFileSystems { for k := range fs.knownFileSystems {
stream = append(stream, fuse.DirEntry{ stream = append(stream, fuse.DirEntry{
......
...@@ -89,9 +89,9 @@ func (n *memNode) Deletable() bool { ...@@ -89,9 +89,9 @@ func (n *memNode) Deletable() bool {
return false return false
} }
func (n *memNode) GetAttr(out *fuse.Attr, file fuse.File, context *fuse.Context) (fuse.Status) { func (n *memNode) GetAttr(out *fuse.Attr, file fuse.File, context *fuse.Context) fuse.Status {
if n.Inode().IsDir() { if n.Inode().IsDir() {
out.Mode= fuse.S_IFDIR | 0777 out.Mode = fuse.S_IFDIR | 0777
return fuse.OK return fuse.OK
} }
n.file.Stat(out) n.file.Stat(out)
......
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