[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/7] libnetfs: improve the netfs_demuxer function
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/7] libnetfs: improve the netfs_demuxer function |
Date: |
Mon, 2 Dec 2013 12:59:50 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Sat 30 Nov 2013 20:10:58 +0100, a écrit :
> 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.
>
> * libnetfs/demuxer.c (netfs_demuxer): Improve the demuxer function.
Ack.
> ---
> libnetfs/demuxer.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/libnetfs/demuxer.c b/libnetfs/demuxer.c
> index 8b6d1b2..8ef4d86 100644
> --- a/libnetfs/demuxer.c
> +++ b/libnetfs/demuxer.c
> @@ -1,5 +1,5 @@
> /*
> - Copyright (C) 1996 Free Software Foundation, Inc.
> + Copyright (C) 1996, 2013 Free Software Foundation, Inc.
> Written by Michael I. Bushnell, p/BSG.
>
> This file is part of the GNU Hurd.
> @@ -24,15 +24,24 @@ 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 *);
> - int netfs_ifsock_server (mach_msg_header_t *, mach_msg_header_t *);
> + 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 netfs_ifsock_server_routine (mach_msg_header_t *);
>
> - return (netfs_io_server (inp, outp)
> - || netfs_fs_server (inp, outp)
> - || ports_notify_server (inp, outp)
> - || netfs_fsys_server (inp, outp)
> - || ports_interrupt_server (inp, outp)
> - || netfs_ifsock_server (inp, outp));
> + 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)) ||
> + (routine = ports_interrupt_server_routine (inp)) ||
> + (routine = netfs_ifsock_server_routine (inp)))
> + {
> + (*routine) (inp, outp);
> + return TRUE;
> + }
> + else
> + return FALSE;
> }
> --
> 1.7.10.4
>
--
Samuel
The only "intuitive" interface is the nipple. After that, it's all learned.
(Bruce Ediger, bediger@teal.csn.org, in comp.os.linux.misc, on X interfaces.)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 2/7] libnetfs: improve the netfs_demuxer function,
Samuel Thibault <=