Commit 3aed656d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Drop Kstatfs type.

parent 8342bc7b
// A FUSE filesystem that shunts all request to an underlying file
// system. Its main purpose is to provide test coverage without
// having to build an actual synthetic filesystem.
package fuse package fuse
import ( import (
...@@ -12,16 +8,16 @@ import ( ...@@ -12,16 +8,16 @@ import (
"path/filepath" "path/filepath"
"syscall" "syscall"
"time" "time"
"github.com/hanwen/go-fuse/raw"
) )
var _ = fmt.Println var _ = fmt.Println
var _ = log.Println var _ = log.Println
// A FUSE filesystem that shunts all request to an underlying file
// system. Its main purpose is to provide test coverage without
// having to build an actual synthetic filesystem.
type LoopbackFileSystem struct { type LoopbackFileSystem struct {
Root string Root string
DefaultFileSystem DefaultFileSystem
} }
...@@ -188,16 +184,14 @@ func (fs *LoopbackFileSystem) StatFs(name string) *StatfsOut { ...@@ -188,16 +184,14 @@ func (fs *LoopbackFileSystem) StatFs(name string) *StatfsOut {
err := syscall.Statfs(fs.GetPath(name), &s) err := syscall.Statfs(fs.GetPath(name), &s)
if err == nil { if err == nil {
return &StatfsOut{ return &StatfsOut{
raw.Kstatfs{ Blocks: s.Blocks,
Blocks: s.Blocks, Bsize: uint32(s.Bsize),
Bsize: uint32(s.Bsize), Bfree: s.Bfree,
Bfree: s.Bfree, Bavail: s.Bavail,
Bavail: s.Bavail, Files: s.Files,
Files: s.Files, Ffree: s.Ffree,
Ffree: s.Ffree, Frsize: uint32(s.Frsize),
Frsize: uint32(s.Frsize), NameLen: uint32(s.Namelen),
NameLen: uint32(s.Namelen),
},
} }
} }
return nil return nil
......
...@@ -207,7 +207,7 @@ func (me *CreateOut) String() string { ...@@ -207,7 +207,7 @@ func (me *CreateOut) String() string {
return fmt.Sprintf("{%v %v}", &me.EntryOut, &me.OpenOut) return fmt.Sprintf("{%v %v}", &me.EntryOut, &me.OpenOut)
} }
func (me *Kstatfs) String() string { func (me *StatfsOut) String() string {
return fmt.Sprintf( return fmt.Sprintf(
"{b%d f%d fs%d ff%d bs%d nl%d frs%d}", "{b%d f%d fs%d ff%d bs%d nl%d frs%d}",
me.Blocks, me.Bfree, me.Bavail, me.Files, me.Ffree, me.Blocks, me.Bfree, me.Bavail, me.Files, me.Ffree,
......
...@@ -366,7 +366,7 @@ type InHeader struct { ...@@ -366,7 +366,7 @@ type InHeader struct {
Padding uint32 Padding uint32
} }
type Kstatfs struct { type StatfsOut struct {
Blocks uint64 Blocks uint64
Bfree uint64 Bfree uint64
Bavail uint64 Bavail uint64
...@@ -379,10 +379,6 @@ type Kstatfs struct { ...@@ -379,10 +379,6 @@ type Kstatfs struct {
Spare [6]uint32 Spare [6]uint32
} }
type StatfsOut struct {
Kstatfs
}
type Dirent struct { type Dirent struct {
Ino uint64 Ino uint64
Off uint64 Off uint64
......
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