You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
601 B

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