Skip to content

Commit 3f2ea82

Browse files
committed
fix lint: drop unused zeroedBlocks return (unparam)
1 parent 49e1d77 commit 3f2ea82

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎packages/orchestrator/pkg/sandbox/uffd/userfaultfd/remove_range.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ import (
2626
//
2727
// The caller must hold settleRequests.Lock (same as the Zero SetRange in
2828
// the serve loop's REMOVE batch).
29-
func applyRemoveRange(tracker *block.Tracker, tainted *roaring.Bitmap, startOff, length, pageSize int64) (zeroedBlocks, taintedBlocks int) {
29+
func applyRemoveRange(tracker *block.Tracker, tainted *roaring.Bitmap, startOff, length, pageSize int64) (taintedBlocks int) {
3030
end := startOff + length
3131
zeroStart := (startOff + pageSize - 1) / pageSize
3232
zeroEnd := end / pageSize
3333
if zeroEnd > zeroStart {
3434
tracker.SetRange(uint32(zeroStart), uint32(zeroEnd), block.Zero)
35-
zeroedBlocks = int(zeroEnd - zeroStart)
3635
}
3736

3837
taint := func(idx int64) {
@@ -50,5 +49,5 @@ func applyRemoveRange(tracker *block.Tracker, tainted *roaring.Bitmap, startOff,
5049
taint(end / pageSize)
5150
}
5251

53-
return zeroedBlocks, taintedBlocks
52+
return taintedBlocks
5453
}

‎packages/orchestrator/pkg/sandbox/uffd/userfaultfd/userfaultfd.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func (u *Userfaultfd) Serve(
395395
}
396396

397397
length := int64(rm.end - rm.start)
398-
if _, tainted := applyRemoveRange(u.pageTracker, u.removeTainted, startOff, length, int64(u.pageSize)); tainted > 0 {
398+
if tainted := applyRemoveRange(u.pageTracker, u.removeTainted, startOff, length, int64(u.pageSize)); tainted > 0 {
399399
u.logger.Warn(ctx, "UFFD REMOVE range not aligned to tracker page size; tainted partially covered blocks for pause re-scan",
400400
zap.Int64("start_off", startOff),
401401
zap.Int64("length", length),

0 commit comments

Comments
 (0)