summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/unix
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-03-24 19:17:38 +0000
committergVisor bot <gvisor-bot@google.com>2021-03-24 19:17:38 +0000
commit7c81294c74085963b68bc1f25d1e9ecc8cf346b7 (patch)
treec8f1c85453f0327014a34ca049fb3c93c9dc84d2 /pkg/sentry/socket/unix
parent9662600f3fc56cfce16d9cf407964b0bac0cc150 (diff)
parente7ca2a51a89a8ff2c9f5adfdfa5b51be1b3faeb3 (diff)
Merge release-20210315.0-23-ge7ca2a51a (automated)
Diffstat (limited to 'pkg/sentry/socket/unix')
-rw-r--r--pkg/sentry/socket/unix/transport/connectioned.go16
-rw-r--r--pkg/sentry/socket/unix/transport/connectionless.go8
-rw-r--r--pkg/sentry/socket/unix/transport/queue.go12
-rw-r--r--pkg/sentry/socket/unix/transport/unix.go12
-rw-r--r--pkg/sentry/socket/unix/unix.go6
-rw-r--r--pkg/sentry/socket/unix/unix_vfs2.go2
6 files changed, 28 insertions, 28 deletions
diff --git a/pkg/sentry/socket/unix/transport/connectioned.go b/pkg/sentry/socket/unix/transport/connectioned.go
index b1967fc36..159b8f90f 100644
--- a/pkg/sentry/socket/unix/transport/connectioned.go
+++ b/pkg/sentry/socket/unix/transport/connectioned.go
@@ -338,8 +338,8 @@ func (e *connectionedEndpoint) BidirectionalConnect(ctx context.Context, ce Conn
ce.Unlock()
// Notify on both ends.
- e.Notify(waiter.EventIn)
- ce.WaiterQueue().Notify(waiter.EventOut)
+ e.Notify(waiter.ReadableEvents)
+ ce.WaiterQueue().Notify(waiter.WritableEvents)
return nil
default:
@@ -480,15 +480,15 @@ func (e *connectionedEndpoint) Readiness(mask waiter.EventMask) waiter.EventMask
ready := waiter.EventMask(0)
switch {
case e.Connected():
- if mask&waiter.EventIn != 0 && e.receiver.Readable() {
- ready |= waiter.EventIn
+ if mask&waiter.ReadableEvents != 0 && e.receiver.Readable() {
+ ready |= waiter.ReadableEvents
}
- if mask&waiter.EventOut != 0 && e.connected.Writable() {
- ready |= waiter.EventOut
+ if mask&waiter.WritableEvents != 0 && e.connected.Writable() {
+ ready |= waiter.WritableEvents
}
case e.Listening():
- if mask&waiter.EventIn != 0 && len(e.acceptedChan) > 0 {
- ready |= waiter.EventIn
+ if mask&waiter.ReadableEvents != 0 && len(e.acceptedChan) > 0 {
+ ready |= waiter.ReadableEvents
}
}
diff --git a/pkg/sentry/socket/unix/transport/connectionless.go b/pkg/sentry/socket/unix/transport/connectionless.go
index 0be78480c..d0df28b59 100644
--- a/pkg/sentry/socket/unix/transport/connectionless.go
+++ b/pkg/sentry/socket/unix/transport/connectionless.go
@@ -191,13 +191,13 @@ func (e *connectionlessEndpoint) Readiness(mask waiter.EventMask) waiter.EventMa
defer e.Unlock()
ready := waiter.EventMask(0)
- if mask&waiter.EventIn != 0 && e.receiver.Readable() {
- ready |= waiter.EventIn
+ if mask&waiter.ReadableEvents != 0 && e.receiver.Readable() {
+ ready |= waiter.ReadableEvents
}
if e.Connected() {
- if mask&waiter.EventOut != 0 && e.connected.Writable() {
- ready |= waiter.EventOut
+ if mask&waiter.WritableEvents != 0 && e.connected.Writable() {
+ ready |= waiter.WritableEvents
}
}
diff --git a/pkg/sentry/socket/unix/transport/queue.go b/pkg/sentry/socket/unix/transport/queue.go
index 698a9a82c..e4de44498 100644
--- a/pkg/sentry/socket/unix/transport/queue.go
+++ b/pkg/sentry/socket/unix/transport/queue.go
@@ -44,8 +44,8 @@ type queue struct {
// will become unreadable when no more data is pending.
//
// Both the read and write queues must be notified after closing:
-// q.ReaderQueue.Notify(waiter.EventIn)
-// q.WriterQueue.Notify(waiter.EventOut)
+// q.ReaderQueue.Notify(waiter.ReadableEvents)
+// q.WriterQueue.Notify(waiter.WritableEvents)
func (q *queue) Close() {
q.mu.Lock()
q.closed = true
@@ -55,8 +55,8 @@ func (q *queue) Close() {
// Reset empties the queue and Releases all of the Entries.
//
// Both the read and write queues must be notified after resetting:
-// q.ReaderQueue.Notify(waiter.EventIn)
-// q.WriterQueue.Notify(waiter.EventOut)
+// q.ReaderQueue.Notify(waiter.ReadableEvents)
+// q.WriterQueue.Notify(waiter.WritableEvents)
func (q *queue) Reset(ctx context.Context) {
q.mu.Lock()
for cur := q.dataList.Front(); cur != nil; cur = cur.Next() {
@@ -112,7 +112,7 @@ func (q *queue) IsWritable() bool {
// err indicates why.
//
// If notify is true, ReaderQueue.Notify must be called:
-// q.ReaderQueue.Notify(waiter.EventIn)
+// q.ReaderQueue.Notify(waiter.ReadableEvents)
func (q *queue) Enqueue(ctx context.Context, data [][]byte, c ControlMessages, from tcpip.FullAddress, discardEmpty bool, truncate bool) (l int64, notify bool, err *syserr.Error) {
q.mu.Lock()
@@ -179,7 +179,7 @@ func (q *queue) Enqueue(ctx context.Context, data [][]byte, c ControlMessages, f
// Dequeue removes the first entry in the data queue, if one exists.
//
// If notify is true, WriterQueue.Notify must be called:
-// q.WriterQueue.Notify(waiter.EventOut)
+// q.WriterQueue.Notify(waiter.WritableEvents)
func (q *queue) Dequeue() (e *message, notify bool, err *syserr.Error) {
q.mu.Lock()
diff --git a/pkg/sentry/socket/unix/transport/unix.go b/pkg/sentry/socket/unix/transport/unix.go
index 089a0a647..0c5f5ab42 100644
--- a/pkg/sentry/socket/unix/transport/unix.go
+++ b/pkg/sentry/socket/unix/transport/unix.go
@@ -376,13 +376,13 @@ func (q *queueReceiver) Recv(ctx context.Context, data [][]byte, creds bool, num
// RecvNotify implements Receiver.RecvNotify.
func (q *queueReceiver) RecvNotify() {
- q.readQueue.WriterQueue.Notify(waiter.EventOut)
+ q.readQueue.WriterQueue.Notify(waiter.WritableEvents)
}
// CloseNotify implements Receiver.CloseNotify.
func (q *queueReceiver) CloseNotify() {
- q.readQueue.ReaderQueue.Notify(waiter.EventIn)
- q.readQueue.WriterQueue.Notify(waiter.EventOut)
+ q.readQueue.ReaderQueue.Notify(waiter.ReadableEvents)
+ q.readQueue.WriterQueue.Notify(waiter.WritableEvents)
}
// CloseRecv implements Receiver.CloseRecv.
@@ -692,13 +692,13 @@ func (e *connectedEndpoint) Send(ctx context.Context, data [][]byte, c ControlMe
// SendNotify implements ConnectedEndpoint.SendNotify.
func (e *connectedEndpoint) SendNotify() {
- e.writeQueue.ReaderQueue.Notify(waiter.EventIn)
+ e.writeQueue.ReaderQueue.Notify(waiter.ReadableEvents)
}
// CloseNotify implements ConnectedEndpoint.CloseNotify.
func (e *connectedEndpoint) CloseNotify() {
- e.writeQueue.ReaderQueue.Notify(waiter.EventIn)
- e.writeQueue.WriterQueue.Notify(waiter.EventOut)
+ e.writeQueue.ReaderQueue.Notify(waiter.ReadableEvents)
+ e.writeQueue.WriterQueue.Notify(waiter.WritableEvents)
}
// CloseSend implements ConnectedEndpoint.CloseSend.
diff --git a/pkg/sentry/socket/unix/unix.go b/pkg/sentry/socket/unix/unix.go
index 63165e1d4..b22f7973a 100644
--- a/pkg/sentry/socket/unix/unix.go
+++ b/pkg/sentry/socket/unix/unix.go
@@ -207,7 +207,7 @@ func (s *socketOpsCommon) Listen(t *kernel.Task, backlog int) *syserr.Error {
func (s *SocketOperations) blockingAccept(t *kernel.Task, peerAddr *tcpip.FullAddress) (transport.Endpoint, *syserr.Error) {
// Register for notifications.
e, ch := waiter.NewChannelEntry(nil)
- s.EventRegister(&e, waiter.EventIn)
+ s.EventRegister(&e, waiter.ReadableEvents)
defer s.EventUnregister(&e)
// Try to accept the connection; if it fails, then wait until we get a
@@ -502,7 +502,7 @@ func (s *socketOpsCommon) SendMsg(t *kernel.Task, src usermem.IOSequence, to []b
// We'll have to block. Register for notification and keep trying to
// send all the data.
e, ch := waiter.NewChannelEntry(nil)
- s.EventRegister(&e, waiter.EventOut)
+ s.EventRegister(&e, waiter.WritableEvents)
defer s.EventUnregister(&e)
total := n
@@ -677,7 +677,7 @@ func (s *socketOpsCommon) RecvMsg(t *kernel.Task, dst usermem.IOSequence, flags
// We'll have to block. Register for notification and keep trying to
// send all the data.
e, ch := waiter.NewChannelEntry(nil)
- s.EventRegister(&e, waiter.EventIn)
+ s.EventRegister(&e, waiter.ReadableEvents)
defer s.EventUnregister(&e)
for {
diff --git a/pkg/sentry/socket/unix/unix_vfs2.go b/pkg/sentry/socket/unix/unix_vfs2.go
index 9c037cbae..7890d1048 100644
--- a/pkg/sentry/socket/unix/unix_vfs2.go
+++ b/pkg/sentry/socket/unix/unix_vfs2.go
@@ -121,7 +121,7 @@ func (s *SocketVFS2) GetSockOpt(t *kernel.Task, level, name int, outPtr usermem.
func (s *SocketVFS2) blockingAccept(t *kernel.Task, peerAddr *tcpip.FullAddress) (transport.Endpoint, *syserr.Error) {
// Register for notifications.
e, ch := waiter.NewChannelEntry(nil)
- s.socketOpsCommon.EventRegister(&e, waiter.EventIn)
+ s.socketOpsCommon.EventRegister(&e, waiter.ReadableEvents)
defer s.socketOpsCommon.EventUnregister(&e)
// Try to accept the connection; if it fails, then wait until we get a