From 0edf32a78e84d91139c3059091094417d3b5a12d Mon Sep 17 00:00:00 2001
From: Florian Fischer <florian.fischer@muhq.space>
Date: Mon, 13 Jun 2022 13:55:03 +0200
Subject: [PATCH] remove custom liburing function

Since 171ae9d4b1ac33d54dd22ad96828d02c508e609e we use are more recent
liburing version with io_uring_prep_msg_ring support.
---
 emper/sleep_strategy/AbstractIoSleepStrategy.cpp | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/emper/sleep_strategy/AbstractIoSleepStrategy.cpp b/emper/sleep_strategy/AbstractIoSleepStrategy.cpp
index 05b8955e..188fb696 100644
--- a/emper/sleep_strategy/AbstractIoSleepStrategy.cpp
+++ b/emper/sleep_strategy/AbstractIoSleepStrategy.cpp
@@ -22,20 +22,6 @@
 using emper::io::IoContext;
 using emper::lib::TaggedPtr;
 
-#ifndef IORING_OP_MSG_RING
-#define IORING_OP_MSG_RING (IORING_OP_LINKAT + 1)
-#endif
-
-// TODO: Remove when liburing supports IORING_OP_MSG_RING
-static void io_uring_prep_msg_ring(struct io_uring_sqe* sqe, int ring_fd, void* user_data,
-																	 uint32_t res) {
-	io_uring_prep_nop(sqe);
-	sqe->opcode = IORING_OP_MSG_RING;
-	sqe->fd = ring_fd;
-	sqe->off = (uint64_t)user_data;
-	sqe->len = res;
-}
-
 namespace emper::sleep_strategy {
 
 thread_local bool AbstractIoSleepStrategy::readingGlobal = false;
@@ -111,7 +97,7 @@ void AbstractIoSleepStrategy::sendSpecificNotification(workerid_t workerId) {
 	TaggedPtr tag((void*)nullptr, static_cast<uint16_t>(IoContext::PointerTags::NewWorkNotification),
 								true);
 
-	io_uring_prep_msg_ring(sqe, runtime.ioContexts[workerId]->ring.ring_fd, tag, 0);
+	io_uring_prep_msg_ring(sqe, runtime.ioContexts[workerId]->ring.ring_fd, 0, uintptr_t(tag), 0);
 
 	// Do not generate a cqe on the submiting io_uring
 	sqe->flags = IOSQE_CQE_SKIP_SUCCESS;
-- 
GitLab