seaweedfs/weed/mount/weedfs_filehandle.go

21 lines
544 B
Go
Raw Normal View History

2022-02-14 03:14:34 +00:00
package mount
import "github.com/hanwen/go-fuse/v2/fuse"
func (wfs *WFS) AcquireHandle(inode uint64, uid, gid uint32) (fileHandle *FileHandle, code fuse.Status) {
2022-02-14 09:36:10 +00:00
_, _, entry, status := wfs.maybeReadEntry(inode)
2022-02-14 03:14:34 +00:00
if status == fuse.OK {
2022-02-14 06:50:44 +00:00
fileHandle = wfs.fhmap.AcquireFileHandle(wfs, inode, entry)
2022-02-14 03:14:34 +00:00
fileHandle.entry = entry
}
return
}
func (wfs *WFS) ReleaseHandle(handleId FileHandleId) {
wfs.fhmap.ReleaseByHandle(handleId)
}
2022-02-14 06:50:44 +00:00
func (wfs *WFS) GetHandle(handleId FileHandleId) *FileHandle {
return wfs.fhmap.GetFileHandle(handleId)
}