weedfs_filehandle.go 544 B

1234567891011121314151617181920
  1. package mount
  2. import "github.com/hanwen/go-fuse/v2/fuse"
  3. func (wfs *WFS) AcquireHandle(inode uint64, uid, gid uint32) (fileHandle *FileHandle, code fuse.Status) {
  4. _, _, entry, status := wfs.maybeReadEntry(inode)
  5. if status == fuse.OK {
  6. fileHandle = wfs.fhmap.AcquireFileHandle(wfs, inode, entry)
  7. fileHandle.entry = entry
  8. }
  9. return
  10. }
  11. func (wfs *WFS) ReleaseHandle(handleId FileHandleId) {
  12. wfs.fhmap.ReleaseByHandle(handleId)
  13. }
  14. func (wfs *WFS) GetHandle(handleId FileHandleId) *FileHandle {
  15. return wfs.fhmap.GetFileHandle(handleId)
  16. }