[2/7] vhost: rename polling mutex

Message ID 20240229122502.2572343-3-maxime.coquelin@redhat.com (mailing list archive)
State Superseded
Delegated to: Maxime Coquelin
Headers
Series vhost: FD manager improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Maxime Coquelin Feb. 29, 2024, 12:24 p.m. UTC
  This trivial patch fixes a typo in fd's manager polling
mutex name.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/fd_man.c | 8 ++++----
 lib/vhost/fd_man.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

David Marchand Feb. 29, 2024, 1:41 p.m. UTC | #1
On Thu, Feb 29, 2024 at 1:25 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> This trivial patch fixes a typo in fd's manager polling
> mutex name.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>
  

Patch

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 42ce059039..5dde40e51a 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -125,9 +125,9 @@  fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb wcb, void *dat)
 	pthread_mutex_lock(&pfdset->fd_mutex);
 	i = pfdset->num < MAX_FDS ? pfdset->num++ : -1;
 	if (i == -1) {
-		pthread_mutex_lock(&pfdset->fd_pooling_mutex);
+		pthread_mutex_lock(&pfdset->fd_polling_mutex);
 		fdset_shrink_nolock(pfdset);
-		pthread_mutex_unlock(&pfdset->fd_pooling_mutex);
+		pthread_mutex_unlock(&pfdset->fd_polling_mutex);
 		i = pfdset->num < MAX_FDS ? pfdset->num++ : -1;
 		if (i == -1) {
 			pthread_mutex_unlock(&pfdset->fd_mutex);
@@ -244,9 +244,9 @@  fdset_event_dispatch(void *arg)
 		numfds = pfdset->num;
 		pthread_mutex_unlock(&pfdset->fd_mutex);
 
-		pthread_mutex_lock(&pfdset->fd_pooling_mutex);
+		pthread_mutex_lock(&pfdset->fd_polling_mutex);
 		val = poll(pfdset->rwfds, numfds, 1000 /* millisecs */);
-		pthread_mutex_unlock(&pfdset->fd_pooling_mutex);
+		pthread_mutex_unlock(&pfdset->fd_polling_mutex);
 		if (val < 0)
 			continue;
 
diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h
index cc19937612..2517ae5a9b 100644
--- a/lib/vhost/fd_man.h
+++ b/lib/vhost/fd_man.h
@@ -24,7 +24,7 @@  struct fdset {
 	struct pollfd rwfds[MAX_FDS];
 	struct fdentry fd[MAX_FDS];
 	pthread_mutex_t fd_mutex;
-	pthread_mutex_t fd_pooling_mutex;
+	pthread_mutex_t fd_polling_mutex;
 	int num;	/* current fd number of this fdset */
 
 	union pipefds {