diff --git a/src/io_uring.c b/src/io_uring.c index 80a7c769ce..1140a90ad4 100644 --- a/src/io_uring.c +++ b/src/io_uring.c @@ -29,10 +29,10 @@ void initIOUring(void) { } } -int writeUsingIOUring(client *c) { +int canWriteUsingIOUring(client *c) { if (server.io_uring_enabled && server.io_uring) { /* Currently, we only use io_uring to handle the static buffer write requests. */ - return getClientType(c) != CLIENT_TYPE_SLAVE && listLength(c->reply) == 0 && c->bufpos > 0; + return getClientType(c) != CLIENT_TYPE_REPLICA && listLength(c->reply) == 0 && c->bufpos > 0; } return 0; } @@ -98,7 +98,7 @@ int checkPendingIOUringWriteState(client *c) { * as an interaction, since we always send REPLCONF ACK commands * that take some time to just fill the socket output buffer. * We just rely on data / pings received for timeout detection. */ - if (!(c->flags & CLIENT_MASTER)) c->lastinteraction = server.unixtime; + if (!(c->flags & CLIENT_TYPE_PRIMARY)) c->last_interaction = server.unixtime; return C_OK; } @@ -143,7 +143,7 @@ void freeIOUring(void) { void initIOUring(void) { } -int writeUsingIOUring(client *c) { +int canWriteUsingIOUring(client *c) { UNUSED(c); return 0; } diff --git a/src/io_uring.h b/src/io_uring.h index 37c78edea0..d0b152be77 100644 --- a/src/io_uring.h +++ b/src/io_uring.h @@ -7,9 +7,9 @@ void initIOUring(void); /* If the client is suitable to use io_uring handle the write request. */ -int writeUsingIOUring(client *c); +int canWriteUsingIOUring(client *c); -/* Use io_uring to handle the client request, it is always used together with writeUsingIOUring(). */ +/* Use io_uring to handle the client request, it is always used together with canWriteUsingIOUring(). */ int writeToClientUsingIOUring(client *c); /* Submit requests to the submission queue and wait for completion. */ diff --git a/src/networking.c b/src/networking.c index eb632288e7..6281beb834 100644 --- a/src/networking.c +++ b/src/networking.c @@ -2054,7 +2054,7 @@ int handleClientsWithPendingWrites(void) { /* If user turn on io_uring and system support it, give io_uring a chance. * We can use io_uring to batch submit to reduce the count of syscall. */ - if (writeUsingIOUring(c)) { + if (canWriteUsingIOUring(c)) { if (writeToClientUsingIOUring(c) == C_ERR) { listUnlinkNode(server.clients_pending_write, ln); continue;