aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-08-05 18:51:16 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-10 22:13:01 +0200
commitb948c942539d47fb91a28dd085a028f3116b70c4 (patch)
tree6a092bd58a5b832c1e7468763169514ac2b1b264 /libdiskfs
parent612674f4b77472c381c8150138fce8a34a4c9119 (diff)
downloadhurd-b948c942539d47fb91a28dd085a028f3116b70c4.tar.gz
hurd-b948c942539d47fb91a28dd085a028f3116b70c4.tar.bz2
hurd-b948c942539d47fb91a28dd085a028f3116b70c4.zip
diskfs: Use libports notifications
Namely, ports_request_dead_name_notification () where we can, and the libports notify port when we have to pass it to libfshelp.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-lookup.c4
-rw-r--r--libdiskfs/file-set-trans.c3
-rw-r--r--libdiskfs/ifsock.c10
3 files changed, 7 insertions, 10 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index b39868ae..eb939c09 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -276,6 +276,7 @@ diskfs_S_dir_lookup (struct protid *dircred,
char *end = strchr (retry_name, '\0');
char *translator_path = strdupa (relpath);
char *complete_path;
+ struct port_info *notify_port;
if (mustbedir)
*end++ = '/'; /* Trailing slash. */
@@ -310,7 +311,8 @@ diskfs_S_dir_lookup (struct protid *dircred,
asprintf (&complete_path, "%s/%s", dircred->po->path,
translator_path);
- err = fshelp_set_active_translator (&newpi->pi,
+ notify_port = newpi->pi.bucket->notify_port;
+ err = fshelp_set_active_translator (notify_port,
complete_path,
&np->transbox);
if (complete_path != translator_path)
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 36f0c3b8..7359b906 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -223,7 +223,8 @@ diskfs_S_file_set_translator (struct protid *cred,
pthread_mutex_unlock (&np->lock);
if (! err && cred->po->path && active_flags & FS_TRANS_SET)
- err = fshelp_set_active_translator (&cred->pi, cred->po->path, &np->transbox);
+ err = fshelp_set_active_translator (cred->pi.bucket->notify_port,
+ cred->po->path, &np->transbox);
return err;
}
diff --git a/libdiskfs/ifsock.c b/libdiskfs/ifsock.c
index caf66885..27b8f611 100644
--- a/libdiskfs/ifsock.c
+++ b/libdiskfs/ifsock.c
@@ -56,7 +56,6 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred,
{
mach_port_t server;
mach_port_t sockaddr;
- mach_port_t old;
pthread_mutex_unlock (&np->lock);
@@ -113,13 +112,8 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred,
/* The receive right of the sockaddr holds a reference;
when we get a dead name on that right we drop our
reference. */
- mach_port_request_notification (mach_task_self (), sockaddr,
- MACH_NOTIFY_DEAD_NAME, 1,
- cred->pi.port_right,
- MACH_MSG_TYPE_MAKE_SEND_ONCE,
- &old);
- if (old != MACH_PORT_NULL)
- mach_port_deallocate (mach_task_self (), old);
+ ports_request_dead_name_notification (cred, sockaddr, NULL);
+
np->sockaddr = sockaddr;
diskfs_nref_light (np);
}