simplify a bit
This commit is contained in:
@@ -137,16 +137,12 @@ func (v *Volume) readNeedleDataInto(n *needle.Needle, readOption *ReadOption, wr
|
|||||||
// possibly re-read needle offset if volume is compacted
|
// possibly re-read needle offset if volume is compacted
|
||||||
if readOption.VolumeRevision != v.SuperBlock.CompactionRevision {
|
if readOption.VolumeRevision != v.SuperBlock.CompactionRevision {
|
||||||
// the volume is compacted
|
// the volume is compacted
|
||||||
readOption.IsOutOfRange = false
|
|
||||||
nv, ok = v.nm.Get(n.Id)
|
nv, ok = v.nm.Get(n.Id)
|
||||||
if !ok || nv.Offset.IsZero() {
|
if !ok || nv.Offset.IsZero() {
|
||||||
v.dataFileAccessLock.RUnlock()
|
v.dataFileAccessLock.RUnlock()
|
||||||
return ErrorNotFound
|
return ErrorNotFound
|
||||||
}
|
}
|
||||||
actualOffset := nv.Offset.ToActualOffset()
|
actualOffset = nv.Offset.ToActualOffset()
|
||||||
if readOption.IsOutOfRange {
|
|
||||||
actualOffset += int64(MaxPossibleVolumeSize)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
count, err := n.ReadNeedleData(v.DataBackend, actualOffset, buf, x)
|
count, err := n.ReadNeedleData(v.DataBackend, actualOffset, buf, x)
|
||||||
v.dataFileAccessLock.RUnlock()
|
v.dataFileAccessLock.RUnlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user