Browse Source

fmt

improve-fuse-mount
chrislu 3 months ago
parent
commit
14a0e51fd1
  1. 6
      weed/mount/weedfs_file_io.go

6
weed/mount/weedfs_file_io.go

@ -67,14 +67,14 @@ func (wfs *WFS) Open(cancel <-chan struct{}, in *fuse.OpenIn, out *fuse.OpenOut)
if status == fuse.OK { if status == fuse.OK {
out.Fh = uint64(fileHandle.fh) out.Fh = uint64(fileHandle.fh)
out.OpenFlags = in.Flags out.OpenFlags = in.Flags
// Apply ML optimizations if enabled // Apply ML optimizations if enabled
if wfs.mlIntegration != nil { if wfs.mlIntegration != nil {
if path, _, entry, pathStatus := wfs.maybeReadEntry(in.NodeId); pathStatus == fuse.OK { if path, _, entry, pathStatus := wfs.maybeReadEntry(in.NodeId); pathStatus == fuse.OK {
wfs.mlIntegration.OnFileOpen(in.NodeId, entry, string(path), in.Flags, out) wfs.mlIntegration.OnFileOpen(in.NodeId, entry, string(path), in.Flags, out)
} }
} }
if wfs.option.IsMacOs { if wfs.option.IsMacOs {
// remove the direct_io flag, as it is not well-supported on macOS // remove the direct_io flag, as it is not well-supported on macOS
// https://code.google.com/archive/p/macfuse/wikis/OPTIONS.wiki recommended to avoid the direct_io flag // https://code.google.com/archive/p/macfuse/wikis/OPTIONS.wiki recommended to avoid the direct_io flag
@ -118,6 +118,6 @@ func (wfs *WFS) Release(cancel <-chan struct{}, in *fuse.ReleaseIn) {
if wfs.mlIntegration != nil { if wfs.mlIntegration != nil {
wfs.mlIntegration.OnFileClose(in.NodeId) wfs.mlIntegration.OnFileClose(in.NodeId)
} }
wfs.ReleaseHandle(FileHandleId(in.Fh)) wfs.ReleaseHandle(FileHandleId(in.Fh))
} }
Loading…
Cancel
Save