diff options
| author | chrislu <chris.lu@gmail.com> | 2022-09-08 18:54:16 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-09-08 18:54:16 -0700 |
| commit | 406a80da4b87d4e984696030d8a8e5c962c1ad4b (patch) | |
| tree | 087aeb3751662ee5d694dbc1f577b1cd22b65ce7 /weed | |
| parent | 2bfc8970d2c5bb55f45432ca6bcc9f6cfc933274 (diff) | |
| download | seaweedfs-406a80da4b87d4e984696030d8a8e5c962c1ad4b.tar.xz seaweedfs-406a80da4b87d4e984696030d8a8e5c962c1ad4b.zip | |
adjust variable names
Diffstat (limited to 'weed')
| -rw-r--r-- | weed/storage/volume_read.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/weed/storage/volume_read.go b/weed/storage/volume_read.go index d4f6a55d6..d072e0ac9 100644 --- a/weed/storage/volume_read.go +++ b/weed/storage/volume_read.go @@ -134,12 +134,9 @@ func (v *Volume) readNeedleDataInto(n *needle.Needle, readOption *ReadOption, wr // read needle data crc := needle.CRC(0) - r := v.DataBackend - volumeOffset := actualOffset - needleOffset := offset - for x := needleOffset; x < needleOffset+size; x += int64(len(buf)) { - count, err := n.ReadNeedleData(r, volumeOffset, buf, x) - toWrite := min(count, int(needleOffset+size-x)) + for x := offset; x < offset+size; x += int64(len(buf)) { + count, err := n.ReadNeedleData(v.DataBackend, actualOffset, buf, x) + toWrite := min(count, int(offset+size-x)) if toWrite > 0 { crc = crc.Update(buf[0:toWrite]) if _, err = writer.Write(buf[0:toWrite]); err != nil { @@ -157,7 +154,7 @@ func (v *Volume) readNeedleDataInto(n *needle.Needle, readOption *ReadOption, wr break } } - if needleOffset == 0 && size == int64(n.DataSize) && (n.Checksum != crc && uint32(n.Checksum) != crc.Value()) { + if offset == 0 && size == int64(n.DataSize) && (n.Checksum != crc && uint32(n.Checksum) != crc.Value()) { // the crc.Value() function is to be deprecated. this double checking is for backward compatible. return fmt.Errorf("ReadNeedleData checksum %v expected %v", crc, n.Checksum) } |
