add open release, refactor

This commit is contained in:
chrislu
2022-02-13 19:14:34 -08:00
parent 072f923a9b
commit bb9919b07a
8 changed files with 242 additions and 126 deletions

16
weed/mount/filehandle.go Normal file
View File

@@ -0,0 +1,16 @@
package mount
import "github.com/hanwen/go-fuse/v2/fuse"
func (wfs *WFS) AcquireHandle(inode uint64, uid, gid uint32) (fileHandle *FileHandle, code fuse.Status) {
_, entry, status := wfs.maybeReadEntry(inode)
if status == fuse.OK {
fileHandle = wfs.fhmap.GetFileHandle(inode)
fileHandle.entry = entry
}
return
}
func (wfs *WFS) ReleaseHandle(handleId FileHandleId) {
wfs.fhmap.ReleaseByHandle(handleId)
}