Skip to content

Commit cfcbf44

Browse files
nixprimegvisor-bot
authored andcommitted
Remove "AddressSpace activation".
PiperOrigin-RevId: 829101729
1 parent 5edbb90 commit cfcbf44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+373
-591
lines changed

pkg/context/context.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,12 @@ type Blocker interface {
6666
BlockWithTimeoutOn(waiter.Waitable, waiter.EventMask, time.Duration) (time.Duration, bool)
6767

6868
// UninterruptibleSleepStart indicates the beginning of an uninterruptible
69-
// sleep state (equivalent to Linux's TASK_UNINTERRUPTIBLE). If deactivate
70-
// is true and the Context represents a Task, the Task's AddressSpace is
71-
// deactivated.
72-
UninterruptibleSleepStart(deactivate bool)
69+
// sleep state (equivalent to Linux's TASK_UNINTERRUPTIBLE).
70+
UninterruptibleSleepStart()
7371

7472
// UninterruptibleSleepFinish indicates the end of an uninterruptible sleep
75-
// state that was begun by a previous call to UninterruptibleSleepStart. If
76-
// activate is true and the Context represents a Task, the Task's
77-
// AddressSpace is activated. Normally activate is the same value as the
78-
// deactivate parameter passed to UninterruptibleSleepStart.
79-
UninterruptibleSleepFinish(activate bool)
73+
// state that was begun by a previous call to UninterruptibleSleepStart.
74+
UninterruptibleSleepFinish()
8075
}
8176

8277
// NoTask is an implementation of Blocker that does not block.
@@ -155,10 +150,10 @@ func (nt *NoTask) BlockWithTimeoutOn(w waiter.Waitable, mask waiter.EventMask, d
155150
}
156151

157152
// UninterruptibleSleepStart implmenents Blocker.UninterruptedSleepStart.
158-
func (*NoTask) UninterruptibleSleepStart(bool) {}
153+
func (*NoTask) UninterruptibleSleepStart() {}
159154

160155
// UninterruptibleSleepFinish implmenents Blocker.UninterruptibleSleepFinish.
161-
func (*NoTask) UninterruptibleSleepFinish(bool) {}
156+
func (*NoTask) UninterruptibleSleepFinish() {}
162157

163158
// Context represents a thread of execution (hereafter "goroutine" to reflect
164159
// Go idiosyncrasy). It carries state associated with the goroutine across API

pkg/devutil/devutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type GoferClient struct {
3636
// NewGoferClient establishes the LISAFS connection to the dev gofer server.
3737
// It takes ownership of fd. contName is the owning container name.
3838
func NewGoferClient(ctx context.Context, contName string, fd int) (*GoferClient, error) {
39-
ctx.UninterruptibleSleepStart(false)
40-
defer ctx.UninterruptibleSleepFinish(false)
39+
ctx.UninterruptibleSleepStart()
40+
defer ctx.UninterruptibleSleepFinish()
4141

4242
sock, err := unet.NewSocket(fd)
4343
if err != nil {

pkg/hostarch/addr.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ func (v Addr) ToRange(length uint64) (AddrRange, bool) {
101101
return AddrRange{v, end}, ok
102102
}
103103

104+
// MustToRange is equivalent to ToRange, but panics if the end of the range
105+
// wraps around.
106+
//
107+
//go:nosplit
108+
func (v Addr) MustToRange(length uint64) AddrRange {
109+
ar, ok := v.ToRange(length)
110+
if !ok {
111+
panic("hostarch.Addr.ToRange() wraps")
112+
}
113+
return ar
114+
}
115+
104116
// IsPageAligned returns true if ar.Start.IsPageAligned() and
105117
// ar.End.IsPageAligned().
106118
func (ar AddrRange) IsPageAligned() bool {

pkg/lisafs/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ func (c *Client) CloseFD(ctx context.Context, fd FDID, flush bool) {
290290

291291
req := CloseReq{FDs: toClose}
292292
var resp CloseResp
293-
ctx.UninterruptibleSleepStart(false)
293+
ctx.UninterruptibleSleepStart()
294294
err := c.SndRcvMessage(Close, uint32(req.SizeBytes()), req.MarshalBytes, resp.CheckedUnmarshal, nil, req.String, resp.String)
295-
ctx.UninterruptibleSleepFinish(false)
295+
ctx.UninterruptibleSleepFinish()
296296
if err != nil {
297297
log.Warningf("lisafs: batch closing FDs returned error: %v", err)
298298
}
@@ -305,9 +305,9 @@ func (c *Client) SyncFDs(ctx context.Context, fds []FDID) error {
305305
}
306306
req := FsyncReq{FDs: fds}
307307
var resp FsyncResp
308-
ctx.UninterruptibleSleepStart(false)
308+
ctx.UninterruptibleSleepStart()
309309
err := c.SndRcvMessage(FSync, uint32(req.SizeBytes()), req.MarshalBytes, resp.CheckedUnmarshal, nil, req.String, resp.String)
310-
ctx.UninterruptibleSleepFinish(false)
310+
ctx.UninterruptibleSleepFinish()
311311
return err
312312
}
313313

0 commit comments

Comments
 (0)