This commit is contained in:
Chris Lu 2020-08-17 11:12:10 -07:00
parent 4ccfdaeb4d
commit 9d46c7bc78
3 changed files with 4 additions and 4 deletions

View file

@ -172,11 +172,11 @@ func min(x, y int64) int64 {
return y
}
func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (maxStop int64) {
func (pages *ContinuousDirtyPages) ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64) {
pages.lock.Lock()
defer pages.lock.Unlock()
return pages.intervals.ReadData(data, startOffset)
return pages.intervals.ReadDataAt(data, startOffset)
}

View file

@ -185,7 +185,7 @@ func (c *ContinuousIntervals) removeList(target *IntervalLinkedList) {
}
func (c *ContinuousIntervals) ReadData(data []byte, startOffset int64) (maxStop int64) {
func (c *ContinuousIntervals) ReadDataAt(data []byte, startOffset int64) (maxStop int64) {
for _, list := range c.lists {
start := max(startOffset, list.Offset())
stop := min(startOffset+int64(len(data)), list.Offset()+list.Size())

View file

@ -80,7 +80,7 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
}
func (fh *FileHandle) readFromDirtyPages(buff []byte, startOffset int64) (maxStop int64) {
return fh.dirtyPages.ReadDirtyData(buff, startOffset)
return fh.dirtyPages.ReadDirtyDataAt(buff, startOffset)
}
func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {