diff options
Diffstat (limited to 'weed/mount/filehandle.go')
| -rw-r--r-- | weed/mount/filehandle.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go index 5d1552ce6..aadcb3836 100644 --- a/weed/mount/filehandle.go +++ b/weed/mount/filehandle.go @@ -1,6 +1,8 @@ package mount import ( + "golang.org/x/sync/semaphore" + "math" "sync" "golang.org/x/exp/slices" @@ -28,17 +30,18 @@ type FileHandle struct { reader *filer.ChunkReadAt contentType string handle uint64 - sync.Mutex + orderedMutex *semaphore.Weighted isDeleted bool } func newFileHandle(wfs *WFS, handleId FileHandleId, inode uint64, entry *filer_pb.Entry) *FileHandle { fh := &FileHandle{ - fh: handleId, - counter: 1, - inode: inode, - wfs: wfs, + fh: handleId, + counter: 1, + inode: inode, + wfs: wfs, + orderedMutex: semaphore.NewWeighted(int64(math.MaxInt64)), } // dirtyPages: newContinuousDirtyPages(file, writeOnly), fh.dirtyPages = newPageWriter(fh, wfs.option.ChunkSizeLimit) |
