mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 10:13:33 +08:00
randomizing next file handle id
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"math"
|
||||
"sync"
|
||||
)
|
||||
@@ -45,7 +46,7 @@ func NewDirectoryHandleToInode() *DirectoryHandleToInode {
|
||||
func (wfs *WFS) AcquireDirectoryHandle() (DirectoryHandleId, *DirectoryHandle) {
|
||||
wfs.fhmap.Lock()
|
||||
fh := wfs.fhmap.nextFh
|
||||
wfs.fhmap.nextFh++
|
||||
wfs.fhmap.nextFh = FileHandleId(util.RandomUint64())
|
||||
wfs.fhmap.Unlock()
|
||||
|
||||
wfs.dhmap.Lock()
|
||||
|
Reference in New Issue
Block a user