diff options
Diffstat (limited to 'pkg/sentry/fsimpl')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/request_list.go | 28 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/gofer/dentry_list.go | 28 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/dentry_list.go | 28 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/slot_list.go | 28 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/dentry_list.go | 28 |
5 files changed, 140 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/fuse/request_list.go b/pkg/sentry/fsimpl/fuse/request_list.go index 002262f23..060ac4a3f 100644 --- a/pkg/sentry/fsimpl/fuse/request_list.go +++ b/pkg/sentry/fsimpl/fuse/request_list.go @@ -38,16 +38,22 @@ func (l *requestList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *requestList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *requestList) Front() *Request { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *requestList) Back() *Request { return l.tail } @@ -55,6 +61,8 @@ func (l *requestList) Back() *Request { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *requestList) Len() (count int) { for e := l.Front(); e != nil; e = (requestElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *requestList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *requestList) PushFront(e *Request) { linker := requestElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *requestList) PushFront(e *Request) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *requestList) PushBack(e *Request) { linker := requestElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *requestList) PushBack(e *Request) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *requestList) PushBackList(m *requestList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *requestList) PushBackList(m *requestList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *requestList) InsertAfter(b, e *Request) { bLinker := requestElementMapper{}.linkerFor(b) eLinker := requestElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *requestList) InsertAfter(b, e *Request) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *requestList) InsertBefore(a, e *Request) { aLinker := requestElementMapper{}.linkerFor(a) eLinker := requestElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *requestList) InsertBefore(a, e *Request) { } // Remove removes e from l. +// +//go:nosplit func (l *requestList) Remove(e *Request) { linker := requestElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type requestEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *requestEntry) Next() *Request { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *requestEntry) Prev() *Request { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *requestEntry) SetNext(elem *Request) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *requestEntry) SetPrev(elem *Request) { e.prev = elem } diff --git a/pkg/sentry/fsimpl/gofer/dentry_list.go b/pkg/sentry/fsimpl/gofer/dentry_list.go index 84f839e3a..2e43b8e02 100644 --- a/pkg/sentry/fsimpl/gofer/dentry_list.go +++ b/pkg/sentry/fsimpl/gofer/dentry_list.go @@ -38,16 +38,22 @@ func (l *dentryList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *dentryList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *dentryList) Front() *dentry { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *dentryList) Back() *dentry { return l.tail } @@ -55,6 +61,8 @@ func (l *dentryList) Back() *dentry { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *dentryList) Len() (count int) { for e := l.Front(); e != nil; e = (dentryElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *dentryList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *dentryList) PushFront(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *dentryList) PushFront(e *dentry) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *dentryList) PushBack(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *dentryList) PushBack(e *dentry) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *dentryList) PushBackList(m *dentryList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *dentryList) PushBackList(m *dentryList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *dentryList) InsertAfter(b, e *dentry) { bLinker := dentryElementMapper{}.linkerFor(b) eLinker := dentryElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *dentryList) InsertAfter(b, e *dentry) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *dentryList) InsertBefore(a, e *dentry) { aLinker := dentryElementMapper{}.linkerFor(a) eLinker := dentryElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *dentryList) InsertBefore(a, e *dentry) { } // Remove removes e from l. +// +//go:nosplit func (l *dentryList) Remove(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type dentryEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) Next() *dentry { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) Prev() *dentry { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) SetNext(elem *dentry) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) SetPrev(elem *dentry) { e.prev = elem } diff --git a/pkg/sentry/fsimpl/kernfs/dentry_list.go b/pkg/sentry/fsimpl/kernfs/dentry_list.go index 06101fa32..e73cde1f1 100644 --- a/pkg/sentry/fsimpl/kernfs/dentry_list.go +++ b/pkg/sentry/fsimpl/kernfs/dentry_list.go @@ -38,16 +38,22 @@ func (l *dentryList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *dentryList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *dentryList) Front() *Dentry { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *dentryList) Back() *Dentry { return l.tail } @@ -55,6 +61,8 @@ func (l *dentryList) Back() *Dentry { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *dentryList) Len() (count int) { for e := l.Front(); e != nil; e = (dentryElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *dentryList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *dentryList) PushFront(e *Dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *dentryList) PushFront(e *Dentry) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *dentryList) PushBack(e *Dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *dentryList) PushBack(e *Dentry) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *dentryList) PushBackList(m *dentryList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *dentryList) PushBackList(m *dentryList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *dentryList) InsertAfter(b, e *Dentry) { bLinker := dentryElementMapper{}.linkerFor(b) eLinker := dentryElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *dentryList) InsertAfter(b, e *Dentry) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *dentryList) InsertBefore(a, e *Dentry) { aLinker := dentryElementMapper{}.linkerFor(a) eLinker := dentryElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *dentryList) InsertBefore(a, e *Dentry) { } // Remove removes e from l. +// +//go:nosplit func (l *dentryList) Remove(e *Dentry) { linker := dentryElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type dentryEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) Next() *Dentry { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) Prev() *Dentry { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) SetNext(elem *Dentry) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) SetPrev(elem *Dentry) { e.prev = elem } diff --git a/pkg/sentry/fsimpl/kernfs/slot_list.go b/pkg/sentry/fsimpl/kernfs/slot_list.go index c6cd74660..181fe7c8f 100644 --- a/pkg/sentry/fsimpl/kernfs/slot_list.go +++ b/pkg/sentry/fsimpl/kernfs/slot_list.go @@ -38,16 +38,22 @@ func (l *slotList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *slotList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *slotList) Front() *slot { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *slotList) Back() *slot { return l.tail } @@ -55,6 +61,8 @@ func (l *slotList) Back() *slot { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *slotList) Len() (count int) { for e := l.Front(); e != nil; e = (slotElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *slotList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *slotList) PushFront(e *slot) { linker := slotElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *slotList) PushFront(e *slot) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *slotList) PushBack(e *slot) { linker := slotElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *slotList) PushBack(e *slot) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *slotList) PushBackList(m *slotList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *slotList) PushBackList(m *slotList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *slotList) InsertAfter(b, e *slot) { bLinker := slotElementMapper{}.linkerFor(b) eLinker := slotElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *slotList) InsertAfter(b, e *slot) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *slotList) InsertBefore(a, e *slot) { aLinker := slotElementMapper{}.linkerFor(a) eLinker := slotElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *slotList) InsertBefore(a, e *slot) { } // Remove removes e from l. +// +//go:nosplit func (l *slotList) Remove(e *slot) { linker := slotElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type slotEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *slotEntry) Next() *slot { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *slotEntry) Prev() *slot { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *slotEntry) SetNext(elem *slot) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *slotEntry) SetPrev(elem *slot) { e.prev = elem } diff --git a/pkg/sentry/fsimpl/tmpfs/dentry_list.go b/pkg/sentry/fsimpl/tmpfs/dentry_list.go index 95e3d13d5..b95dd7101 100644 --- a/pkg/sentry/fsimpl/tmpfs/dentry_list.go +++ b/pkg/sentry/fsimpl/tmpfs/dentry_list.go @@ -38,16 +38,22 @@ func (l *dentryList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *dentryList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *dentryList) Front() *dentry { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *dentryList) Back() *dentry { return l.tail } @@ -55,6 +61,8 @@ func (l *dentryList) Back() *dentry { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *dentryList) Len() (count int) { for e := l.Front(); e != nil; e = (dentryElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *dentryList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *dentryList) PushFront(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *dentryList) PushFront(e *dentry) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *dentryList) PushBack(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *dentryList) PushBack(e *dentry) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *dentryList) PushBackList(m *dentryList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *dentryList) PushBackList(m *dentryList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *dentryList) InsertAfter(b, e *dentry) { bLinker := dentryElementMapper{}.linkerFor(b) eLinker := dentryElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *dentryList) InsertAfter(b, e *dentry) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *dentryList) InsertBefore(a, e *dentry) { aLinker := dentryElementMapper{}.linkerFor(a) eLinker := dentryElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *dentryList) InsertBefore(a, e *dentry) { } // Remove removes e from l. +// +//go:nosplit func (l *dentryList) Remove(e *dentry) { linker := dentryElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type dentryEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) Next() *dentry { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) Prev() *dentry { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *dentryEntry) SetNext(elem *dentry) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *dentryEntry) SetPrev(elem *dentry) { e.prev = elem } |