Pass OpenFlags for OpenFileOp (#127)
parent
13117049f3
commit
9cc4ff0bc9
|
@ -294,8 +294,16 @@ func convertInMessage(
|
|||
}
|
||||
|
||||
case fusekernel.OpOpen:
|
||||
type input fusekernel.OpenIn
|
||||
in := (*input)(inMsg.Consume(unsafe.Sizeof(input{})))
|
||||
if in == nil {
|
||||
return nil, errors.New("Corrupt OpOpen")
|
||||
}
|
||||
openFlags := fusekernel.OpenFlags(in.Flags)
|
||||
|
||||
o = &fuseops.OpenFileOp{
|
||||
Inode: fuseops.InodeID(inMsg.Header().Nodeid),
|
||||
OpenFlags: &openFlags,
|
||||
OpContext: fuseops.OpContext{Pid: inMsg.Header().Pid},
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ package fuseops
|
|||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/jacobsa/fuse/internal/fusekernel"
|
||||
)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
@ -646,6 +648,8 @@ type OpenFileOp struct {
|
|||
// advance, for example, because contents are generated on the fly.
|
||||
UseDirectIO bool
|
||||
|
||||
OpenFlags *fusekernel.OpenFlags
|
||||
|
||||
OpContext OpContext
|
||||
}
|
||||
|
||||
|
|
|
@ -661,6 +661,9 @@ func (fs *memFS) OpenFile(
|
|||
// OpenFileOp should have a valid pid in context.
|
||||
return fuse.EINVAL
|
||||
}
|
||||
if op.OpenFlags == nil {
|
||||
return fuse.EINVAL
|
||||
}
|
||||
|
||||
fs.mu.Lock()
|
||||
defer fs.mu.Unlock()
|
||||
|
|
Loading…
Reference in New Issue