123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- package mount
- import (
- "github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
- )
- func (wfs *WFS) Open(cancel <-chan struct{}, in *fuse.OpenIn, out *fuse.OpenOut) (status fuse.Status) {
- var fileHandle *FileHandle
- fileHandle, status = wfs.AcquireHandle(in.NodeId, in.Flags, in.Uid, in.Gid)
- if status == fuse.OK {
- out.Fh = uint64(fileHandle.fh)
- out.OpenFlags = in.Flags
- if wfs.option.IsMacOs {
-
-
- if in.Flags&fuse.FOPEN_DIRECT_IO != 0 {
- glog.V(4).Infof("macfuse direct_io mode %v => false\n", in.Flags&fuse.FOPEN_DIRECT_IO != 0)
- out.OpenFlags &^= fuse.FOPEN_DIRECT_IO
- }
- }
-
- }
- return status
- }
- func (wfs *WFS) Release(cancel <-chan struct{}, in *fuse.ReleaseIn) {
- wfs.ReleaseHandle(FileHandleId(in.Fh))
- }
|