diff options
| author | chrislu <chris.lu@gmail.com> | 2023-09-21 11:08:26 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-09-21 11:08:26 -0700 |
| commit | 31fc1657151eb7bb0f45c0657deabe664526a0eb (patch) | |
| tree | 60d5ad8a1ad50506d2550163c02b9151117099db /weed/mount/filehandle.go | |
| parent | 76698522419902303117d3f736a619b8c01c60f4 (diff) | |
| download | seaweedfs-31fc1657151eb7bb0f45c0657deabe664526a0eb.tar.xz seaweedfs-31fc1657151eb7bb0f45c0657deabe664526a0eb.zip | |
mount switch to ordered lock requests
Diffstat (limited to 'weed/mount/filehandle.go')
| -rw-r--r-- | weed/mount/filehandle.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go index 6513d96ba..2e08432c0 100644 --- a/weed/mount/filehandle.go +++ b/weed/mount/filehandle.go @@ -27,7 +27,6 @@ type FileHandle struct { dirtyPages *PageWriter reader *filer.ChunkReadAt contentType string - sync.RWMutex isDeleted bool @@ -102,8 +101,9 @@ func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) { } func (fh *FileHandle) ReleaseHandle() { - fh.Lock() - defer fh.Unlock() + + fhActiveLock := fh.wfs.fhLockTable.AcquireLock("ReleaseHandle", fh.fh, util.ExclusiveLock) + defer fh.wfs.fhLockTable.ReleaseLock(fh.fh, fhActiveLock) fh.entryLock.Lock() defer fh.entryLock.Unlock() |
