aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/filehandle.go
blob: 55139426237f7b6955dcea6dbfc1797dc53bf05e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
}