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

@@ -3,6 +3,7 @@ package mount
import (
"bytes"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/util"
"io"
"github.com/hanwen/go-fuse/v2/fuse"
@@ -41,8 +42,8 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse
return nil, fuse.ENOENT
}
fh.RLock()
defer fh.RUnlock()
fhActiveLock := fh.wfs.fhLockTable.AcquireLock("Read", fh.fh, util.SharedLock)
defer fh.wfs.fhLockTable.ReleaseLock(fh.fh, fhActiveLock)
offset := int64(in.Offset)
totalRead, err := readDataByFileHandle(buff, fh, offset)