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.

24 lines
671 B

3 years ago
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. // need to AcquireFileHandle again to ensure correct handle counter
  11. fileHandle = wfs.fhmap.AcquireFileHandle(wfs, inode, entry)
  12. }
  13. return
  14. }
  15. func (wfs *WFS) ReleaseHandle(handleId FileHandleId) {
  16. wfs.fhmap.ReleaseByHandle(handleId)
  17. }
  18. func (wfs *WFS) GetHandle(handleId FileHandleId) *FileHandle {
  19. return wfs.fhmap.GetFileHandle(handleId)
  20. }