liburingutils: Rename function name
Bug: 406299670
Test: IOUringSocketHandler_test
Change-Id: I7e63887a7e0a8c3dbeae5a99ec5c3fa0e4e2a32d
Signed-off-by: Akilesh Kailash <akailash@google.com>
diff --git a/include/IOUringSocketHandler/IOUringSocketHandler.h b/include/IOUringSocketHandler/IOUringSocketHandler.h
index 9b5ecd9..61b843d 100644
--- a/include/IOUringSocketHandler/IOUringSocketHandler.h
+++ b/include/IOUringSocketHandler/IOUringSocketHandler.h
@@ -138,10 +138,11 @@
// return: true if io_uring is supported by the kernel, false otherwise.
//
// This function checks if the io_uring feature is supported by the underlying Linux kernel.
- static bool isIouringEnabled();
+ // Only kernel with 6.1+ are supported.
+ static bool IsIouringSupported();
private:
- static bool isIouringSupportedByKernel();
+ static bool IsIouringSupportedByKernel();
// Register buffers with io_uring
//
// return: true on success, false on failure (e.g., if io_uring_register_buffers fails).
diff --git a/src/IOUringSocketHandler.cpp b/src/IOUringSocketHandler.cpp
index 9e2b047..cbcf225 100644
--- a/src/IOUringSocketHandler.cpp
+++ b/src/IOUringSocketHandler.cpp
@@ -40,11 +40,11 @@
#include <android-base/logging.h>
#include <android-base/scopeguard.h>
-bool IOUringSocketHandler::isIouringEnabled() {
- return isIouringSupportedByKernel();
+bool IOUringSocketHandler::IsIouringSupported() {
+ return IsIouringSupportedByKernel();
}
-bool IOUringSocketHandler::isIouringSupportedByKernel() {
+bool IOUringSocketHandler::IsIouringSupportedByKernel() {
struct utsname uts {};
unsigned int major, minor;
diff --git a/src/IOUringSocketHandler_test.cpp b/src/IOUringSocketHandler_test.cpp
index 2928e2e..6ff012f 100644
--- a/src/IOUringSocketHandler_test.cpp
+++ b/src/IOUringSocketHandler_test.cpp
@@ -45,8 +45,8 @@
class IOUringSocketHandlerTest : public ::testing::TestWithParam<TestParam> {
public:
- bool IsIouringEnabled() {
- return IOUringSocketHandler::isIouringEnabled();
+ bool IsIouringSupported() {
+ return IOUringSocketHandler::IsIouringSupported();
}
void SendMsg(int sock_send, const bool non_block);
@@ -121,7 +121,7 @@
}
TEST_F(IOUringSocketHandlerTest, SetupIoUring) {
- if (!IsIouringEnabled()) {
+ if (!IsIouringSupported()) {
GTEST_SKIP() << "io_uring not supported. Skipping Test.";
}
InitializeHandler();
@@ -129,7 +129,7 @@
}
TEST_F(IOUringSocketHandlerTest, AllocateAndRegisterBuffers) {
- if (!IsIouringEnabled()) {
+ if (!IsIouringSupported()) {
GTEST_SKIP() << "io_uring not supported. Skipping Test.";
}
InitializeHandler();
@@ -138,7 +138,7 @@
}
TEST_F(IOUringSocketHandlerTest, MultipleAllocateAndRegisterBuffers) {
- if (!IsIouringEnabled()) {
+ if (!IsIouringSupported()) {
GTEST_SKIP() << "io_uring not supported. Skipping Test.";
}
InitializeHandler();
@@ -253,7 +253,7 @@
}
TEST_P(IOUringSocketHandlerTest, RecvmsgDataIntegrity) {
- if (!IsIouringEnabled()) {
+ if (!IsIouringSupported()) {
GTEST_SKIP() << "io_uring not supported. Skipping Test.";
}
ASSERT_TRUE(CreateServerSocket());
@@ -279,7 +279,7 @@
}
TEST_P(IOUringSocketHandlerTest, RecvmsgDataIntegrityNonBlockingSend) {
- if (!IsIouringEnabled()) {
+ if (!IsIouringSupported()) {
GTEST_SKIP() << "io_uring not supported. Skipping Test.";
}
ASSERT_TRUE(CreateServerSocket());