summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/epoll
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-11 21:27:53 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-11 21:27:53 +0000
commite524c21569616484e3209be952dd90636209419e (patch)
treed425976e5c7d7499187b93feb31d97fbd11408bf /pkg/sentry/kernel/epoll
parent3ff3110fcdd696053e8cafc807f2409fe1269cce (diff)
parent4c4de66443174f2ed7f4fa533a1d09c709be9427 (diff)
Merge release-20201216.0-82-g4c4de6644 (automated)
Diffstat (limited to 'pkg/sentry/kernel/epoll')
-rw-r--r--pkg/sentry/kernel/epoll/epoll_list.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/epoll/epoll_list.go b/pkg/sentry/kernel/epoll/epoll_list.go
index 56d05c770..b6abe2de9 100644
--- a/pkg/sentry/kernel/epoll/epoll_list.go
+++ b/pkg/sentry/kernel/epoll/epoll_list.go
@@ -38,16 +38,22 @@ func (l *pollEntryList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *pollEntryList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *pollEntryList) Front() *pollEntry {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *pollEntryList) Back() *pollEntry {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *pollEntryList) Back() *pollEntry {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *pollEntryList) Len() (count int) {
for e := l.Front(); e != nil; e = (pollEntryElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *pollEntryList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *pollEntryList) PushFront(e *pollEntry) {
linker := pollEntryElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *pollEntryList) PushFront(e *pollEntry) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *pollEntryList) PushBack(e *pollEntry) {
linker := pollEntryElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *pollEntryList) PushBack(e *pollEntry) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *pollEntryList) PushBackList(m *pollEntryList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *pollEntryList) PushBackList(m *pollEntryList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *pollEntryList) InsertAfter(b, e *pollEntry) {
bLinker := pollEntryElementMapper{}.linkerFor(b)
eLinker := pollEntryElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *pollEntryList) InsertAfter(b, e *pollEntry) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *pollEntryList) InsertBefore(a, e *pollEntry) {
aLinker := pollEntryElementMapper{}.linkerFor(a)
eLinker := pollEntryElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *pollEntryList) InsertBefore(a, e *pollEntry) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *pollEntryList) Remove(e *pollEntry) {
linker := pollEntryElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type pollEntryEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *pollEntryEntry) Next() *pollEntry {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *pollEntryEntry) Prev() *pollEntry {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *pollEntryEntry) SetNext(elem *pollEntry) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *pollEntryEntry) SetPrev(elem *pollEntry) {
e.prev = elem
}