mount switch to ordered lock requests

This commit is contained in:
chrislu
2023-09-21 11:08:26 -07:00
parent 7669852241
commit 31fc165715
7 changed files with 23 additions and 15 deletions

View File

@@ -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()