summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-03 22:13:29 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-03 22:13:29 +0000
commit5f5127ba9ddb8f52d43827b6ab96b8169af5075f (patch)
tree701124de37c5bf475ba6920641948d637da0ee8b /pkg/sentry
parent56f91c540e938374a025c31cf23aa2e4d00cacec (diff)
parent844e4d284cddf9795a0db7c38f926fe7b49bb873 (diff)
Merge release-20200219.0-91-g844e4d2 (automated)
Diffstat (limited to 'pkg/sentry')
-rwxr-xr-xpkg/sentry/fs/dirent_list.go33
-rwxr-xr-xpkg/sentry/fs/event_list.go33
-rwxr-xr-xpkg/sentry/kernel/epoll/epoll_list.go33
-rwxr-xr-xpkg/sentry/kernel/futex/waiter_list.go33
-rwxr-xr-xpkg/sentry/kernel/pending_signals_list.go33
-rwxr-xr-xpkg/sentry/kernel/process_group_list.go33
-rwxr-xr-xpkg/sentry/kernel/semaphore/waiter_list.go33
-rwxr-xr-xpkg/sentry/kernel/session_list.go33
-rwxr-xr-xpkg/sentry/kernel/socket_list.go33
-rwxr-xr-xpkg/sentry/kernel/task_list.go33
-rwxr-xr-xpkg/sentry/mm/io_list.go33
-rwxr-xr-xpkg/sentry/socket/unix/transport/transport_message_list.go33
-rwxr-xr-xpkg/sentry/vfs/epoll_interest_list.go33
13 files changed, 273 insertions, 156 deletions
diff --git a/pkg/sentry/fs/dirent_list.go b/pkg/sentry/fs/dirent_list.go
index 750961a48..49d25da6c 100755
--- a/pkg/sentry/fs/dirent_list.go
+++ b/pkg/sentry/fs/dirent_list.go
@@ -54,8 +54,9 @@ func (l *direntList) Back() *Dirent {
// PushFront inserts the element e at the front of list l.
func (l *direntList) PushFront(e *Dirent) {
- direntElementMapper{}.linkerFor(e).SetNext(l.head)
- direntElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := direntElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
direntElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *direntList) PushFront(e *Dirent) {
// PushBack inserts the element e at the back of list l.
func (l *direntList) PushBack(e *Dirent) {
- direntElementMapper{}.linkerFor(e).SetNext(nil)
- direntElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := direntElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
direntElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *direntList) PushBackList(m *direntList) {
// InsertAfter inserts e after b.
func (l *direntList) InsertAfter(b, e *Dirent) {
- a := direntElementMapper{}.linkerFor(b).Next()
- direntElementMapper{}.linkerFor(e).SetNext(a)
- direntElementMapper{}.linkerFor(e).SetPrev(b)
- direntElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := direntElementMapper{}.linkerFor(b)
+ eLinker := direntElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
direntElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *direntList) InsertAfter(b, e *Dirent) {
// InsertBefore inserts e before a.
func (l *direntList) InsertBefore(a, e *Dirent) {
- b := direntElementMapper{}.linkerFor(a).Prev()
- direntElementMapper{}.linkerFor(e).SetNext(a)
- direntElementMapper{}.linkerFor(e).SetPrev(b)
- direntElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := direntElementMapper{}.linkerFor(a)
+ eLinker := direntElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
direntElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/fs/event_list.go b/pkg/sentry/fs/event_list.go
index c94cb03e1..786686592 100755
--- a/pkg/sentry/fs/event_list.go
+++ b/pkg/sentry/fs/event_list.go
@@ -54,8 +54,9 @@ func (l *eventList) Back() *Event {
// PushFront inserts the element e at the front of list l.
func (l *eventList) PushFront(e *Event) {
- eventElementMapper{}.linkerFor(e).SetNext(l.head)
- eventElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := eventElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
eventElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *eventList) PushFront(e *Event) {
// PushBack inserts the element e at the back of list l.
func (l *eventList) PushBack(e *Event) {
- eventElementMapper{}.linkerFor(e).SetNext(nil)
- eventElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := eventElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
eventElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *eventList) PushBackList(m *eventList) {
// InsertAfter inserts e after b.
func (l *eventList) InsertAfter(b, e *Event) {
- a := eventElementMapper{}.linkerFor(b).Next()
- eventElementMapper{}.linkerFor(e).SetNext(a)
- eventElementMapper{}.linkerFor(e).SetPrev(b)
- eventElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := eventElementMapper{}.linkerFor(b)
+ eLinker := eventElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
eventElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *eventList) InsertAfter(b, e *Event) {
// InsertBefore inserts e before a.
func (l *eventList) InsertBefore(a, e *Event) {
- b := eventElementMapper{}.linkerFor(a).Prev()
- eventElementMapper{}.linkerFor(e).SetNext(a)
- eventElementMapper{}.linkerFor(e).SetPrev(b)
- eventElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := eventElementMapper{}.linkerFor(a)
+ eLinker := eventElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
eventElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/epoll/epoll_list.go b/pkg/sentry/kernel/epoll/epoll_list.go
index 94d5c9e57..5ac854e38 100755
--- a/pkg/sentry/kernel/epoll/epoll_list.go
+++ b/pkg/sentry/kernel/epoll/epoll_list.go
@@ -54,8 +54,9 @@ func (l *pollEntryList) Back() *pollEntry {
// PushFront inserts the element e at the front of list l.
func (l *pollEntryList) PushFront(e *pollEntry) {
- pollEntryElementMapper{}.linkerFor(e).SetNext(l.head)
- pollEntryElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := pollEntryElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
pollEntryElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *pollEntryList) PushFront(e *pollEntry) {
// PushBack inserts the element e at the back of list l.
func (l *pollEntryList) PushBack(e *pollEntry) {
- pollEntryElementMapper{}.linkerFor(e).SetNext(nil)
- pollEntryElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := pollEntryElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
pollEntryElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *pollEntryList) PushBackList(m *pollEntryList) {
// InsertAfter inserts e after b.
func (l *pollEntryList) InsertAfter(b, e *pollEntry) {
- a := pollEntryElementMapper{}.linkerFor(b).Next()
- pollEntryElementMapper{}.linkerFor(e).SetNext(a)
- pollEntryElementMapper{}.linkerFor(e).SetPrev(b)
- pollEntryElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := pollEntryElementMapper{}.linkerFor(b)
+ eLinker := pollEntryElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
pollEntryElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *pollEntryList) InsertAfter(b, e *pollEntry) {
// InsertBefore inserts e before a.
func (l *pollEntryList) InsertBefore(a, e *pollEntry) {
- b := pollEntryElementMapper{}.linkerFor(a).Prev()
- pollEntryElementMapper{}.linkerFor(e).SetNext(a)
- pollEntryElementMapper{}.linkerFor(e).SetPrev(b)
- pollEntryElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := pollEntryElementMapper{}.linkerFor(a)
+ eLinker := pollEntryElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
pollEntryElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/futex/waiter_list.go b/pkg/sentry/kernel/futex/waiter_list.go
index cca5c4721..b6baa1b5b 100755
--- a/pkg/sentry/kernel/futex/waiter_list.go
+++ b/pkg/sentry/kernel/futex/waiter_list.go
@@ -54,8 +54,9 @@ func (l *waiterList) Back() *Waiter {
// PushFront inserts the element e at the front of list l.
func (l *waiterList) PushFront(e *Waiter) {
- waiterElementMapper{}.linkerFor(e).SetNext(l.head)
- waiterElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := waiterElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
waiterElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *waiterList) PushFront(e *Waiter) {
// PushBack inserts the element e at the back of list l.
func (l *waiterList) PushBack(e *Waiter) {
- waiterElementMapper{}.linkerFor(e).SetNext(nil)
- waiterElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := waiterElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
waiterElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *waiterList) PushBackList(m *waiterList) {
// InsertAfter inserts e after b.
func (l *waiterList) InsertAfter(b, e *Waiter) {
- a := waiterElementMapper{}.linkerFor(b).Next()
- waiterElementMapper{}.linkerFor(e).SetNext(a)
- waiterElementMapper{}.linkerFor(e).SetPrev(b)
- waiterElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := waiterElementMapper{}.linkerFor(b)
+ eLinker := waiterElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
waiterElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *waiterList) InsertAfter(b, e *Waiter) {
// InsertBefore inserts e before a.
func (l *waiterList) InsertBefore(a, e *Waiter) {
- b := waiterElementMapper{}.linkerFor(a).Prev()
- waiterElementMapper{}.linkerFor(e).SetNext(a)
- waiterElementMapper{}.linkerFor(e).SetPrev(b)
- waiterElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := waiterElementMapper{}.linkerFor(a)
+ eLinker := waiterElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
waiterElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/pending_signals_list.go b/pkg/sentry/kernel/pending_signals_list.go
index a3499371a..26b9ffd98 100755
--- a/pkg/sentry/kernel/pending_signals_list.go
+++ b/pkg/sentry/kernel/pending_signals_list.go
@@ -54,8 +54,9 @@ func (l *pendingSignalList) Back() *pendingSignal {
// PushFront inserts the element e at the front of list l.
func (l *pendingSignalList) PushFront(e *pendingSignal) {
- pendingSignalElementMapper{}.linkerFor(e).SetNext(l.head)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := pendingSignalElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
pendingSignalElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *pendingSignalList) PushFront(e *pendingSignal) {
// PushBack inserts the element e at the back of list l.
func (l *pendingSignalList) PushBack(e *pendingSignal) {
- pendingSignalElementMapper{}.linkerFor(e).SetNext(nil)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := pendingSignalElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
pendingSignalElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *pendingSignalList) PushBackList(m *pendingSignalList) {
// InsertAfter inserts e after b.
func (l *pendingSignalList) InsertAfter(b, e *pendingSignal) {
- a := pendingSignalElementMapper{}.linkerFor(b).Next()
- pendingSignalElementMapper{}.linkerFor(e).SetNext(a)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(b)
- pendingSignalElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := pendingSignalElementMapper{}.linkerFor(b)
+ eLinker := pendingSignalElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
pendingSignalElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *pendingSignalList) InsertAfter(b, e *pendingSignal) {
// InsertBefore inserts e before a.
func (l *pendingSignalList) InsertBefore(a, e *pendingSignal) {
- b := pendingSignalElementMapper{}.linkerFor(a).Prev()
- pendingSignalElementMapper{}.linkerFor(e).SetNext(a)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(b)
- pendingSignalElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := pendingSignalElementMapper{}.linkerFor(a)
+ eLinker := pendingSignalElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
pendingSignalElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/process_group_list.go b/pkg/sentry/kernel/process_group_list.go
index 853145237..2c5363c69 100755
--- a/pkg/sentry/kernel/process_group_list.go
+++ b/pkg/sentry/kernel/process_group_list.go
@@ -54,8 +54,9 @@ func (l *processGroupList) Back() *ProcessGroup {
// PushFront inserts the element e at the front of list l.
func (l *processGroupList) PushFront(e *ProcessGroup) {
- processGroupElementMapper{}.linkerFor(e).SetNext(l.head)
- processGroupElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := processGroupElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
processGroupElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *processGroupList) PushFront(e *ProcessGroup) {
// PushBack inserts the element e at the back of list l.
func (l *processGroupList) PushBack(e *ProcessGroup) {
- processGroupElementMapper{}.linkerFor(e).SetNext(nil)
- processGroupElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := processGroupElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
processGroupElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *processGroupList) PushBackList(m *processGroupList) {
// InsertAfter inserts e after b.
func (l *processGroupList) InsertAfter(b, e *ProcessGroup) {
- a := processGroupElementMapper{}.linkerFor(b).Next()
- processGroupElementMapper{}.linkerFor(e).SetNext(a)
- processGroupElementMapper{}.linkerFor(e).SetPrev(b)
- processGroupElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := processGroupElementMapper{}.linkerFor(b)
+ eLinker := processGroupElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
processGroupElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *processGroupList) InsertAfter(b, e *ProcessGroup) {
// InsertBefore inserts e before a.
func (l *processGroupList) InsertBefore(a, e *ProcessGroup) {
- b := processGroupElementMapper{}.linkerFor(a).Prev()
- processGroupElementMapper{}.linkerFor(e).SetNext(a)
- processGroupElementMapper{}.linkerFor(e).SetPrev(b)
- processGroupElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := processGroupElementMapper{}.linkerFor(a)
+ eLinker := processGroupElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
processGroupElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/semaphore/waiter_list.go b/pkg/sentry/kernel/semaphore/waiter_list.go
index 33e29fb55..78d86900a 100755
--- a/pkg/sentry/kernel/semaphore/waiter_list.go
+++ b/pkg/sentry/kernel/semaphore/waiter_list.go
@@ -54,8 +54,9 @@ func (l *waiterList) Back() *waiter {
// PushFront inserts the element e at the front of list l.
func (l *waiterList) PushFront(e *waiter) {
- waiterElementMapper{}.linkerFor(e).SetNext(l.head)
- waiterElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := waiterElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
waiterElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *waiterList) PushFront(e *waiter) {
// PushBack inserts the element e at the back of list l.
func (l *waiterList) PushBack(e *waiter) {
- waiterElementMapper{}.linkerFor(e).SetNext(nil)
- waiterElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := waiterElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
waiterElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *waiterList) PushBackList(m *waiterList) {
// InsertAfter inserts e after b.
func (l *waiterList) InsertAfter(b, e *waiter) {
- a := waiterElementMapper{}.linkerFor(b).Next()
- waiterElementMapper{}.linkerFor(e).SetNext(a)
- waiterElementMapper{}.linkerFor(e).SetPrev(b)
- waiterElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := waiterElementMapper{}.linkerFor(b)
+ eLinker := waiterElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
waiterElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *waiterList) InsertAfter(b, e *waiter) {
// InsertBefore inserts e before a.
func (l *waiterList) InsertBefore(a, e *waiter) {
- b := waiterElementMapper{}.linkerFor(a).Prev()
- waiterElementMapper{}.linkerFor(e).SetNext(a)
- waiterElementMapper{}.linkerFor(e).SetPrev(b)
- waiterElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := waiterElementMapper{}.linkerFor(a)
+ eLinker := waiterElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
waiterElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/session_list.go b/pkg/sentry/kernel/session_list.go
index 9ba27b164..e65688f53 100755
--- a/pkg/sentry/kernel/session_list.go
+++ b/pkg/sentry/kernel/session_list.go
@@ -54,8 +54,9 @@ func (l *sessionList) Back() *Session {
// PushFront inserts the element e at the front of list l.
func (l *sessionList) PushFront(e *Session) {
- sessionElementMapper{}.linkerFor(e).SetNext(l.head)
- sessionElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := sessionElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
sessionElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *sessionList) PushFront(e *Session) {
// PushBack inserts the element e at the back of list l.
func (l *sessionList) PushBack(e *Session) {
- sessionElementMapper{}.linkerFor(e).SetNext(nil)
- sessionElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := sessionElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
sessionElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *sessionList) PushBackList(m *sessionList) {
// InsertAfter inserts e after b.
func (l *sessionList) InsertAfter(b, e *Session) {
- a := sessionElementMapper{}.linkerFor(b).Next()
- sessionElementMapper{}.linkerFor(e).SetNext(a)
- sessionElementMapper{}.linkerFor(e).SetPrev(b)
- sessionElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := sessionElementMapper{}.linkerFor(b)
+ eLinker := sessionElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
sessionElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *sessionList) InsertAfter(b, e *Session) {
// InsertBefore inserts e before a.
func (l *sessionList) InsertBefore(a, e *Session) {
- b := sessionElementMapper{}.linkerFor(a).Prev()
- sessionElementMapper{}.linkerFor(e).SetNext(a)
- sessionElementMapper{}.linkerFor(e).SetPrev(b)
- sessionElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := sessionElementMapper{}.linkerFor(a)
+ eLinker := sessionElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
sessionElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/socket_list.go b/pkg/sentry/kernel/socket_list.go
index aed0a555e..a3d47e381 100755
--- a/pkg/sentry/kernel/socket_list.go
+++ b/pkg/sentry/kernel/socket_list.go
@@ -54,8 +54,9 @@ func (l *socketList) Back() *SocketEntry {
// PushFront inserts the element e at the front of list l.
func (l *socketList) PushFront(e *SocketEntry) {
- socketElementMapper{}.linkerFor(e).SetNext(l.head)
- socketElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := socketElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
socketElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *socketList) PushFront(e *SocketEntry) {
// PushBack inserts the element e at the back of list l.
func (l *socketList) PushBack(e *SocketEntry) {
- socketElementMapper{}.linkerFor(e).SetNext(nil)
- socketElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := socketElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
socketElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *socketList) PushBackList(m *socketList) {
// InsertAfter inserts e after b.
func (l *socketList) InsertAfter(b, e *SocketEntry) {
- a := socketElementMapper{}.linkerFor(b).Next()
- socketElementMapper{}.linkerFor(e).SetNext(a)
- socketElementMapper{}.linkerFor(e).SetPrev(b)
- socketElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := socketElementMapper{}.linkerFor(b)
+ eLinker := socketElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
socketElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *socketList) InsertAfter(b, e *SocketEntry) {
// InsertBefore inserts e before a.
func (l *socketList) InsertBefore(a, e *SocketEntry) {
- b := socketElementMapper{}.linkerFor(a).Prev()
- socketElementMapper{}.linkerFor(e).SetNext(a)
- socketElementMapper{}.linkerFor(e).SetPrev(b)
- socketElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := socketElementMapper{}.linkerFor(a)
+ eLinker := socketElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
socketElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/kernel/task_list.go b/pkg/sentry/kernel/task_list.go
index 57d3f098d..9b8f07b46 100755
--- a/pkg/sentry/kernel/task_list.go
+++ b/pkg/sentry/kernel/task_list.go
@@ -54,8 +54,9 @@ func (l *taskList) Back() *Task {
// PushFront inserts the element e at the front of list l.
func (l *taskList) PushFront(e *Task) {
- taskElementMapper{}.linkerFor(e).SetNext(l.head)
- taskElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := taskElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
taskElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *taskList) PushFront(e *Task) {
// PushBack inserts the element e at the back of list l.
func (l *taskList) PushBack(e *Task) {
- taskElementMapper{}.linkerFor(e).SetNext(nil)
- taskElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := taskElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
taskElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *taskList) PushBackList(m *taskList) {
// InsertAfter inserts e after b.
func (l *taskList) InsertAfter(b, e *Task) {
- a := taskElementMapper{}.linkerFor(b).Next()
- taskElementMapper{}.linkerFor(e).SetNext(a)
- taskElementMapper{}.linkerFor(e).SetPrev(b)
- taskElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := taskElementMapper{}.linkerFor(b)
+ eLinker := taskElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
taskElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *taskList) InsertAfter(b, e *Task) {
// InsertBefore inserts e before a.
func (l *taskList) InsertBefore(a, e *Task) {
- b := taskElementMapper{}.linkerFor(a).Prev()
- taskElementMapper{}.linkerFor(e).SetNext(a)
- taskElementMapper{}.linkerFor(e).SetPrev(b)
- taskElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := taskElementMapper{}.linkerFor(a)
+ eLinker := taskElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
taskElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/mm/io_list.go b/pkg/sentry/mm/io_list.go
index 99c83c4b9..ecb9d4b04 100755
--- a/pkg/sentry/mm/io_list.go
+++ b/pkg/sentry/mm/io_list.go
@@ -54,8 +54,9 @@ func (l *ioList) Back() *ioResult {
// PushFront inserts the element e at the front of list l.
func (l *ioList) PushFront(e *ioResult) {
- ioElementMapper{}.linkerFor(e).SetNext(l.head)
- ioElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := ioElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
ioElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *ioList) PushFront(e *ioResult) {
// PushBack inserts the element e at the back of list l.
func (l *ioList) PushBack(e *ioResult) {
- ioElementMapper{}.linkerFor(e).SetNext(nil)
- ioElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := ioElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
ioElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *ioList) PushBackList(m *ioList) {
// InsertAfter inserts e after b.
func (l *ioList) InsertAfter(b, e *ioResult) {
- a := ioElementMapper{}.linkerFor(b).Next()
- ioElementMapper{}.linkerFor(e).SetNext(a)
- ioElementMapper{}.linkerFor(e).SetPrev(b)
- ioElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := ioElementMapper{}.linkerFor(b)
+ eLinker := ioElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
ioElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *ioList) InsertAfter(b, e *ioResult) {
// InsertBefore inserts e before a.
func (l *ioList) InsertBefore(a, e *ioResult) {
- b := ioElementMapper{}.linkerFor(a).Prev()
- ioElementMapper{}.linkerFor(e).SetNext(a)
- ioElementMapper{}.linkerFor(e).SetPrev(b)
- ioElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := ioElementMapper{}.linkerFor(a)
+ eLinker := ioElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
ioElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/socket/unix/transport/transport_message_list.go b/pkg/sentry/socket/unix/transport/transport_message_list.go
index 6d394860c..565a821bd 100755
--- a/pkg/sentry/socket/unix/transport/transport_message_list.go
+++ b/pkg/sentry/socket/unix/transport/transport_message_list.go
@@ -54,8 +54,9 @@ func (l *messageList) Back() *message {
// PushFront inserts the element e at the front of list l.
func (l *messageList) PushFront(e *message) {
- messageElementMapper{}.linkerFor(e).SetNext(l.head)
- messageElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := messageElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
messageElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *messageList) PushFront(e *message) {
// PushBack inserts the element e at the back of list l.
func (l *messageList) PushBack(e *message) {
- messageElementMapper{}.linkerFor(e).SetNext(nil)
- messageElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := messageElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
messageElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *messageList) PushBackList(m *messageList) {
// InsertAfter inserts e after b.
func (l *messageList) InsertAfter(b, e *message) {
- a := messageElementMapper{}.linkerFor(b).Next()
- messageElementMapper{}.linkerFor(e).SetNext(a)
- messageElementMapper{}.linkerFor(e).SetPrev(b)
- messageElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := messageElementMapper{}.linkerFor(b)
+ eLinker := messageElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
messageElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *messageList) InsertAfter(b, e *message) {
// InsertBefore inserts e before a.
func (l *messageList) InsertBefore(a, e *message) {
- b := messageElementMapper{}.linkerFor(a).Prev()
- messageElementMapper{}.linkerFor(e).SetNext(a)
- messageElementMapper{}.linkerFor(e).SetPrev(b)
- messageElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := messageElementMapper{}.linkerFor(a)
+ eLinker := messageElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
messageElementMapper{}.linkerFor(b).SetNext(e)
diff --git a/pkg/sentry/vfs/epoll_interest_list.go b/pkg/sentry/vfs/epoll_interest_list.go
index 16cf878cd..011373f0f 100755
--- a/pkg/sentry/vfs/epoll_interest_list.go
+++ b/pkg/sentry/vfs/epoll_interest_list.go
@@ -54,8 +54,9 @@ func (l *epollInterestList) Back() *epollInterest {
// PushFront inserts the element e at the front of list l.
func (l *epollInterestList) PushFront(e *epollInterest) {
- epollInterestElementMapper{}.linkerFor(e).SetNext(l.head)
- epollInterestElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := epollInterestElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
epollInterestElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *epollInterestList) PushFront(e *epollInterest) {
// PushBack inserts the element e at the back of list l.
func (l *epollInterestList) PushBack(e *epollInterest) {
- epollInterestElementMapper{}.linkerFor(e).SetNext(nil)
- epollInterestElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := epollInterestElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
epollInterestElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *epollInterestList) PushBackList(m *epollInterestList) {
// InsertAfter inserts e after b.
func (l *epollInterestList) InsertAfter(b, e *epollInterest) {
- a := epollInterestElementMapper{}.linkerFor(b).Next()
- epollInterestElementMapper{}.linkerFor(e).SetNext(a)
- epollInterestElementMapper{}.linkerFor(e).SetPrev(b)
- epollInterestElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := epollInterestElementMapper{}.linkerFor(b)
+ eLinker := epollInterestElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
epollInterestElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *epollInterestList) InsertAfter(b, e *epollInterest) {
// InsertBefore inserts e before a.
func (l *epollInterestList) InsertBefore(a, e *epollInterest) {
- b := epollInterestElementMapper{}.linkerFor(a).Prev()
- epollInterestElementMapper{}.linkerFor(e).SetNext(a)
- epollInterestElementMapper{}.linkerFor(e).SetPrev(b)
- epollInterestElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := epollInterestElementMapper{}.linkerFor(a)
+ eLinker := epollInterestElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
epollInterestElementMapper{}.linkerFor(b).SetNext(e)