[PATCH 11/12] mach-defpager: drop all register qualifiers

2013-11-20 Thread Justus Winter
* mach-defpager/default_pager.c: Drop register qualifiers. * mach-defpager/kalloc.c: Likewise. * mach-defpager/queue.h: Likewise. * mach-defpager/wiring.c: Likewise. --- mach-defpager/default_pager.c | 182 - mach-defpager/kalloc.c| 10 +-- mach-d

[PATCH 10/12] libshouldbeinlibc: fix dead initialization in fmt_named_interval

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/timefmt.c (fmt_named_interval): Fix dead initialization by declaring ts in the loop. --- libshouldbeinlibc/timefmt.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libshouldbeinlibc/timefmt.c b/libshouldbeinlib

[PATCH] unionfs: fix memory leak in patternlist_add

2013-11-21 Thread Justus Winter
Found using the Clang Static Analyzer. * pattern.c (patternlist_add): Fix memory leak. --- pattern.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/pattern.c b/pattern.c index 409ed23..fd38cf5 100644 --- a/pattern.c +++ b/pattern.c @@ -52,7 +52,10 @@ patternlist_add (struct patternlist

[PATCH 02/11] init: fix port leak

2013-11-27 Thread Justus Winter
* init/init.c (S_startup_essential_task): Fix port leak. --- init/init.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init/init.c b/init/init.c index de5dd6b..b7b40bd 100644 --- a/init/init.c +++ b/init/init.c @@ -1202,6 +1202,10 @@ S_startup_essential_task (mach_po

[PATCH 03/11] proc: update comments

2013-11-27 Thread Justus Winter
* proc/main.c (main): Update comment. The proc server is no longer PID 0. * proc/proc.h: Likewise. --- proc/main.c |2 +- proc/proc.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proc/main.c b/proc/main.c index 73abbc0..6b18737 100644 --- a/proc/main.c +++ b/proc/m

[PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map

2013-11-27 Thread Justus Winter
Deallocate the device port after creating the mapping. The mapping is independent of the device port. * libshouldbeinlibc/maptime.c (maptime_map): Deallocate device port. --- libshouldbeinlibc/maptime.c |4 1 file changed, 4 insertions(+) diff --git a/libshouldbeinlibc/maptime.c b/libsh

[PATCH 04/11] libports: improve error handling in ports_reallocate_port

2013-11-27 Thread Justus Winter
* libports/reallocate-port.c (ports_reallocate_port): Improve error handling. --- libports/reallocate-port.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libports/reallocate-port.c b/libports/reallocate-port.c index b2977dd..d2adaeb 100644 --- a/libports/reallocate-po

[PATCH 05/11] libports: improve error handling in ports_reallocate_from_external

2013-11-27 Thread Justus Winter
* libports/reallocate-from-external.c (ports_reallocate_from_external): Improve error handling. --- libports/reallocate-from-external.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libports/reallocate-from-external.c b/libports/reallocate-from-external.c index cd1214

[PATCH 06/11] libports: improve error handling in ports_transfer_right

2013-11-27 Thread Justus Winter
* libports/transfer-right.c (ports_transfer_right): Improve error handling. --- libports/transfer-right.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libports/transfer-right.c b/libports/transfer-right.c index e313f71..72488a9 100644 --- a/libports/transfer-right.c +++

[PATCH 07/11] libdiskfs: improve error reporting in diskfs_start_disk_pager

2013-11-27 Thread Justus Winter
* libdiskfs/disk-pager.c (diskfs_start_disk_pager): Improve error reporting. --- libdiskfs/disk-pager.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c index 8fe8f80..9a0d9d8 100644 --- a/libdiskfs/disk-pager.c +++ b/libdiskf

[PATCH 10/11] proc: store the privileged host port in _hurd_host_priv

2013-11-27 Thread Justus Winter
Store the privileged host port in _hurd_host_priv like it is done in the root filesystem. This fixes the thread priority adjustment in the proc server. Prior to this fix, a warning message "unable to adjust libports thread priority" sometimes appeared early in the boot process. * proc/host.c (S_pr

[PATCH 09/11] libports: improve error reporting in adjust_priority

2013-11-27 Thread Justus Winter
By using error instead of perror, the warning can be proprely attributed to the process. * libports/manage-multithread.c (adjust_priority): Use error instead of perror to print the warning. --- libports/manage-multithread.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --

[PATCH 08/11] libfshelp: improve error handling in fshelp_start_translator_long

2013-11-27 Thread Justus Winter
Properly deallocate all ports and terminate the started translator if an error occurs. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Improve error handling. --- libfshelp/start-translator-long.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/l

[PATCH 11/11] proc: store the device master port in _hurd_device_master

2013-11-27 Thread Justus Winter
* proc/host.c (S_proc_getprivports): Adapt accordingly. * proc/main.c (main): Store the device master port in _hurd_device_master. * proc/proc.h (master_device_port): Remove unused variable. --- proc/host.c |2 +- proc/main.c |4 ++-- proc/proc.h |2 -- 3 files changed, 3 insertions(+)

[PATCH] libfshelp: improve error handling in fshelp_start_translator_long

2013-11-28 Thread Justus Winter
Properly deallocate all ports and terminate the started translator if an error occurs. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Improve error handling. --- libfshelp/start-translator-long.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --gi

[PATCH 4/8] include: add msgh_protected_payload to mach_msg_header_t

2013-11-28 Thread Justus Winter
* include/mach/message.h (mach_msg_header_t): Add msgh_protected_payload as a union with msgh_local_port. --- include/mach/message.h |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/mach/message.h b/include/mach/message.h index f78e978..7464a57 100644 --- a/incl

[PATCH 3/8] ipc: implement mach_port_set_protected_payload

2013-11-28 Thread Justus Winter
* include/mach/mach_port.defs: Add mach_port_set_protected_payload. * ipc/mach_port.c: Implement mach_port_set_protected_payload. --- include/mach/mach_port.defs |9 + ipc/mach_port.c | 37 + 2 files changed, 46 insertions(+) diff --gi

[PATCH 2/8] ipc: add protected payload

2013-11-28 Thread Justus Winter
* ipc/ipc_port.c (ipc_port_init): Initialize protected_payload. (ipc_port_print): Print protected_payload. (ipc_port_set_protected_payload): New function. * ipc/ipc_port.h (struct ipc_port): Add field protected_payload. (ipc_port_set_protected_payload): Add function declaration. --- ipc/ipc_port.c

[PATCH 1/8] include: skip routines related to migrating threads

2013-11-28 Thread Justus Winter
* include/mach/mach_port.defs: Skip the routines mach_port_set_rpcinfo and mach_port_create_act if MIGRATING_THREADS is not defined. --- include/mach/mach_port.defs |5 + 1 file changed, 5 insertions(+) diff --git a/include/mach/mach_port.defs b/include/mach/mach_port.defs index e1f45e3

[PATCH 5/8] include: define MACH_MSG_TYPE_PROTECTED_PAYLOAD

2013-11-28 Thread Justus Winter
* include/mach/message.h: Define MACH_MSG_TYPE_PROTECTED_PAYLOAD. (MACH_MSG_TYPE_LAST): Adjust accordingly. --- include/mach/message.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mach/message.h b/include/mach/message.h index 7464a57..0a7297e 100644 --- a/inclu

[PATCH 7/8] ipc: clear the payload when moving a receive port

2013-11-28 Thread Justus Winter
Clear the protected payload when a receive port is moved from one ipc space to another. This is done to retain the old behavior of mach_msg, so that a port name is sent in the msgh_local_port field. If the new owner of that receive right wishes to use the protected payload mechanism, it has to be

[PATCH 8/8] XXX fix the size of ipc_port structs

2013-11-28 Thread Justus Winter
I do not know why this is happening, but w/o this, some kernel pointers leak into the ip_protected_payload field. So it looks like sizeof(struct ipc_tree_entry) is wrong here, not sure why though. Maybe the global header is imported? But the compiler flags should prevent this... --- ipc/ipc_init.c

[PATCH 6/8] ipc: provide the protected payload in ipc_kmsg_copyout_header

2013-11-28 Thread Justus Winter
* ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): If a protected payload is set for the destination port, provide it in msgh_protected_payload. --- ipc/ipc_kmsg.c | 58 +++- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/ipc/ipc_km

[PATCH 4/5] Clean up generated sources

2013-11-28 Thread Justus Winter
* Makefile (CLEANFILES): Add generated source files lexxer.c and parser.c. --- Makefile.am |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 33bc768..3e6dfcf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ bin_SCRIPTS = mig EXTRA_D

[PATCH 3/5] Add inTransPayload

2013-11-28 Thread Justus Winter
--- lexxer.l |1 + parser.h |1 + parser.y | 17 + type.c | 10 +- type.h |2 ++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lexxer.l b/lexxer.l index 5f2f61e..7ff5677 100644 --- a/lexxer.l +++ b/lexxer.l @@ -138,6 +138,7 @@ static voi

[PATCH 2/5] Avoid a compiler warning in WriteDefines

2013-11-28 Thread Justus Winter
* header.c (WriteDefines): Avoid warning about unused parameter. --- header.c |1 + 1 file changed, 1 insertion(+) diff --git a/header.c b/header.c index 150412a..1bc570f 100644 --- a/header.c +++ b/header.c @@ -41,6 +41,7 @@ WriteIncludes(FILE *file) static void WriteDefines(FILE *file) {

[PATCH] Drop the auto keyword

2013-11-28 Thread Justus Winter
Drop the auto keyword from the generated source code. auto is the default storage type for variables anyway and it is customary to omit it. * utils.c (WriteCheckDecl): Drop auto from generated source. (WriteStaticLongDecl): Likewise. (WriteStaticShortDecl): Likewise. --- utils.c |6 +++--- 1

[PATCH 1/5] Advise flex not to generate the input function

2013-11-28 Thread Justus Winter
This avoids a warning about input being unused. * lexxer.l: Define YY_NO_INPUT. --- lexxer.l |3 +++ 1 file changed, 3 insertions(+) diff --git a/lexxer.l b/lexxer.l index 6686b55..5f2f61e 100644 --- a/lexxer.l +++ b/lexxer.l @@ -50,6 +50,9 @@ FileName ({QString}|{AString}) #include "l

[PATCH 5/5] Use inTransPayload

2013-11-28 Thread Justus Winter
An inTransPayload function maps payloads to objects, like an inTrans function maps from port names to objects. Generate code in the server routine to optimize lookups to the receiver of the message. Additionally, if no intran function is provided, but an intranpayload function is, it is expected

[PATCH 01/23] trans: fix the receiver lookup in password

2013-11-28 Thread Justus Winter
Use translation functions instead of doing the lookup manually. * trans/Makefile (password-MIGSFLAGS): Add mutators. * trans/password.c (S_password_check_user): Update accordingly. (S_password_check_group): Likewise. --- trans/Makefile |6 +- trans/password.c | 30 ++--

[PATCH 03/23] libports: add ports_lookup_payload

2013-11-28 Thread Justus Winter
--git a/libports/lookup-payload.c b/libports/lookup-payload.c new file mode 100644 index 000..92f54b6 --- /dev/null +++ b/libports/lookup-payload.c @@ -0,0 +1,44 @@ +/* + Copyright (C) 2013 Free Software Foundation, Inc. + + Written by Justus Winter <4win...@informatik.uni-hamburg

[PATCH 02/23] proc: fix the receiver lookup in S_proc_exception_raise

2013-11-28 Thread Justus Winter
dex 000..0d5bd4d --- /dev/null +++ b/proc/mig-decls.h @@ -0,0 +1,42 @@ +/* Translation functions for mig. + + Copyright (C) 2013 Free Software Foundation, Inc. + + Written by Justus Winter <4win...@informatik.uni-hamburg.de> + + This file is part of the GNU Hurd. + + The GNU Hurd

[PATCH 05/23] console: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* console/priv.h (begin_using_protid_payload): New function. * console/mutations.h: Add mutator. --- console/mutations.h |1 + console/priv.h |6 ++ 2 files changed, 7 insertions(+) diff --git a/console/mutations.h b/console/mutations.h index 5f26672..26f9dc2 100644 --- a/console

[PATCH 07/23] libnetfs: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libnetfs/priv.h (begin_using_protid_payload): New function. * libnetfs/mutations.h: Add mutator. --- libnetfs/mutations.h |2 ++ libnetfs/priv.h |6 ++ 2 files changed, 8 insertions(+) diff --git a/libnetfs/mutations.h b/libnetfs/mutations.h index e6700f5..f3e7209 100644 --- a/

[PATCH 09/23] libcons: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libcons/mutations.h: Add mutator. * libcons/priv.h (begin_using_notify_payload): New function. --- libcons/mutations.h |1 + libcons/priv.h |6 ++ 2 files changed, 7 insertions(+) diff --git a/libcons/mutations.h b/libcons/mutations.h index c895447..4751340 100644 --- a/libcons

[PATCH 06/23] libdiskfs: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* libdiskfs/diskfs.h (diskfs_begin_using_protid_payload): New function. * libdiskfs/fsmutations.h: Add mutator. --- libdiskfs/diskfs.h |9 + libdiskfs/fsmutations.h |2 ++ 2 files changed, 11 insertions(+) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 22262aa..6b

[PATCH 08/23] libtrivfs: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* libtrivfs/fsmutations.h: Add mutators. * libtrivfs/migsupport.c (trivfs_begin_using_protid_payload): New function. (trivfs_begin_using_control_payload): Likewise. * libtrivfs/trivfs.h (trivfs_begin_using_protid_payload): New declaration. (trivfs_begin_using_control_payload): Likewise. --- libtri

[PATCH 04/23] proc: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* proc/Makefile (MIGSFLAGS): Add mutator. * proc/hash.c (reqport_find_payload): New function. * proc/proc.h (reqport_find_payload): New declaration. --- proc/Makefile |1 + proc/hash.c | 10 ++ proc/proc.h |1 + 3 files changed, 12 insertions(+) diff --git a/proc/Makefile b/

[PATCH 10/23] exec: add intranspayload

2013-11-28 Thread Justus Winter
* exec/execmutations.h: Add FILE_INTRAN_PAYLOAD mutation. --- exec/execmutations.h |1 + 1 file changed, 1 insertion(+) diff --git a/exec/execmutations.h b/exec/execmutations.h index 96b4772..52a36c6 100644 --- a/exec/execmutations.h +++ b/exec/execmutations.h @@ -1,6 +1,7 @@ /* CPP definiti

[PATCH 13/23] auth: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* auth/authmutations.h: Add mutator. * auth/auth_mig.h (auth_payload_to_handle): New declaration. * auth/auth.c (auth_payload_to_handle): New function. * utils/fakeauth.c (auth_payload_to_handle): Likewise. --- auth/auth.c |6 ++ auth/auth_mig.h |1 + auth/authmutations.h

[PATCH 12/23] pflocal: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* pflocal/mig-mutate.h: Add mutators. * pflocal/mig-decls.c (begin_using_sock_user_payload): New function. (begin_using_addr_payload): Likewise. --- pflocal/mig-decls.h | 12 pflocal/mig-mutate.h |3 +++ 2 files changed, 15 insertions(+) diff --git a/pflocal/mig-decls.h b/pflo

[PATCH 17/23] trans: disable default payload to port mapping in fsysServer.c

2013-11-28 Thread Justus Winter
fsysServer.o is only used by the symlink translator which does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * trans/Makefile (fsys-MIGSFLAGS): Disable the default payload to port translation function. --- trans/Makefile |4 1

[PATCH 22/23] Fix build

2013-11-28 Thread Justus Winter
--- libports/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libports/Makefile b/libports/Makefile index 934b151..7055901 100644 --- a/libports/Makefile +++ b/libports/Makefile @@ -42,7 +42,7 @@ installhdrs = ports.h HURDLIBS= ihash LDLIBS += -lpthread -OBJS = $

[PATCH 16/23] init: disable default payload to port mapping

2013-11-28 Thread Justus Winter
init does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * init/Makefile (MIGSFLAGS): Disable the default payload to port translation function. --- init/Makefile |4 1 file changed, 4 insertions(+) diff --git a/init/Makefile b/

[PATCH 18/23] libports: add ports_payload_get_name

2013-11-28 Thread Justus Winter
This function maps payloads back to port names. This can be used as intranspayload functions in situations where the server function expects a port name. * libports/ports.h: Add function ports_payload_get_name. --- libports/ports.h | 12 1 file changed, 12 insertions(+) diff --git

[PATCH 14/23] trans: add a payload-aware intrans function to password

2013-11-28 Thread Justus Winter
* trans/Makefile (password-MIGSFLAGS): Add mutator. --- trans/Makefile |1 + 1 file changed, 1 insertion(+) diff --git a/trans/Makefile b/trans/Makefile index c0386d0..fa2 100644 --- a/trans/Makefile +++ b/trans/Makefile @@ -34,6 +34,7 @@ LDLIBS += -lpthread password-LDLIBS = $(LIBCRYPT)

[PATCH 19/23] hurd: add intranpayload functions to all hurd types

2013-11-28 Thread Justus Winter
For each hurd type defined in hurd_types.h, add a intranpayload function. If an X_INTRAN mutation is defined for a type, a corresponding X_INTRAN_PAYLOAD has to be defined. If no X_INTRAN mutation is defined, use ports_payload_get_name as intranpayload function, turning the payload back into an p

[PATCH 11/23] pfinet: add a payload-aware intrans functions

2013-11-28 Thread Justus Winter
* pfinet/mutations.h: Add mutators. * pfinet/misc.c (begin_using_socket_payload): New function. (begin_using_sockaddr_payload): Likewise. * pfinet/pfinet.h (begin_using_socket_payload): New declaration. (begin_using_sockaddr_payload): Likewise. --- pfinet/misc.c | 12 pfinet/mu

[PATCH 21/23] XXX libports: clear payload prior to port destruction

2013-11-28 Thread Justus Winter
It is unclear if this is really necessary. --- libports/complete-deallocate.c |1 + libports/destroy-right.c |3 +++ 2 files changed, 4 insertions(+) diff --git a/libports/complete-deallocate.c b/libports/complete-deallocate.c index 8ce095b..6de97e3 100644 --- a/libports/complete-de

[PATCH 15/23] proc: add a payload-aware intrans function

2013-11-28 Thread Justus Winter
* proc/mig-decls.h (begin_using_exc_payload): New function. * proc/proc_exc.defs (exception_t): Add payload-aware in-translator function. --- proc/mig-decls.h |6 ++ proc/proc_exc.defs |1 + 2 files changed, 7 insertions(+) diff --git a/proc/mig-decls.h b/proc/mig-decls.h index 0d

[PATCH 20/23] libports: use protected payloads to optimize the object lookup

2013-11-28 Thread Justus Winter
* libports/create-internal.c (_ports_create_port_internal): Set the protected payload to the objects address. * libports/import-port.c (ports_import_port): Likewise. * libports/reallocate-from-external.c (ports_reallocate_from_external): Likewise. * libports/reallocate-port.c (ports_reallocate_

[PATCH 23/23] XXX i broke rpctrace

2013-11-28 Thread Justus Winter
If we cannot get this to work with protected payloads, we can always add a switch to libports to disable the optimization. --- utils/rpctrace.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/utils/rpctrace.c b/utils/rpctrace.c index ef7ab53..035a3fd 1006

Implementing protected payloads in GNU Mach, mig, and the Hurd

2013-11-29 Thread Justus Winter
Hi :) I've been reworking the receiver object lookup in Hurd/mig/gnumach. I'll briefly sketch the current state of affairs. Suppose a file is truncated. To do that, a file_set_size message is sent to some port. The relevant ipc routine is: routine file_set_size ( trunc_file: file_t;

Re: [PATCH] Drop the auto keyword

2013-11-29 Thread Justus Winter
Quoting Justus Winter (2013-11-29 01:02:40) > Drop the auto keyword from the generated source code. auto is the > default storage type for variables anyway and it is customary to omit > it. Hm, this is already in, please ignore this. It slipped in while doing git send-email. Justus

[PATCH] libdiskfs: improve the diskfs_demuxer function

2013-11-29 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

Improving the demuxer functions

2013-11-29 Thread Justus Winter
Hi :) the way our demuxer functions chain the X_server functions is initializing the reply message over and over again. This can be avoided by following the recommendations of the Mach Server Writer's Guide. A patch for libdiskfs is sent as a follow-up. To improve the situation further, I propose

[PATCH 2/7] libnetfs: improve the netfs_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 3/7] libtrivfs: improve the trivfs_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 4/7] exec: improve the exec_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 1/7] libdiskfs: improve the diskfs_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 5/7] proc: improve the message_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 7/7] pflocal: improve the demuxer functions

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 6/7] pfinet: improve the pfinet_demuxer function

2013-11-30 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

Re: [PATCH 1/2] device/net_io.c: add comments and initialize hash_entp

2013-12-02 Thread Justus Winter
Quoting Marin Ramesa (2013-12-02 09:14:35) > Samuel Thibault wrote: > > It doesn't seem so clear that it's actually always properly initialized. > > We also need a comment explaining why it always is. > > * device/net_io.c (hash_entp): Initialize and add a comment saying why this > was done. > >

[PATCH 1/5] Advise flex not to generate the input function

2013-12-02 Thread Justus Winter
This avoids a warning about input being unused. * lexxer.l: Define YY_NO_INPUT. --- lexxer.l |3 +++ 1 file changed, 3 insertions(+) diff --git a/lexxer.l b/lexxer.l index 6686b55..5f2f61e 100644 --- a/lexxer.l +++ b/lexxer.l @@ -50,6 +50,9 @@ FileName ({QString}|{AString}) #include "l

[PATCH 2/5] Avoid a compiler warning in WriteDefines

2013-12-02 Thread Justus Winter
* header.c (WriteDefines): Avoid warning about unused parameter. --- header.c |1 + 1 file changed, 1 insertion(+) diff --git a/header.c b/header.c index 150412a..1bc570f 100644 --- a/header.c +++ b/header.c @@ -41,6 +41,7 @@ WriteIncludes(FILE *file) static void WriteDefines(FILE *file) {

[PATCH 5/5] Generate a x_server_routine in the sheader so it can be inlined

2013-12-02 Thread Justus Winter
* header.c (WriteServerHeader): Emit a x_server_routine that can be inlined. * server.c (WriteEpilog): Export the x_routines array so it can be used from the inlined x_server_routine. --- header.c |8 server.c |2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH 4/5] Move the generation of x_server_routine function into a function

2013-12-02 Thread Justus Winter
* server.c (WriteSubsystemServerRoutine): New function. (WriteEpilog): Adjust accordingly. * write.h (WriteSubsystemServerRoutine): New declaration. --- server.c | 35 +-- write.h |1 + 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/server.c

[PATCH 3/5] Clean up generated sources

2013-12-02 Thread Justus Winter
* Makefile (CLEANFILES): Add generated source files lexxer.c and parser.c. --- Makefile.am |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 33bc768..3e6dfcf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ bin_SCRIPTS = mig EXTRA_D

Re: [PATCH 1/2] device/net_io.c: add comments and initialize hash_entp

2013-12-02 Thread Justus Winter
Quoting Marin Ramesa (2013-12-02 11:55:14) > On 02.12.2013 10:37:08, Justus Winter wrote: > > The other day you were fixing this kind of code, now you're > > introducing it. Maybe there's a better way to silence this warning, > > maybe some attribute. > &g

Re: [PATCH 5/5] Generate a x_server_routine in the sheader so it can be inlined

2013-12-02 Thread Justus Winter
Quoting Samuel Thibault (2013-12-02 13:09:44) > Well, it means that whenever a protocol gets augmented, one has to > recompile all demuxer functions calling these inlines. In the example > of trivfs_demuxer, the application itself does not need a rebuild, only > libtrivfs needs, but in other cases

Inlining the x_server_routines in the demuxing functions

2013-12-02 Thread Justus Winter
Hi :) This is a patch series taking advantage of the proposed MIG change to inline the x_server_routine functions into the demuxer functions. It actually seems to improve our performance :) The time needed to compile half (I don't build the udeb variant) a Hurd package using fakeroot-tcp on my ma

[PATCH 2/7] libnetfs: include the mig-generated server headers in demuxer.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * libnetfs/demuxer.c: Include the mig-generated server headers. --- libnetfs/demuxer.c

[PATCH 1/7] libdiskfs: include the mig-generated server headers in demuxer.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * libdiskfs/demuxer.c: Include the mig-generated server headers. --- libdiskfs/demuxer.

[PATCH 4/7] exec: include the mig-generated server headers in main.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * exec/main.c: Include the mig-generated server headers. --- exec/main.c |6 +++---

[PATCH 3/7] libtrivfs: include the mig-generated server headers in demuxer.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * libtrivfs/demuxer.c: Include the mig-generated server headers. --- libtrivfs/demuxer.

[PATCH 6/7] pfinet: include the mig-generated server headers in main.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * pfinet/main.c: Include the mig-generated server headers. --- pfinet/main.c | 11 +++

[PATCH 5/7] proc: include the mig-generated server headers in main.c

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * proc/main.c: Include the mig-generated server headers. --- proc/main.c | 10 +--

[PATCH 7/7] pflocal: include the mig-generated server headers

2013-12-02 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the demuxer function. * pflocal/demuxer.c: Include the mig-generated server headers. * pflocal/sserver.c: Like

[PATCH 1/7] auth: improve the auth_demuxer function

2013-12-04 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 3/7] trans: remove unused declaration from fakeroot.c

2013-12-04 Thread Justus Winter
Any messages we do not intercept are forwarded to the underlying file. * trans/fakeroot.c (netfs_demuxer): Remove unused declaration of function netfs_ifsock_server. --- trans/fakeroot.c |1 - 1 file changed, 1 deletion(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 1766cc2..f3d

[PATCH 5/7] trans: fix the creation of files in fakeroot

2013-12-04 Thread Justus Winter
Previously, fakeroot failed to create files in certain circumstances, e. g. assuming /tmp is a tmpfs and /tmp/some_file does not exist: % cd /tmp && fakeroot-hurd /bin/sh -c ':>/tmp/some_file' /bin/sh: 1: cannot create /tmp/some_file: Is a directory Fix this by sanitizing the flags value not to c

[PATCH 2/7] utils: improve the auth_demuxer function in fakeauth.c

2013-12-04 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 4/7] trans: improve the netfs_demuxer function in fakeroot.c

2013-12-04 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 6/7] trans: fix transparent reauthentication in fakeroot

2013-12-04 Thread Justus Winter
When looking up files, fakeroot intercepts reauthentication requests and executes io_reauthenticate and auth_user_authenticate transparently for the client. This, however, makes the client incorrectly assume that the lookup is finished (assuming /media/scratch is a translator): % cd /media/scratch

[PATCH 7/7] trans: make the fakeroot environment more transparent

2013-12-04 Thread Justus Winter
Previously fakeroot did not explicitly proxy io_identity requests, so the default implementation from libnetfs handled them. But as the fsys identity port returned was always netfs_fsys_identity, this broke the getcwd logic (assuming /media/scratch is a translator): % cd /media/scratch/foo && fake

More fixes for fakeroot-hurd

2013-12-09 Thread Justus Winter
Hi :) with this in, fakeroot-hurd builds the gnumach package just fine. [PATCH 01/13] libfshelp: use a hash table in get-identity.c This considerably improves performance of filesystem translators handing out lots of identity ports. fakeroot triggers just that. [PATCH 02/13] libihash: remove d

[PATCH 02/13] libihash: remove dead code

2013-12-09 Thread Justus Winter
* libihash/ihash.c (hurd_ihash_add): Remove dead code. --- libihash/ihash.c |3 --- 1 file changed, 3 deletions(-) diff --git a/libihash/ihash.c b/libihash/ihash.c index be1c580..d670fee 100644 --- a/libihash/ihash.c +++ b/libihash/ihash.c @@ -372,9 +372,6 @@ hurd_ihash_add (hurd_ihash_t ht,

[PATCH 01/13] libfshelp: use a hash table in get-identity.c

2013-12-09 Thread Justus Winter
Currently fshelp_get_identity uses ports_class_iterate to de-duplicate the identity ports. Use a hash table instead. * libfshelp/get-identity.c (struct idspec): Remove field fileno. (struct idspec): Add field id_hashloc. (id_clean): New function. (id_initialize): Use id_clean as cleanup function f

[PATCH 04/13] trans: improve the performance of dir_lookup in fakeroot

2013-12-09 Thread Justus Winter
Previously any FS_RETRY_NORMAL requests were handed back to the client. Redo the lookup ourself instead. This saves us the burden to create a fake node for the intermediate step, hand it back to the client and handle another request from the client. With this change there is no need to fiddle wi

[PATCH 03/13] trans: fix the use of the hash table in fakeroot.c

2013-12-09 Thread Justus Winter
Previously a pointer to the node was stored in the hash table. This writes the locp pointer into the node object overwriting the next pointer there. Store the pointer to the netnode instead. * trans/fakeroot.c (struct netnode): Add field np. (new_node): Initialize field np. (new_node): Store nn in

[PATCH 06/13] trans: fix locking issue in fakeroot

2013-12-09 Thread Justus Winter
* trans/fakeroot.c (netfs_attempt_mkfile): Keep dir locked until the new node is created. --- trans/fakeroot.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index bee018e..b97b499 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@

[PATCH 09/13] trans: fix locking in fakeroot's netfs_S_dir_lookup

2013-12-09 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Fix locking. --- trans/fakeroot.c | 45 - 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index eff5225..d5cb0e6 100644 --- a/trans/fakeroot.c +++ b/trans/fake

[PATCH 08/13] trans: fix reference counting and destruction of fake nodes

2013-12-09 Thread Justus Winter
Previously, fakeroot tried to do too much in netfs_node_norefs. This function is meant to deallocate nodes. Fakeroot however also tries to remove the node from the hash table and to prolong the lifetime of the node object by re-referencing it. Removing the object from the hash table is highly pr

[PATCH 05/13] trans: handle invalid responses to dir_lookup requests in fakeroot

2013-12-09 Thread Justus Winter
* trans/fakeroot.c (netfs_S_dir_lookup): Handle invalid responses to dir_lookup requests. --- trans/fakeroot.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 6e3b5d4..bee018e 100644 --- a/trans/fakeroot.c +++ b/trans/fa

[PATCH 11/13] trans: improve the error handling in fakeauth

2013-12-09 Thread Justus Winter
Previously the node was not correctly torn down if adding the newly created netnode to the hash table failed. Fix this by rearranging the code, doing the hash table modification first because it is easier to undo. * trans/fakeroot.c (new_node): Fix the error handling. --- trans/fakeroot.c | 37

[PATCH 12/13] trans: unlock nodes with faked attributes in fakeroot

2013-12-09 Thread Justus Winter
When a node has faked attributes, we cannot drop our node. Reinitialize the lock box as if the node was dropped. This fixes the following bug: % fakeroot-hurd /bin/sh -c 'touch /tmp/$$.lock chown 0 /tmp/$$.lock l(){ flock /tmp/$$.lock true;

[PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot

2013-12-09 Thread Justus Winter
* trans/fakeroot.c (new_node): Acquire the nodes lock before releasing the idport_ihash_lock. Return nodes locked. (netfs_S_dir_lookup): Drop lock. (netfs_attempt_mkfile): Likewise. (main): Likewise. --- trans/fakeroot.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-)

[PATCH 10/13] trans: fix reference counting bug in fakeroot

2013-12-09 Thread Justus Winter
The function new_node creates virtual nodes using netfs_make_node. Nodes created with netfs_make_node already have a reference count of one. Currently another reference is added in new_node. This prevents the destruction of the node causing bugs like this: % fakeroot-hurd sh -c 'l(){ flock /tmp/

[PATCH 13/13] console-client: remove spurious pthread_spin_unlocks

2013-12-09 Thread Justus Winter
* console-client/trans.c (netfs_attempt_mkfile): Remove spurious pthread_spin_unlock. (netfs_node_norefs): Likewise. --- console-client/trans.c |2 -- 1 file changed, 2 deletions(-) diff --git a/console-client/trans.c b/console-client/trans.c index 8219f97..00c5407 100644 --- a/console-clie

<    1   2   3   4   5   6   7   8   9   10   >