Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

adjust variable names

chrislu406a80da4b87
diff --git a/weed/storage/volume_read.go b/weed/storage/volume_read.go
index d4f6a55d6d..d072e0ac97 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)
}