aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/filehandle_map.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-08-07 10:46:29 -0700
committerchrislu <chris.lu@gmail.com>2024-08-07 10:46:29 -0700
commite86b0bcaaa16d98953890cb8754a76ea4e7a9d01 (patch)
tree465252cf8e5c2e89d375a609b141fe5bb6f487a7 /weed/mount/filehandle_map.go
parent57dc39c4516e5f42e77164babfdcfd84be2d0d2d (diff)
downloadseaweedfs-e86b0bcaaa16d98953890cb8754a76ea4e7a9d01.tar.xz
seaweedfs-e86b0bcaaa16d98953890cb8754a76ea4e7a9d01.zip
simplify
Diffstat (limited to 'weed/mount/filehandle_map.go')
-rw-r--r--weed/mount/filehandle_map.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/weed/mount/filehandle_map.go b/weed/mount/filehandle_map.go
index 288e0135d..852ef9e35 100644
--- a/weed/mount/filehandle_map.go
+++ b/weed/mount/filehandle_map.go
@@ -9,7 +9,6 @@ import (
type FileHandleToInode struct {
sync.RWMutex
- nextFh FileHandleId
inode2fh map[uint64]*FileHandle
fh2inode map[FileHandleId]uint64
}
@@ -18,7 +17,6 @@ func NewFileHandleToInode() *FileHandleToInode {
return &FileHandleToInode{
inode2fh: make(map[uint64]*FileHandle),
fh2inode: make(map[FileHandleId]uint64),
- nextFh: FileHandleId(util.RandomUint64()),
}
}
@@ -44,8 +42,7 @@ func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *fil
defer i.Unlock()
fh, found := i.inode2fh[inode]
if !found {
- fh = newFileHandle(wfs, i.nextFh, inode, entry)
- i.nextFh = FileHandleId(util.RandomUint64())
+ fh = newFileHandle(wfs, FileHandleId(util.RandomUint64()), inode, entry)
i.inode2fh[inode] = fh
i.fh2inode[fh.fh] = inode
} else {