diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-10-05 09:47:04 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-10-05 09:47:07 -0700 |
| commit | 8f8e9ddbde6e4d8eff79474d891a21de50bc6527 (patch) | |
| tree | cd059d2f88088c2d9b70963727038ff35e8cd100 | |
| parent | 875ee5c0d484fbb46289d34b21aea8f3d8de9344 (diff) | |
| download | seaweedfs-8f8e9ddbde6e4d8eff79474d891a21de50bc6527.tar.xz seaweedfs-8f8e9ddbde6e4d8eff79474d891a21de50bc6527.zip | |
adjust API
| -rw-r--r-- | weed/filer/reader_at.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/filer/reader_at.go b/weed/filer/reader_at.go index af6f688e7..17a1ba517 100644 --- a/weed/filer/reader_at.go +++ b/weed/filer/reader_at.go @@ -142,7 +142,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { } -func (c *ChunkReadAt) readFromWholeChunkData(chunkView, nextChunkView *ChunkView) (chunkData []byte, err error) { +func (c *ChunkReadAt) readFromWholeChunkData(chunkView *ChunkView, nextChunkViews... *ChunkView) (chunkData []byte, err error) { if c.lastChunkFileId == chunkView.FileId { return c.lastChunkData, nil @@ -160,8 +160,10 @@ func (c *ChunkReadAt) readFromWholeChunkData(chunkView, nextChunkView *ChunkView c.lastChunkFileId = chunkView.FileId go func() { - if c.chunkCache != nil && nextChunkView != nil { - c.readOneWholeChunk(nextChunkView) + for _, nextChunkView := range nextChunkViews { + if c.chunkCache != nil && nextChunkView != nil { + c.readOneWholeChunk(nextChunkView) + } } }() |
