Commit 85a08fb9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: implement Lseek

parent bffc1113
...@@ -239,6 +239,7 @@ type RawFileSystem interface { ...@@ -239,6 +239,7 @@ type RawFileSystem interface {
Create(cancel <-chan struct{}, input *CreateIn, name string, out *CreateOut) (code Status) Create(cancel <-chan struct{}, input *CreateIn, name string, out *CreateOut) (code Status)
Open(cancel <-chan struct{}, input *OpenIn, out *OpenOut) (status Status) Open(cancel <-chan struct{}, input *OpenIn, out *OpenOut) (status Status)
Read(cancel <-chan struct{}, input *ReadIn, buf []byte) (ReadResult, Status) Read(cancel <-chan struct{}, input *ReadIn, buf []byte) (ReadResult, Status)
Lseek(cancel <-chan struct{}, in *LseekIn, out *LseekOut) Status
// File locking // File locking
GetLk(cancel <-chan struct{}, input *LkIn, out *LkOut) (code Status) GetLk(cancel <-chan struct{}, input *LkIn, out *LkOut) (code Status)
......
...@@ -162,3 +162,7 @@ func (fs *defaultRawFileSystem) Fallocate(cancel <-chan struct{}, in *FallocateI ...@@ -162,3 +162,7 @@ func (fs *defaultRawFileSystem) Fallocate(cancel <-chan struct{}, in *FallocateI
func (fs *defaultRawFileSystem) CopyFileRange(cancel <-chan struct{}, input *CopyFileRangeIn) (written uint32, code Status) { func (fs *defaultRawFileSystem) CopyFileRange(cancel <-chan struct{}, input *CopyFileRangeIn) (written uint32, code Status) {
return 0, ENOSYS return 0, ENOSYS
} }
func (fs *defaultRawFileSystem) Lseek(cancel <-chan struct{}, in *LseekIn, out *LseekOut) Status {
return ENOSYS
}
...@@ -498,3 +498,7 @@ func (c *rawBridge) Flush(cancel <-chan struct{}, input *fuse.FlushIn) fuse.Stat ...@@ -498,3 +498,7 @@ func (c *rawBridge) Flush(cancel <-chan struct{}, input *fuse.FlushIn) fuse.Stat
func (c *rawBridge) CopyFileRange(cancel <-chan struct{}, input *fuse.CopyFileRangeIn) (written uint32, code fuse.Status) { func (c *rawBridge) CopyFileRange(cancel <-chan struct{}, input *fuse.CopyFileRangeIn) (written uint32, code fuse.Status) {
return 0, fuse.ENOSYS return 0, fuse.ENOSYS
} }
func (fs *rawBridge) Lseek(cancel <-chan struct{}, in *fuse.LseekIn, out *fuse.LseekOut) fuse.Status {
return fuse.ENOSYS
}
...@@ -441,6 +441,12 @@ func doSetLkw(server *Server, req *request) { ...@@ -441,6 +441,12 @@ func doSetLkw(server *Server, req *request) {
req.status = server.fileSystem.SetLkw(req.cancel, (*LkIn)(req.inData)) req.status = server.fileSystem.SetLkw(req.cancel, (*LkIn)(req.inData))
} }
func doLseek(server *Server, req *request) {
in := (*LseekIn)(req.inData)
out := (*LseekOut)(req.outData())
req.status = server.fileSystem.Lseek(req.cancel, in, out)
}
func doCopyFileRange(server *Server, req *request) { func doCopyFileRange(server *Server, req *request) {
in := (*CopyFileRangeIn)(req.inData) in := (*CopyFileRangeIn)(req.inData)
out := (*WriteOut)(req.outData()) out := (*WriteOut)(req.outData())
...@@ -683,6 +689,7 @@ func init() { ...@@ -683,6 +689,7 @@ func init() {
_OP_RENAME2: doRename2, _OP_RENAME2: doRename2,
_OP_INTERRUPT: doInterrupt, _OP_INTERRUPT: doInterrupt,
_OP_COPY_FILE_RANGE: doCopyFileRange, _OP_COPY_FILE_RANGE: doCopyFileRange,
_OP_LSEEK: doLseek,
} { } {
operationHandlers[op].Func = v operationHandlers[op].Func = v
} }
......
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