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

Move StatfsOut and Kstatfs to raw.

parent 75c95c33
......@@ -12,6 +12,8 @@ import (
"path/filepath"
"syscall"
"time"
"github.com/hanwen/go-fuse/raw"
)
var _ = fmt.Println
......@@ -187,7 +189,7 @@ func (me *LoopbackFileSystem) StatFs(name string) *StatfsOut {
err := syscall.Statfs(me.GetPath(name), &s)
if err == nil {
return &StatfsOut{
Kstatfs{
raw.Kstatfs{
Blocks: s.Blocks,
Bsize: uint32(s.Bsize),
Bfree: s.Bfree,
......
......@@ -41,13 +41,6 @@ func (me *ReadIn) String() string {
raw.FlagString(raw.OpenFlagNames, int(me.Flags), "RDONLY"))
}
func (me *Kstatfs) String() string {
return fmt.Sprintf(
"{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.Bsize, me.NameLen, me.Frsize)
}
func (me *WithFlags) String() string {
return fmt.Sprintf("File %s (%s) %s %s",
me.File, me.Description, raw.FlagString(raw.OpenFlagNames, int(me.OpenFlags), "O_RDONLY"),
......
......@@ -48,18 +48,7 @@ type Owner raw.Owner
type Context raw.Context
type Kstatfs struct {
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Bsize uint32
NameLen uint32
Frsize uint32
Padding uint32
Spare [6]uint32
}
type StatfsOut raw.StatfsOut
const (
READ_LOCKOWNER = (1 << 1)
......@@ -90,10 +79,6 @@ type WriteIn struct {
Padding uint32
}
type StatfsOut struct {
Kstatfs
}
type Dirent struct {
Ino uint64
Off uint64
......
......@@ -196,3 +196,9 @@ func (me *CreateOut) String() string {
return fmt.Sprintf("{%v %v}", &me.EntryOut, &me.OpenOut)
}
func (me *Kstatfs) String() string {
return fmt.Sprintf(
"{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.Bsize, me.NameLen, me.Frsize)
}
......@@ -367,3 +367,21 @@ type InHeader struct {
Context
Padding uint32
}
type Kstatfs struct {
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Bsize uint32
NameLen uint32
Frsize uint32
Padding uint32
Spare [6]uint32
}
type StatfsOut struct {
Kstatfs
}
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