[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c
From: |
Samuel Thibault |
Subject: |
[hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c |
Date: |
Tue, 14 Jan 2014 02:00:02 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit c7030a9c0ac36cccb07ef562908b62c2ef9d8bb4
Author: Justus Winter <address@hidden>
Date: Tue Dec 3 19:37:54 2013 +0100
trans: improve the netfs_demuxer function in fakeroot.c
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 to call mig_reply_setup.
* trans/fakeroot.c (netfs_demuxer): Improve the demuxer function.
---
trans/fakeroot.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index f3df46b..679e476 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -838,20 +838,26 @@ int
netfs_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
- int netfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
- int netfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
- int netfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
-
- if (netfs_io_server (inp, outp)
- || netfs_fs_server (inp, outp)
- || ports_notify_server (inp, outp)
- || netfs_fsys_server (inp, outp)
+ mig_routine_t netfs_io_server_routine (mach_msg_header_t *);
+ mig_routine_t netfs_fs_server_routine (mach_msg_header_t *);
+ mig_routine_t ports_notify_server_routine (mach_msg_header_t *);
+ mig_routine_t netfs_fsys_server_routine (mach_msg_header_t *);
+ mig_routine_t ports_interrupt_server_routine (mach_msg_header_t *);
+
+ mig_routine_t routine;
+ if ((routine = netfs_io_server_routine (inp)) ||
+ (routine = netfs_fs_server_routine (inp)) ||
+ (routine = ports_notify_server_routine (inp)) ||
+ (routine = netfs_fsys_server_routine (inp)) ||
/* XXX we should intercept interrupt_operation and do
the ports_S_interrupt_operation work as well as
sending an interrupt_operation to the underlying file.
*/
- || ports_interrupt_server (inp, outp))
- return 1;
+ (routine = ports_interrupt_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
+ return TRUE;
+ }
else
{
/* We didn't recognize the message ID, so pass the message through
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 57/98: utils: improve the auth_demuxer function in fakeauth.c, (continued)
- [hurd] 57/98: utils: improve the auth_demuxer function in fakeauth.c, Samuel Thibault, 2014/01/13
- [hurd] 66/98: trans: improve the performance of dir_lookup in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 41/98: libports: improve error handling in ports_reallocate_from_external, Samuel Thibault, 2014/01/13
- [hurd] 40/98: libports: improve error handling in ports_reallocate_port, Samuel Thibault, 2014/01/13
- [hurd] 58/98: trans: remove unused declaration from fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 72/98: trans: fix reference counting bug in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 39/98: proc: update comments, Samuel Thibault, 2014/01/13
- [hurd] 26/98: Make sure created netfs nodes have stat validated, Samuel Thibault, 2014/01/13
- [hurd] 53/98: proc: improve the message_demuxer function, Samuel Thibault, 2014/01/13
- [hurd] 04/98: utils: implement settrans --pid-file, Samuel Thibault, 2014/01/13
- [hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c,
Samuel Thibault <=
- [hurd] 48/98: libports: another right leak fix, Samuel Thibault, 2014/01/13
- [hurd] 73/98: trans: improve the error handling in fakeauth, Samuel Thibault, 2014/01/13
- [hurd] 06/98: proc: fix the declaraton of genpid, Samuel Thibault, 2014/01/13
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, Samuel Thibault, 2014/01/13
- [hurd] 70/98: trans: fix reference counting and destruction of fake nodes, Samuel Thibault, 2014/01/13
- [hurd] 77/98: trans/fakeroot: fix ownership of newly created files, Samuel Thibault, 2014/01/13
- [hurd] 64/98: libihash: remove dead code, Samuel Thibault, 2014/01/13
- [hurd] 74/98: trans: unlock nodes with faked attributes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 75/98: console-client: remove spurious pthread_spin_unlocks, Samuel Thibault, 2014/01/13
- [hurd] 62/98: trans: make the fakeroot environment more transparent, Samuel Thibault, 2014/01/13