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

Move DirEnt to raw.

parent 58233848
...@@ -12,7 +12,8 @@ import ( ...@@ -12,7 +12,8 @@ import (
var _ = fmt.Print var _ = fmt.Print
// For FileSystemConnector. The connector determines inodes. // DirEntry is a type for PathFileSystem and NodeFileSystem to return
// directory contents in.
type DirEntry struct { type DirEntry struct {
Mode uint32 Mode uint32
Name string Name string
...@@ -40,14 +41,14 @@ func (me *DirEntryList) Add(name []byte, inode uint64, mode uint32) bool { ...@@ -40,14 +41,14 @@ func (me *DirEntryList) Add(name []byte, inode uint64, mode uint32) bool {
lastLen := me.buf.Len() lastLen := me.buf.Len()
(*me.offset)++ (*me.offset)++
dirent := Dirent{ dirent := raw.Dirent{
Off: *me.offset, Off: *me.offset,
Ino: inode, Ino: inode,
NameLen: uint32(len(name)), NameLen: uint32(len(name)),
Typ: ModeToType(mode), Typ: ModeToType(mode),
} }
_, err := me.buf.Write(asSlice(unsafe.Pointer(&dirent), unsafe.Sizeof(Dirent{}))) _, err := me.buf.Write(asSlice(unsafe.Pointer(&dirent), unsafe.Sizeof(raw.Dirent{})))
if err != nil { if err != nil {
panic("Serialization of Dirent failed") panic("Serialization of Dirent failed")
} }
......
...@@ -79,9 +79,3 @@ type WriteIn struct { ...@@ -79,9 +79,3 @@ type WriteIn struct {
Padding uint32 Padding uint32
} }
type Dirent struct {
Ino uint64
Off uint64
NameLen uint32
Typ uint32
}
...@@ -385,3 +385,10 @@ type Kstatfs struct { ...@@ -385,3 +385,10 @@ type Kstatfs struct {
type StatfsOut struct { type StatfsOut struct {
Kstatfs Kstatfs
} }
type Dirent struct {
Ino uint64
Off uint64
NameLen uint32
Typ uint32
}
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