[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 07/23: pflocal: convert to trivfs dynamic classes and buckets
From: |
Samuel Thibault |
Subject: |
[hurd] 07/23: pflocal: convert to trivfs dynamic classes and buckets |
Date: |
Tue, 13 Oct 2015 00:09:55 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 50a7577b022851594fd15f8c934cd3c4a37c01b6
Author: Justus Winter <address@hidden>
Date: Sun Sep 27 17:01:37 2015 +0200
pflocal: convert to trivfs dynamic classes and buckets
libtrivfs contains two ways of managing more than one port class and
bucket. There is the old way of using a statically allocated array
with explicit length, and the new way with dynamically allocated
vectors.
Converting all users to the new way of handling multiple classes
and/or buckets, we can simplify the code in libtrivfs. In many cases,
the code will be simpler and more expressive for the user.
This also fixes a mild bug. The classes and buckets given to
`trivfs_startup' end up in the dynamic vectors too, making the object
lookup code use the more complicated code path.
* pflocal/pflocal.c: Convert to dynamic classes and buckets.
---
pflocal/pflocal.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/pflocal/pflocal.c b/pflocal/pflocal.c
index fcb62d1..07d1a97 100644
--- a/pflocal/pflocal.c
+++ b/pflocal/pflocal.c
@@ -38,12 +38,6 @@ int trivfs_support_read = 0;
int trivfs_support_write = 0;
int trivfs_support_exec = 0;
int trivfs_allow_open = 0;
-
-/* Trivfs noise. */
-struct port_class *trivfs_protid_portclasses[1];
-struct port_class *trivfs_cntl_portclasses[1];
-int trivfs_protid_nportclasses = 1;
-int trivfs_cntl_nportclasses = 1;
/* ---------------------------------------------------------------- */
#include "socket_S.h"
@@ -70,6 +64,7 @@ main(int argc, char *argv[])
{
error_t err;
mach_port_t bootstrap;
+ struct trivfs_control *fsys;
if (argc > 1)
{
@@ -81,25 +76,18 @@ main(int argc, char *argv[])
if (bootstrap == MACH_PORT_NULL)
error(2, 0, "Must be started as a translator");
- pf_port_bucket = ports_create_bucket ();
-
- trivfs_cntl_portclasses[0] = ports_create_class (trivfs_clean_cntl, 0);
- trivfs_protid_portclasses[0] = ports_create_class (trivfs_clean_protid, 0);
-
/* Prepare to create sockets. */
err = sock_global_init ();
if (err)
error(3, err, "Initializing");
/* Reply to our parent */
- err =
- trivfs_startup (bootstrap, 0,
- trivfs_cntl_portclasses[0], pf_port_bucket,
- trivfs_protid_portclasses[0], pf_port_bucket,
- NULL);
+ err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0, &fsys);
if (err)
error(3, err, "Contacting parent");
+ pf_port_bucket = fsys->pi.bucket;
+
/* Launch. */
do
ports_manage_port_operations_multithread (pf_port_bucket,
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 18/23: Update NEWS file, (continued)
- [hurd] 18/23: Update NEWS file, Samuel Thibault, 2015/10/12
- [hurd] 15/23: libtrivfs: deprecate old api, Samuel Thibault, 2015/10/12
- [hurd] 19/23: Add missing null checks in libshouldbeinlibc, Samuel Thibault, 2015/10/12
- [hurd] 21/23: Make netfs_S_io_reauthenticate handle allocation errors, Samuel Thibault, 2015/10/12
- [hurd] 20/23: Drop duplicate port deallocation, Samuel Thibault, 2015/10/12
- [hurd] 14/23: libtrivfs: optimize the object lookup code, Samuel Thibault, 2015/10/12
- [hurd] 23/23: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2015/10/12
- [hurd] 10/23: trans/magic: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 04/23: libdiskfs: fflush stdout when pausing, Samuel Thibault, 2015/10/12
- [hurd] 11/23: trans/new-fifo: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 07/23: pflocal: convert to trivfs dynamic classes and buckets,
Samuel Thibault <=
- [hurd] 09/23: trans/ifsock: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 12/23: trans/passwd: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 13/23: trans/proxy-defpager: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/15
- [hurd] 17/23: libdiskfs: fflush stdout when pausing, Samuel Thibault, 2015/10/15
- [hurd] 22/23: Make dir_lookup create files with user permissions enabled, Samuel Thibault, 2015/10/15
- [hurd] 16/23: Minor documentation changes, Samuel Thibault, 2015/10/15
- [hurd] 03/23: libdiskfs: improve error handling, Samuel Thibault, 2015/10/15
- [hurd] 02/23: exec: add missing include, Samuel Thibault, 2015/10/15
- [hurd] 05/23: exec: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/15
- [hurd] 01/23: libports: remove unused variables, Samuel Thibault, 2015/10/15