Commit 6fd55492 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Move FsyncIn type.

parent e56b7970
...@@ -165,7 +165,7 @@ type File interface { ...@@ -165,7 +165,7 @@ type File interface {
Write(*WriteIn, []byte) (written uint32, code Status) Write(*WriteIn, []byte) (written uint32, code Status)
Flush() Status Flush() Status
Release() Release()
Fsync(*FsyncIn) (code Status) Fsync(flags int) (code Status)
// The methods below may be called on closed files, due to // The methods below may be called on closed files, due to
// concurrency. In that case, you should return EBADF. // concurrency. In that case, you should return EBADF.
...@@ -283,13 +283,13 @@ type RawFileSystem interface { ...@@ -283,13 +283,13 @@ type RawFileSystem interface {
Release(header *InHeader, input *raw.ReleaseIn) Release(header *InHeader, input *raw.ReleaseIn)
Write(*InHeader, *WriteIn, []byte) (written uint32, code Status) Write(*InHeader, *WriteIn, []byte) (written uint32, code Status)
Flush(header *InHeader, input *FlushIn) Status Flush(header *InHeader, input *FlushIn) Status
Fsync(*InHeader, *FsyncIn) (code Status) Fsync(*InHeader, *raw.FsyncIn) (code Status)
// Directory handling // Directory handling
OpenDir(header *InHeader, input *raw.OpenIn) (flags uint32, handle uint64, status Status) OpenDir(header *InHeader, input *raw.OpenIn) (flags uint32, handle uint64, status Status)
ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
ReleaseDir(header *InHeader, input *raw.ReleaseIn) ReleaseDir(header *InHeader, input *raw.ReleaseIn)
FsyncDir(header *InHeader, input *FsyncIn) (code Status) FsyncDir(header *InHeader, input *raw.FsyncIn) (code Status)
// //
Ioctl(header *InHeader, input *raw.IoctlIn) (output *raw.IoctlOut, data []byte, code Status) Ioctl(header *InHeader, input *raw.IoctlIn) (output *raw.IoctlOut, data []byte, code Status)
......
...@@ -39,7 +39,7 @@ func (me *DefaultFile) GetAttr() (*Attr, Status) { ...@@ -39,7 +39,7 @@ func (me *DefaultFile) GetAttr() (*Attr, Status) {
return nil, ENOSYS return nil, ENOSYS
} }
func (me *DefaultFile) Fsync(*FsyncIn) (code Status) { func (me *DefaultFile) Fsync(flags int) (code Status) {
return ENOSYS return ENOSYS
} }
......
...@@ -117,7 +117,7 @@ func (me *DefaultRawFileSystem) Flush(header *InHeader, input *FlushIn) Status { ...@@ -117,7 +117,7 @@ func (me *DefaultRawFileSystem) Flush(header *InHeader, input *FlushIn) Status {
return OK return OK
} }
func (me *DefaultRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status) { func (me *DefaultRawFileSystem) Fsync(header *InHeader, input *raw.FsyncIn) (code Status) {
return ENOSYS return ENOSYS
} }
...@@ -128,7 +128,7 @@ func (me *DefaultRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEn ...@@ -128,7 +128,7 @@ func (me *DefaultRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEn
func (me *DefaultRawFileSystem) ReleaseDir(header *InHeader, input *raw.ReleaseIn) { func (me *DefaultRawFileSystem) ReleaseDir(header *InHeader, input *raw.ReleaseIn) {
} }
func (me *DefaultRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status) { func (me *DefaultRawFileSystem) FsyncDir(header *InHeader, input *raw.FsyncIn) (code Status) {
return ENOSYS return ENOSYS
} }
......
...@@ -72,7 +72,7 @@ func (me *DevNullFile) Flush() Status { ...@@ -72,7 +72,7 @@ func (me *DevNullFile) Flush() Status {
return OK return OK
} }
func (me *DevNullFile) Fsync(*FsyncIn) (code Status) { func (me *DevNullFile) Fsync(flags int) (code Status) {
return OK return OK
} }
...@@ -112,7 +112,7 @@ func (me *LoopbackFile) Release() { ...@@ -112,7 +112,7 @@ func (me *LoopbackFile) Release() {
me.File.Close() me.File.Close()
} }
func (me *LoopbackFile) Fsync(*FsyncIn) (code Status) { func (me *LoopbackFile) Fsync(flags int) (code Status) {
return ToStatus(syscall.Fsync(int(me.File.Fd()))) return ToStatus(syscall.Fsync(int(me.File.Fd())))
} }
...@@ -156,7 +156,7 @@ func (me *ReadOnlyFile) Write(input *WriteIn, data []byte) (uint32, Status) { ...@@ -156,7 +156,7 @@ func (me *ReadOnlyFile) Write(input *WriteIn, data []byte) (uint32, Status) {
return 0, EPERM return 0, EPERM
} }
func (me *ReadOnlyFile) Fsync(*FsyncIn) (code Status) { func (me *ReadOnlyFile) Fsync(flag int) (code Status) {
return OK return OK
} }
......
...@@ -56,10 +56,6 @@ func (me *MutableDataFile) GetAttr() (*Attr, Status) { ...@@ -56,10 +56,6 @@ func (me *MutableDataFile) GetAttr() (*Attr, Status) {
return me.getAttr(), OK return me.getAttr(), OK
} }
func (me *MutableDataFile) Fsync(*FsyncIn) (code Status) {
return OK
}
func (me *MutableDataFile) Utimens(atimeNs int64, mtimeNs int64) Status { func (me *MutableDataFile) Utimens(atimeNs int64, mtimeNs int64) Status {
me.Attr.SetNs(atimeNs, mtimeNs, -1) me.Attr.SetNs(atimeNs, mtimeNs, -1)
return OK return OK
......
...@@ -290,7 +290,7 @@ func (me *LockingRawFileSystem) Flush(header *InHeader, input *FlushIn) Status { ...@@ -290,7 +290,7 @@ func (me *LockingRawFileSystem) Flush(header *InHeader, input *FlushIn) Status {
return me.RawFileSystem.Flush(header, input) return me.RawFileSystem.Flush(header, input)
} }
func (me *LockingRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status) { func (me *LockingRawFileSystem) Fsync(header *InHeader, input *raw.FsyncIn) (code Status) {
defer me.locked()() defer me.locked()()
return me.RawFileSystem.Fsync(header, input) return me.RawFileSystem.Fsync(header, input)
} }
...@@ -300,7 +300,7 @@ func (me *LockingRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEn ...@@ -300,7 +300,7 @@ func (me *LockingRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEn
return me.RawFileSystem.ReadDir(header, input) return me.RawFileSystem.ReadDir(header, input)
} }
func (me *LockingRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status) { func (me *LockingRawFileSystem) FsyncDir(header *InHeader, input *raw.FsyncIn) (code Status) {
defer me.locked()() defer me.locked()()
return me.RawFileSystem.FsyncDir(header, input) return me.RawFileSystem.FsyncDir(header, input)
} }
...@@ -288,7 +288,7 @@ func doRelease(state *MountState, req *request) { ...@@ -288,7 +288,7 @@ func doRelease(state *MountState, req *request) {
} }
func doFsync(state *MountState, req *request) { func doFsync(state *MountState, req *request) {
req.status = state.fileSystem.Fsync(req.inHeader, (*FsyncIn)(req.inData)) req.status = state.fileSystem.Fsync(req.inHeader, (*raw.FsyncIn)(req.inData))
} }
func doReleaseDir(state *MountState, req *request) { func doReleaseDir(state *MountState, req *request) {
...@@ -296,7 +296,7 @@ func doReleaseDir(state *MountState, req *request) { ...@@ -296,7 +296,7 @@ func doReleaseDir(state *MountState, req *request) {
} }
func doFsyncDir(state *MountState, req *request) { func doFsyncDir(state *MountState, req *request) {
req.status = state.fileSystem.FsyncDir(req.inHeader, (*FsyncIn)(req.inData)) req.status = state.fileSystem.FsyncDir(req.inHeader, (*raw.FsyncIn)(req.inData))
} }
func doSetXAttr(state *MountState, req *request) { func doSetXAttr(state *MountState, req *request) {
...@@ -400,7 +400,7 @@ func init() { ...@@ -400,7 +400,7 @@ func init() {
_OP_READ: unsafe.Sizeof(ReadIn{}), _OP_READ: unsafe.Sizeof(ReadIn{}),
_OP_WRITE: unsafe.Sizeof(WriteIn{}), _OP_WRITE: unsafe.Sizeof(WriteIn{}),
_OP_RELEASE: unsafe.Sizeof(raw.ReleaseIn{}), _OP_RELEASE: unsafe.Sizeof(raw.ReleaseIn{}),
_OP_FSYNC: unsafe.Sizeof(FsyncIn{}), _OP_FSYNC: unsafe.Sizeof(raw.FsyncIn{}),
_OP_SETXATTR: unsafe.Sizeof(raw.SetXAttrIn{}), _OP_SETXATTR: unsafe.Sizeof(raw.SetXAttrIn{}),
_OP_GETXATTR: unsafe.Sizeof(raw.GetXAttrIn{}), _OP_GETXATTR: unsafe.Sizeof(raw.GetXAttrIn{}),
_OP_LISTXATTR: unsafe.Sizeof(raw.GetXAttrIn{}), _OP_LISTXATTR: unsafe.Sizeof(raw.GetXAttrIn{}),
...@@ -409,7 +409,7 @@ func init() { ...@@ -409,7 +409,7 @@ func init() {
_OP_OPENDIR: unsafe.Sizeof(raw.OpenIn{}), _OP_OPENDIR: unsafe.Sizeof(raw.OpenIn{}),
_OP_READDIR: unsafe.Sizeof(ReadIn{}), _OP_READDIR: unsafe.Sizeof(ReadIn{}),
_OP_RELEASEDIR: unsafe.Sizeof(raw.ReleaseIn{}), _OP_RELEASEDIR: unsafe.Sizeof(raw.ReleaseIn{}),
_OP_FSYNCDIR: unsafe.Sizeof(FsyncIn{}), _OP_FSYNCDIR: unsafe.Sizeof(raw.FsyncIn{}),
_OP_ACCESS: unsafe.Sizeof(raw.AccessIn{}), _OP_ACCESS: unsafe.Sizeof(raw.AccessIn{}),
_OP_CREATE: unsafe.Sizeof(CreateIn{}), _OP_CREATE: unsafe.Sizeof(CreateIn{}),
_OP_INTERRUPT: unsafe.Sizeof(raw.InterruptIn{}), _OP_INTERRUPT: unsafe.Sizeof(raw.InterruptIn{}),
......
...@@ -176,11 +176,6 @@ type StatfsOut struct { ...@@ -176,11 +176,6 @@ type StatfsOut struct {
Kstatfs Kstatfs
} }
type FsyncIn struct {
Fh uint64
FsyncFlags uint32
Padding uint32
}
type InHeader struct { type InHeader struct {
Length uint32 Length uint32
......
...@@ -264,3 +264,9 @@ type AccessIn struct { ...@@ -264,3 +264,9 @@ type AccessIn struct {
Mask uint32 Mask uint32
Padding uint32 Padding uint32
} }
type FsyncIn struct {
Fh uint64
FsyncFlags uint32
Padding 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