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

Move DirEnt to raw.

parent 58233848
......@@ -12,7 +12,8 @@ import (
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 {
Mode uint32
Name string
......@@ -40,14 +41,14 @@ func (me *DirEntryList) Add(name []byte, inode uint64, mode uint32) bool {
lastLen := me.buf.Len()
(*me.offset)++
dirent := Dirent{
dirent := raw.Dirent{
Off: *me.offset,
Ino: inode,
NameLen: uint32(len(name)),
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 {
panic("Serialization of Dirent failed")
}
......
......@@ -79,9 +79,3 @@ type WriteIn struct {
Padding uint32
}
type Dirent struct {
Ino uint64
Off uint64
NameLen uint32
Typ uint32
}
......@@ -385,3 +385,10 @@ type Kstatfs struct {
type StatfsOut struct {
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