Commit 224614e9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Gofmt.

parent 52ac4a21
......@@ -34,10 +34,10 @@ func (me *DirEntryList) Add(name []byte, inode uint64, mode uint32) bool {
me.offset++
dirent := Dirent{
Off: me.offset,
Ino: inode,
NameLen: uint32(len(name)),
Typ: ModeToType(mode),
Off: me.offset,
Ino: inode,
NameLen: uint32(len(name)),
Typ: ModeToType(mode),
}
_, err := me.buf.Write(asSlice(unsafe.Pointer(&dirent), unsafe.Sizeof(Dirent{})))
......
......@@ -531,7 +531,7 @@ func serialize(req *fuseRequest, debug bool) {
sizeOfOutHeader := unsafe.Sizeof(OutHeader{})
req.outHeaderBytes = make([]byte, sizeOfOutHeader + dataLength)
req.outHeaderBytes = make([]byte, sizeOfOutHeader+dataLength)
outHeader := (*OutHeader)(unsafe.Pointer(&req.outHeaderBytes[0]))
outHeader.Unique = req.inHeader.Unique
outHeader.Status = -req.status
......
......@@ -258,87 +258,88 @@ func MyPID() string {
var inputSizeMap map[int]int
var outputSizeMap map[int]int
func init() {
inputSizeMap = map[int]int{
FUSE_LOOKUP: 0,
FUSE_FORGET: unsafe.Sizeof(ForgetIn{}),
FUSE_GETATTR: unsafe.Sizeof(GetAttrIn{}),
FUSE_SETATTR: unsafe.Sizeof(SetAttrIn{}),
FUSE_READLINK: 0,
FUSE_SYMLINK: 0,
FUSE_MKNOD: unsafe.Sizeof(MknodIn{}),
FUSE_MKDIR: unsafe.Sizeof(MkdirIn{}),
FUSE_UNLINK: 0,
FUSE_RMDIR: 0,
FUSE_RENAME: unsafe.Sizeof(RenameIn{}),
FUSE_LINK: unsafe.Sizeof(LinkIn{}),
FUSE_OPEN: unsafe.Sizeof(OpenIn{}),
FUSE_READ: unsafe.Sizeof(ReadIn{}),
FUSE_WRITE: unsafe.Sizeof(WriteIn{}),
FUSE_STATFS: 0,
FUSE_RELEASE: unsafe.Sizeof(ReleaseIn{}),
FUSE_FSYNC: unsafe.Sizeof(FsyncIn{}),
FUSE_SETXATTR: unsafe.Sizeof(SetXAttrIn{}),
FUSE_GETXATTR: unsafe.Sizeof(GetXAttrIn{}),
FUSE_LISTXATTR: 0,
FUSE_REMOVEXATTR: 0,
FUSE_FLUSH: unsafe.Sizeof(FlushIn{}),
FUSE_INIT: unsafe.Sizeof(InitIn{}),
FUSE_OPENDIR: unsafe.Sizeof(OpenIn{}),
FUSE_READDIR: unsafe.Sizeof(ReadIn{}),
FUSE_RELEASEDIR: unsafe.Sizeof(ReleaseIn{}),
FUSE_FSYNCDIR: unsafe.Sizeof(FsyncIn{}),
FUSE_GETLK: 0,
FUSE_SETLK: 0,
FUSE_SETLKW: 0,
FUSE_ACCESS: unsafe.Sizeof(AccessIn{}),
FUSE_CREATE: unsafe.Sizeof(CreateIn{}),
FUSE_INTERRUPT: unsafe.Sizeof(InterruptIn{}),
FUSE_BMAP: unsafe.Sizeof(BmapIn{}),
FUSE_DESTROY: 0,
FUSE_IOCTL: unsafe.Sizeof(IoctlIn{}),
FUSE_POLL: unsafe.Sizeof(PollIn{}),
FUSE_LOOKUP: 0,
FUSE_FORGET: unsafe.Sizeof(ForgetIn{}),
FUSE_GETATTR: unsafe.Sizeof(GetAttrIn{}),
FUSE_SETATTR: unsafe.Sizeof(SetAttrIn{}),
FUSE_READLINK: 0,
FUSE_SYMLINK: 0,
FUSE_MKNOD: unsafe.Sizeof(MknodIn{}),
FUSE_MKDIR: unsafe.Sizeof(MkdirIn{}),
FUSE_UNLINK: 0,
FUSE_RMDIR: 0,
FUSE_RENAME: unsafe.Sizeof(RenameIn{}),
FUSE_LINK: unsafe.Sizeof(LinkIn{}),
FUSE_OPEN: unsafe.Sizeof(OpenIn{}),
FUSE_READ: unsafe.Sizeof(ReadIn{}),
FUSE_WRITE: unsafe.Sizeof(WriteIn{}),
FUSE_STATFS: 0,
FUSE_RELEASE: unsafe.Sizeof(ReleaseIn{}),
FUSE_FSYNC: unsafe.Sizeof(FsyncIn{}),
FUSE_SETXATTR: unsafe.Sizeof(SetXAttrIn{}),
FUSE_GETXATTR: unsafe.Sizeof(GetXAttrIn{}),
FUSE_LISTXATTR: 0,
FUSE_REMOVEXATTR: 0,
FUSE_FLUSH: unsafe.Sizeof(FlushIn{}),
FUSE_INIT: unsafe.Sizeof(InitIn{}),
FUSE_OPENDIR: unsafe.Sizeof(OpenIn{}),
FUSE_READDIR: unsafe.Sizeof(ReadIn{}),
FUSE_RELEASEDIR: unsafe.Sizeof(ReleaseIn{}),
FUSE_FSYNCDIR: unsafe.Sizeof(FsyncIn{}),
FUSE_GETLK: 0,
FUSE_SETLK: 0,
FUSE_SETLKW: 0,
FUSE_ACCESS: unsafe.Sizeof(AccessIn{}),
FUSE_CREATE: unsafe.Sizeof(CreateIn{}),
FUSE_INTERRUPT: unsafe.Sizeof(InterruptIn{}),
FUSE_BMAP: unsafe.Sizeof(BmapIn{}),
FUSE_DESTROY: 0,
FUSE_IOCTL: unsafe.Sizeof(IoctlIn{}),
FUSE_POLL: unsafe.Sizeof(PollIn{}),
}
outputSizeMap = map[int]int {
FUSE_LOOKUP: unsafe.Sizeof(EntryOut{}),
FUSE_FORGET: 0,
FUSE_GETATTR: unsafe.Sizeof(AttrOut{}),
FUSE_SETATTR: unsafe.Sizeof(AttrOut{}),
FUSE_READLINK: 0,
FUSE_SYMLINK: unsafe.Sizeof(EntryOut{}),
FUSE_MKNOD: unsafe.Sizeof(EntryOut{}),
FUSE_MKDIR: unsafe.Sizeof(EntryOut{}),
FUSE_UNLINK: 0,
FUSE_RMDIR: 0,
FUSE_RENAME: 0,
FUSE_LINK: unsafe.Sizeof(EntryOut{}),
FUSE_OPEN: unsafe.Sizeof(OpenOut{}),
FUSE_READ: 0,
FUSE_WRITE: unsafe.Sizeof(WriteOut{}),
FUSE_STATFS: unsafe.Sizeof(StatfsOut{}),
FUSE_RELEASE: 0,
FUSE_FSYNC: 0,
FUSE_SETXATTR: 0,
FUSE_GETXATTR: unsafe.Sizeof(GetXAttrOut{}),
FUSE_LISTXATTR: 0,
FUSE_REMOVEXATTR: 0,
FUSE_FLUSH: 0,
FUSE_INIT: unsafe.Sizeof(InitOut{}),
FUSE_OPENDIR: unsafe.Sizeof(OpenOut{}),
FUSE_READDIR: 0,
FUSE_RELEASEDIR: 0,
FUSE_FSYNCDIR: 0,
// TODO
FUSE_GETLK: 0,
FUSE_SETLK: 0,
FUSE_SETLKW: 0,
FUSE_ACCESS: 0,
FUSE_CREATE: unsafe.Sizeof(CreateOut{}),
FUSE_INTERRUPT: 0,
FUSE_BMAP: unsafe.Sizeof(BmapOut{}),
FUSE_DESTROY: 0,
FUSE_IOCTL: unsafe.Sizeof(IoctlOut{}),
FUSE_POLL: unsafe.Sizeof(PollOut{}),
outputSizeMap = map[int]int{
FUSE_LOOKUP: unsafe.Sizeof(EntryOut{}),
FUSE_FORGET: 0,
FUSE_GETATTR: unsafe.Sizeof(AttrOut{}),
FUSE_SETATTR: unsafe.Sizeof(AttrOut{}),
FUSE_READLINK: 0,
FUSE_SYMLINK: unsafe.Sizeof(EntryOut{}),
FUSE_MKNOD: unsafe.Sizeof(EntryOut{}),
FUSE_MKDIR: unsafe.Sizeof(EntryOut{}),
FUSE_UNLINK: 0,
FUSE_RMDIR: 0,
FUSE_RENAME: 0,
FUSE_LINK: unsafe.Sizeof(EntryOut{}),
FUSE_OPEN: unsafe.Sizeof(OpenOut{}),
FUSE_READ: 0,
FUSE_WRITE: unsafe.Sizeof(WriteOut{}),
FUSE_STATFS: unsafe.Sizeof(StatfsOut{}),
FUSE_RELEASE: 0,
FUSE_FSYNC: 0,
FUSE_SETXATTR: 0,
FUSE_GETXATTR: unsafe.Sizeof(GetXAttrOut{}),
FUSE_LISTXATTR: 0,
FUSE_REMOVEXATTR: 0,
FUSE_FLUSH: 0,
FUSE_INIT: unsafe.Sizeof(InitOut{}),
FUSE_OPENDIR: unsafe.Sizeof(OpenOut{}),
FUSE_READDIR: 0,
FUSE_RELEASEDIR: 0,
FUSE_FSYNCDIR: 0,
// TODO
FUSE_GETLK: 0,
FUSE_SETLK: 0,
FUSE_SETLKW: 0,
FUSE_ACCESS: 0,
FUSE_CREATE: unsafe.Sizeof(CreateOut{}),
FUSE_INTERRUPT: 0,
FUSE_BMAP: unsafe.Sizeof(BmapOut{}),
FUSE_DESTROY: 0,
FUSE_IOCTL: unsafe.Sizeof(IoctlOut{}),
FUSE_POLL: unsafe.Sizeof(PollOut{}),
}
}
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