summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-10Replace `bzero' with `memset'Justus Winter
For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise.
2014-12-10ext2fs: tune the size of the inode cacheJustus Winter
The node cache uses a fixed number of buckets giving it a linear access complexity, although with a small constant factor. Paper over this issue by increasing the number of buckets. * ext2fs/inode.c (INOHSZ): Increase from 512 to 8192 entries.
2014-12-10libpager: use libports notification functionsJustus Winter
Now that we do not use sequence numbers anymore, we can simply use libports notification server functions. * libpager/Makefile (SRCS): Drop `no-senders.c', and `notify-stubs.c'. (OBJS): Drop `notifyServer.o'. * libpager/demuxer.c (pager_demuxer): Use libports server functions. * libpager/mig-mutate.h: Drop all notification mutators. * libpager/no-senders.c: Remove file. * libpager/notify-stubs.c: Likewise.
2014-12-10libpager: remove the `seqno' parametersJustus Winter
* libpager/Makefile (MIGSFLAGS): Drop `-DSEQNOS'. * libpager/priv.h (struct pager): Drop fields `seqno' and `waitingforseqno'. * libpager/chg-compl.c: Adopt accordingly. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. * libpager/demuxer.c: Likewise. * libpager/lock-completed.c: Likewise. * libpager/no-senders.c: Likewise. * libpager/notify-stubs.c: Likewise. * libpager/object-init.c: Likewise. * libpager/object-terminate.c: Likewise. * libpager/pager-create.c: Likewise. * libpager/stubs.c: Likewise.
2014-12-10hurd: add `proc_make_task_namespace'Justus Winter
Add a new RPC to the process protocol to create task namespaces. These can be used by an unprivileged process to claims the responsibility to manage all tasks in this namespace. Any task created in this namespace will automatically be declared a child of the root process, and a `mach_notify_new_task' message is sent to a given port. If the root process dies, the proc server will terminate all tasks in the namespace. * hurd/process.defs (proc_make_task_namespace): New RPC.
2014-12-10proc: implement `proc_make_task_namespace'Justus Winter
* proc/proc.h (struct proc): Add field `p_task_namespace'. * proc/mgt.c (S_proc_child): Propagate `p_task_namespace' to child. (allocate_proc): Initialize `p_task_namespace'. (namespace_terminate): New function. (process_has_exited): Reparent children of dead tasks in the namespace to the root process. Terminate all tasks if the root process dies. Reap dead tasks. (S_mach_notify_new_task): For newly created tasks thats parent is in a namespace, call S_proc_child and forward the `mach_notify_new_task' message. (S_proc_make_task_namespace): New function.
2014-12-10proc: register for new task notificationsJustus Winter
* proc/Makefile (MIGSTUBS): Add `gnumachServer.o'. * proc/main.c (message_demuxer): Handle the `task_notify' protocol. (main): Register for new task notificatinos. * proc/mgt.c (S_mach_notify_new_task): Add server function.
2014-12-10Makeconf: handle the task_notify protocolJustus Winter
* Makeconf (mach_defs_names): Add `task_notify'.
2014-12-10fakeroot: Fix initializing default faked field of nodesSamuel Thibault
* trans/fakeroot.c (new_node): Initialize faked field to FAKE_DEFAULT.
2014-12-09include: don't install nonexistent refcount.hDavid Michael
* include/Makefile (installhdrs): Remove refcount.h.
2014-12-09Fix mode of nodes created with mkfileSamuel Thibault
Their faked field was not initialized. Thanks a lot to Svante Signell for the investigation * trans/fakeroot.c (new_node): Initialize faked field of nn to 0. (netfs_attempt_mkfile): Call set_default_attributes on newly-allocated node, and if the real mode is not the same as the requested mode, fake the mode.
2014-12-07hurd: add intranpayload functions to all hurd typesJustus 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 port name. * hurd/hurd_types.defs: Add intranpayload functions. * hurd/term.defs: Likewise. * hurd/default_pager.defs: Include `hurd_types.defs' for `MACH_PAYLOAD_TO_PORT'.
2014-12-07utils/rpctrace: make `trace_and_forward' payload-awareJustus Winter
As the protected payloads were retrofitted into the Mach message format, the local port type is lost. * utils/rpctrace.c (is_notification): New function (trace_and_forward): Recover the original local port type.
2014-12-07trans/symlink: disable default payload to port mappingJustus Winter
`fsysServer' 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.
2014-12-07trans/streamio: make the translator payload-awareJustus Winter
* trans/Makefile (device_reply-MIGSFLAGS): Define MACH_PAYLOAD_TO_PORT.
2014-12-07trans/password: add a payload-aware intrans functionJustus Winter
* trans/Makefile (password-MIGSFLAGS): Add mutator.
2014-12-07trans/ifsock: add a payload-aware intrans functionJustus Winter
* trans/Makefile (ifsock-MIGSFLAGS): Add mutator.
2014-12-07trans/fakeroot: make the demuxer payload-awareJustus Winter
* trans/fakeroot.c (netfs_demuxer): Make the demuxer payload-aware.
2014-12-07term: add a payload-aware intrans functionJustus Winter
* term/mig-mutate.h: Add mutator.
2014-12-07startup: disable default payload to port mappingJustus Winter
startup does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * startup/Makefile (MIGSFLAGS): Disable the default payload to port translation function.
2014-12-07proc: add payload-aware intrans functionsJustus Winter
* proc/mig-decls.h (begin_using_proc_payload): New function. (begin_using_exc_payload): Likewise. * proc/mig-mutate.h: Add mutators. * proc/proc_exc.defs (exception_t): Add payload-aware in-translator function.
2014-12-07pflocal: add payload-aware intrans functionsJustus Winter
* pflocal/mig-mutate.h: Add mutators. * pflocal/mig-decls.c (begin_using_sock_user_payload): New function. (begin_using_addr_payload): Likewise.
2014-12-07pfinet: make the demuxers payload-awareJustus Winter
* pfinet/ethernet.c (ethernet_demuxer): Make the demuxer payload-aware. * pfinet/main.c (pfinet_demuxer): Likewise.
2014-12-07pfinet: add payload-aware intrans functionsJustus Winter
* pfinet/mig-mutate.h: Add mutators. * pfinet/mig-decls.h (begin_using_socket_payload): New function. (begin_using_sockaddr_payload): Likewise.
2014-12-07exec: add payload-aware intrans functionsJustus Winter
* exec/execmutations.h: Add mutators. * exec/mig-decls.h (begin_using_bootinfo_payload): New function.
2014-12-07console-client: make the demuxer payload-awareJustus Winter
* console-client/trans.c (console_demuxer): make the demuxer payload-aware.
2014-12-07console: add a payload-aware intrans functionJustus Winter
* console/priv.h (begin_using_protid_payload): New function. * console/mutations.h: Add mutators.
2014-12-07auth: add a payload-aware intrans functionJustus Winter
* auth/mig-mutate.h: Add mutator. * auth/mig-decls.h (auth_payload_to_handle): New function.
2014-12-07libcons: add a payload-aware intrans functionJustus Winter
* libcons/mutations.h: Add mutator. * libcons/priv.h (begin_using_notify_payload): New function.
2014-12-07libpager: add a payload-aware intrans functionJustus Winter
* libpager/mig-decls.h (begin_using_pager_payload): New function. * libpager/mig-mutate.h: Add mutators.
2014-12-07libtrivfs: add payload-aware intrans functionsJustus Winter
* libtrivfs/mig-decls.h (trivfs_begin_using_protid_payload): New function. (trivfs_begin_using_control_payload): Likewise. * libtrivfs/mig-mutate.h: Add mutators.
2014-12-07libnetfs: add a payload-aware intrans functionJustus Winter
* libnetfs/priv.h (begin_using_protid_payload): New function. * libnetfs/mutations.h: Add mutator.
2014-12-07libdiskfs: add payload-aware intrans functionsJustus Winter
* libdiskfs/diskfs.h (diskfs_begin_using_protid_payload): New function. (diskfs_begin_using_control_payload): Likewise. (diskfs_begin_using_bootinfo_payload): Likewise. * libdiskfs/fsmutations.h: Add mutators.
2014-12-07libports: add a payload-aware intrans functionJustus Winter
* libports/mig-decls.h (begin_using_port_info_payload): New function. * libports/mig-mutate.h: Add mutator.
2014-12-07libports: add `ports_lookup_payload' and `ports_payload_get_name'Justus Winter
These two functions map payloads to objects and port names. The former can be used like `ports_lookup_port' to look up objects, the latter to map payloads to port names if the server function expects a `mach_port_t'. * libports/ports.h: Add function ports_payload_get_name. * libports/lookup-payload.c: New file. * libports/ports.h (ports_lookup_payload): Add declaration. * libports/Makefile (SRCS): Add lookup-payload.c.
2014-12-06Fix coding styleSamuel Thibault
2014-12-01libshouldbeinlibc: move the reference counting primitives hereJustus Winter
Declare all functions `extern inline' instead of `static inline'. This allows us to use them in functions declared as `extern inline'. * libshouldbeinlibc/refcount.h: Move here, and declare all functions `extern inline'. * libshouldbeinlibc/refcount.c: And define the functions here. * libshouldbeinlibc/Makefile: Add `refcount.{c,h}'.
2014-11-28Revert "random: fix a receiver lookup"Justus Winter
This reverts "8927fbd63e29005ddb9b2c2264046089bf669857". The change mistakenly adds mutators for the `startup' protocol, but the server routine is for the `startup_notify' protocol.
2014-11-27Add atomicity support to fshelp_acquire_lockSamuel Thibault
This adds support for the __LOCK_ATOMIC flag which requests atomicity of SH->EX upgrades and EX->SH downgrades. * libfshelp/lock-acquire.c (__LOCK_ATOMIC): New macro (fshelp_acquire_lock): When __LOCK_ATOMIC is set, do not release the lock early, change the lock hold atomically instead. On upgrade to LOCK_EX, prevent new shared locks from being acquired to avoid starvation.
2014-11-27Fix proc crashesSamuel Thibault
* proc/notify.c (do_mach_notify_dead_name): When `pi' is NULL, immediately return EOPNOTSUPP.
2014-11-23libdiskfs: fix fabrication of protidJustus Winter
* libdiskfs/dir-init.c (diskfs_init_dir): Fix fabrication of protid.
2014-11-23libpager: make the request queue more memory-efficientJustus Winter
Previously, `pager_demuxer' allocated a chunk of memory for the response message. But if memory gets scarce, the kernel will issue a large number of paging requests to free up memory. In such a situation, allocating memory is dangerous. Fix this by not allocating space for the response message, rather, use a chunk of the workers stack space. Also, we only handle the `notify' and `memory_object' protocol, which both only contain simple routines, we only need a `mig_response_header_t'. * libpager/demuxer.c (struct request): Remove `inp' and `outp'. (request_inp): New function. (pager_demuxer): Do not allocate memory for the response. (mig_reply_setup): New function. (worker_func): Adjust accordingly.
2014-11-21boot: improve the demuxerJustus 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. * boot/boot.c (mig_reply_setup): Provide local version. (request_server): Rename to `boot_demuxer', and improve the dispatch.
2014-11-21boot: implement pseudo-time deviceJustus Winter
* boot/boot.c (pseudo_time): New variable. (main): Allocate port `pseudo_time'. (ds_device_open): Give out `pseudo_time'. (ds_device_map): Emulate Mach-style `Mapped Time'.
2014-11-21boot: support ds_device_get_status with flavor DEV_GET_RECORDSJustus Winter
* boot/boot.c (ds_device_get_status): Support flavor DEV_GET_RECORDS.
2014-11-21boot: drop obsolete device proceduresJustus Winter
* boot/boot.c (ds_xxx_device_set_status): Remove function. (ds_xxx_device_get_status): Likewise. (ds_xxx_device_set_filter): Likewise.
2014-11-21boot: remove unused function `boot_script_read_file'Justus Winter
The unused function `boot_script_read_file' requires access to the default pager, which is privileged. * boot/boot.c (defpager): Remove now unused variable. (boot_script_read_file): Remove unused function. (main): Do not acquire port to the default pager. * boot/boot_script.h (boot_script_read_file): Remove declaration.
2014-11-21boot: drop bootstrap compat codeJustus Winter
GNU Mach never sent old-style bootstrap messages. Drop the unused compatibility code. * boot/boot.c (request_server): Drop unused code. (bootstrap_compat): Drop unused function.
2014-11-21startup: also open `console' for readingJustus Winter
* startup/startup.c (main): Also open `console' for reading.
2014-11-21proc: gracefully handle failure to increase priorityJustus Winter
* proc/main.c (increase_priority): New function. (main): Move code increasing the proc servers priority to a new function and handle errors gracefully.