aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_filehandle.go
blob: 03f72282e8c168acfca102a0554b6dcdcfcc0fd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.AcquireFileHandle(wfs, inode, entry)
		fileHandle.entry = entry
	}
	return
}

func (wfs *WFS) ReleaseHandle(handleId FileHandleId) {
	wfs.fhmap.ReleaseByHandle(handleId)
}

func (wfs *WFS) GetHandle(handleId FileHandleId) *FileHandle {
	return wfs.fhmap.GetFileHandle(handleId)
}