eventfd_synchronization: Fix support for directory change notification objects.

I had misread the code at first and was under the impression these were also
pseudo-fds, but they are not, they are true fds and asyncs just manually
tinker with their signaled status.
This commit is contained in:
Zebediah Figura 2019-04-27 10:21:41 -05:00
parent 547e7c81fb
commit c48811407e

View File

@ -1,12 +1,13 @@
From 9743c07fc7a759f1e7c893414be8bd95a095921f Mon Sep 17 00:00:00 2001
From 770e803adbc13c78ee52c7e8435d651da854fcf1 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Wed, 24 Apr 2019 23:21:25 -0500
Subject: [PATCH] server: Use default_fd_get_esync_fd() for directory change
notification objects.
Subject: [PATCH] server: Create esync file descriptors for true file objects
and use them for directory change notifications.
---
server/change.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
server/fd.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/server/change.c b/server/change.c
index 2be6a8360..9f07be705 100644
@ -21,6 +22,20 @@ index 2be6a8360..9f07be705 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
dir_get_fd, /* get_fd */
diff --git a/server/fd.c b/server/fd.c
index 95f289718..9f51d065e 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1626,6 +1626,9 @@ static struct fd *alloc_fd_object(void)
list_init( &fd->inode_entry );
list_init( &fd->locks );
+ if (do_esync())
+ fd->esync_fd = esync_create_fd( 1, 0 );
+
if ((fd->poll_index = add_poll_user( fd )) == -1)
{
release_object( fd );
--
2.21.0