aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* console-client: fix build with -O0Justus Winter2015-05-231-1/+1
| | | | * console-client/timer.h (fetch_jiffies): Make function `static inline'.
* fakeroot: Fix reopening files after a chmodSamuel Thibault2015-05-231-1/+15
| | | | | | | Huge thanks to Svante Signell for having tracked the bug. * trans/fakeroot.c (netfs_attempt_chmod): Make the file_chmod call additionally include the modes from nn->openmodes.
* Make comment clearerSamuel Thibault2015-05-231-2/+2
| | | | | * trans/fakeroot.c (check_openmodes): Make comment clearer about missing new openmodes.
* Make sure to record only RWX open modesSamuel Thibault2015-05-231-1/+6
| | | | | | | | | | Thanks Svante Signell for the investigation and proposed patch. * trans/fakeroot.c (new_node): Assert that `openmodes' includes only O_RDWR|O_EXEC (check_openmodes): Likewise with `newmodes'. (netfs_S_dir_lookup): Keep only O_RDWR|O_EXEC from `flags' when calling new_node.
* fatfs: fix error handlingJustus Winter2015-05-191-2/+3
| | | | * fatfs/dir.c (diskfs_dirrewrite_hard): Fix error handling.
* libdiskfs: fix renaming of directoriesJustus Winter2015-05-191-0/+2
| | | | | | | | | | | | | Previously, file permissions and ownership of the target directory were ignored when renaming a directory: % mkdir a b % chmod 555 a % mv b a % ls a b * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling.
* Fix creating named sockets inside fakeroot-hurdSvante Signell2015-05-141-0/+14
| | | | * trans/fakeroot.c (netfs_set_translator): New function.
* fatfs: port to libdiskfs' node cacheJustus Winter2015-04-174-275/+46
| | | | | | | | | | | | | | | * fatfs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (diskfs_cached_lookup_in_dirbuf): Reimplement using the `lookup_context'. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (diskfs_node_reload): Pass context to `diskfs_user_read_node'. (diskfs_alloc_node): Pass `dir' via context to `diskfs_user_read_node'. * fatfs/fatfs.h (struct disknode): Drop fields `hnext', `hprevp'. (struct lookup_context): New definition. (ifind): Drop declaration. * fatfs/dir.c (diskfs_lookup_hard): Adjust accordingly. * fatfs/main.c (fetch_root): Likewise.
* isofs: port to libdiskfs' node cacheJustus Winter2015-04-174-302/+70
| | | | | | | | | | | | | * isofs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (calculate_file_start): Check for `record' being null. (cache_id): New function. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to diskfs_user_try_dropping_softrefs. * isofs/isofs.h (struct lookup_context): New definition. (cache_id): New declaration. * isofs/lookup.c (diskfs_lookup_hard): Adjust accordingly. * isofs/main.c (fetch_root): Likewise.
* libdiskfs: implement a node cacheJustus Winter2015-04-177-230/+336
| | | | | | | | | | | | | | | | | | | | | Previously, all users of libdiskfs implemented a node cache on their own. Move the node cache from ext2fs into libdiskfs. We preserve the previous API by marking all functions that we pull from ext2fs as weak, so that users like tmpfs can still implement their own node cache. * ext2fs/dir.c (diskfs_lookup_hard): Adjust accordingly. * ext2fs/ext2fs.c (main): Don't call `inode_init'. * ext2fs/ext2fs.h (struct disknode): Drop `hnext', `hprevp'. * ext2fs/inode.c: Move the node cache into diskfs. (diskfs_user_make_node): New function. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (read_node): Rename to `diskfs_user_read_node'. Also move a chunk of code dealing with generations from `diskfs_cached_lookup' here. * libdiskfs/Makefile (OTHERSRCS): Add `node-cache.c'. * libdiskfs/diskfs.h (struct node): Add `hnext', `hprevp'. Amend existing comments, add forward declarations. * libdiskfs/node-cache.c: New file.
* ext2fs: use fat nodesJustus Winter2015-04-177-143/+147
| | | | | | | | | | | | | | | | | Use `diskfs_make_node_alloc' to allocate both the node and the disknode in a continuous chunk of memory. This increases locality and reduces the pressure on the memory allocator. * ext2fs/inode.c: Use `diskfs_node_disknode' to access the disknode. (diskfs_cached_lookup): Use `diskfs_make_node_alloc' to allocate the node. (diskfs_node_norefs): Only free `np'. * ext2fs/dir.c: Use `diskfs_node_disknode' to access the disknode. * ext2fs/ext2fs.h: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/ialloc.c: Likewise. * ext2fs/pager.c: Likewise. * ext2fs/truncate.c: Likewise.
* libdiskfs: declare all inline functions as `extern inline'Justus Winter2015-04-171-2/+6
| | | | | | * libdiskfs/diskfs.h (diskfs_node_disknode, diskfs_disknode_node): Declare functions as `extern inline' so that we can use them in other functions declared as `extern inline'.
* libdiskfs: fix node initializationJustus Winter2015-04-171-0/+1
| | | | * libdiskfs/node-make.c (init_node): Initialize flag `author_tracks_uid'.
* libdiskfs: drop unused fields from struct nodeJustus Winter2015-04-171-2/+0
| | | | | * libdiskfs/diskfs.h (struct node): Drop unused fields from struct node.
* libdiskfs: make struct node more compactJustus Winter2015-04-171-6/+11
| | | | * libdiskfs/diskfs.h (struct node): Turn flags into a bit field.
* libdiskfs: lock-less reference counting of nodesJustus Winter2015-04-1715-156/+90
| | | | | | | | | | | | | | | | | | | | * libdiskfs/diskfs.h (struct node): Use refcounts_t for reference counting. (diskfs_node_refcnt_lock): Remove. (diskfs_node_norefs,diskfs_drop_node): Change comments accordingly. * libdiskfs/init-init.c: Adjust accordingly. * libdiskfs/node-drop.c: Likewise. * libdiskfs/node-make.c: Likewise. * libdiskfs/node-nput.c: Likewise. * libdiskfs/node-nputl.c: Likewise. * libdiskfs/node-nref.c: Likewise. * libdiskfs/node-nrefl.c: Likewise. * libdiskfs/node-nrele.c: Likewise. * libdiskfs/node-nrelel.c: Likewise. * ext2fs/inode.c: Likewise. * fatfs/inode.c: Likewise. * isofs/inode.c: Likewise. * tmpfs/node.c: Likewise. * doc/hurd.texi: Likewise.
* tmpfs: use a seperate lock to protect all_nodesJustus Winter2015-04-173-39/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, tmpfs used diskfs_node_refcnt_lock to serialize access to the all_nodes and some other related global state related to memory consumption. Use a separate lock to protect all_nodes, and atomic operations to access the state related to memory consumption. Adjust the reference counting accordingly. Every node in the all_nodes carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the all_nodes. * tmpfs/tmpfs.h (num_files, tmpfs_space_used): Use atomic operations for these variables. (adjust_used): Use atomic operations. (get_used): New convenience function to atomically retrieve tmpfs_space_used. * tmpfs/node.c (all_nodes_lock): New lock. (diskfs_alloc_node): Use a separate lock to protect all_nodes. Adjust the reference counting accordingly. (diskfs_free_node): Likewise. (diskfs_cached_lookup):Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Do not remove the node from all_nodes. This actually looks like a mistake, I do not know why they did that here as well as in diskfs_free_node. (diskfs_try_dropping_softrefs): Check whether someone reacquired a reference, and if so hold on to our light reference. (diskfs_grow): Use atomic operations. * tmpfs/tmpfs.c (diskfs_set_statfs): Likewise.
* isofs: use a seperate lock to protect node_cacheJustus Winter2015-04-171-41/+105
| | | | | | | | | | | | | | | | | | | | | | | Previously, isofs used diskfs_node_refcnt_lock to serialize access to the node_cache. Use a separate lock to protect node_cache. Adjust the reference counting accordingly. Every node in the node_cache carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the node_cache. * isofs/inode.c (nodecache_lock): New lock. (inode_cache_find): Use a separate lock to protect node_cache. Adjust the reference counting accordingly. (diskfs_cached_lookup): Likewise. (load_inode): Likewise. (cache_inode): Update comment accordingly. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from node_cache... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
* fatfs: use a seperate lock to protect nodehashJustus Winter2015-04-111-45/+102
| | | | | | | | | | | | | | | | | | | | | Previously, fatfs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the nodehash. * fatfs/inode.c (nodecache_lock): New lock. (diskfs_cached_lookup): Use a separate lock to protect nodehash. Adjust the reference counting accordingly. (ifind): Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from nodehash... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
* ext2fs: use a seperate lock to protect nodehashJustus Winter2015-04-111-36/+92
| | | | | | | | | | | | | | | | | | | | | Previously, ext2fs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the nodehash. * ext2fs/inode.c (nodecache_lock): New lock. (diskfs_cached_lookup): Use a separate lock to protect nodehash. Adjust the reference counting accordingly. (ifind): Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from nodehash... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
* GNU Hurd 0.6.Thomas Schwinge2015-04-102-14/+7
| | | | | * configure.ac (AC_INIT): Set version to 0.6. * NEWS: Finalize for 0.6.
* NEWS: mention that the init server has been splitJustus Winter2015-04-081-0/+4
| | | | | * NEWS: Mention that the init server has been split into the startup server and the init server.
* procfs: fix runtime option parsingJustus Winter2015-04-071-1/+1
| | | | | * procfs/main.c (netfs_runtime_argp): Actually use the runtime option parser.
* libports: use protected payloads to optimize the object lookupJustus Winter2015-04-0715-20/+377
| | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention protected payloads. * libports/Makefile (SRCS): Add `port-deref-deferred.c'. * 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_port): Likewise. * libports/transfer-right.c (ports_transfer_right): Likewise. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Use the protected payload for the object lookup if provided. Add thread pool management calls. * libports/manage-one-thread.c (ports_manage_port_operations_one_thread): Likewise. * libports/destroy-right.c (ports_destroy_right): Defer the dereferencing of outstanding send rights to avoid a port_info use-after-free. * libports/port-deref-deferred.c: New file. * libports/port-deref-deferred.h: Likewise. * libports/ports.h (struct port_bucket): New field `threadpool'. (ports_lookup_payload): Check `port_right'.
* procfs: fix argument parsingJustus Winter2015-04-071-3/+3
| | | | * procfs/main.c (argp_parser): Fix argument parsing.
* Fix space styleSamuel Thibault2015-03-0562-739/+739
|
* libports: avoid acquiring global lock in message dispatchJustus Winter2015-02-173-8/+16
| | | | | | | | * libports/interrupt-operation.c (ports_S_interrupt_operation): Update `cancel_threshold' using atomic operations. * libports/manage-multithread.c (internal_demuxer): Avoid taking the lock. * libports/ports.h (struct port_info): Mention that one needs atomic operations to access `cancel_threshold'.
* TODO: drop obsolete itemJustus Winter2015-02-141-2/+0
| | | | | | * TODO (libpager): Drop item trying to prevent thread storms. We dealt with that in a much nicer way. Nowadays we use a fixed number of threads in libpager.
* startup: add more error handlingJustus Winter2015-02-081-22/+41
| | | | * startup/startup.c (launch_core_servers): Add more error handling.
* Explicit the keymap compatibility flagsSamuel Thibault2015-02-022-94/+92
| | | | | | | | | Since "default" is not provided any more by xkb * console-client/xkb/xkb-data/keymap/hurd: Replace "default" xkb_compatibility by "basic+mousekeys+accessx(basic)+misc+iso9995+level5+caps(caps_lock)" for all keymaps.
* Allow dhcp trafic and configurationSamuel Thibault2015-02-022-80/+258
| | | | | | | | | | | | | | | | | | | | | | | | | 2007-10-14 Christian Dietrich <stettberger@dokucode.de> * options.c (options): Marked -a, -g -m, -p, -A, -G OPTION_ARG_OPTIONAL. (parse_interface_copy_device): New function. (parse_opt): When selecting another interface with -i set the options from e.g. a prior fsysopts call as default values. For -a, -g, -p, -g, -A, -G set the optional argument as value. When there is no argument, delete the value (e.g. unset default gateway). Delete delete default gateways only if the set gateway is on an interface modified in this call. Add always an route for dhcp packages on all devices. By doing this we can send dhcp renew packages. (trivfs_append_args): Add --gateway only once. 2007-10-14 Marco Gerards <metgerards@student.han.nl> * options.c (parse_opt): Add the route for `0.0.0.0' so broadcasting works. * linux-src/net/ipv4/devinet.c (inet_insert_ifa) [_HURD_]: Don't fail when the address is `0.0.0.0'.
* Remove unimplemented -s optionSamuel Thibault2015-02-021-1/+0
| | | | * pfinet/options.c (options): Remove 's' case.
* utils/rpctrace: fix notification port handlingJustus Winter2015-01-201-1/+2
| | | | | * utils/rpctrace.c (new_receiver_info): Fix handling of old notification port.
* console: fix error and notification port handlingJustus Winter2015-01-201-15/+22
| | | | | | | | | | | This fixes a deallocation of an invalid port notably seen on system shutdown. * console/display.c (free_modreqs): Handle errors of `mach_port_request_notification' and check whether the old notification port was valid. (do_mach_notify_msg_accepted): Likewise. (display_notice_filechange): Likewise.
* proc: call `startup_essential_task' earlierJustus Winter2015-01-174-13/+58
| | | | | | | | | | | | | | | | | | | | | Previously, the proc server did not call `startup_essential_task' until it got the message port of the startup server using `proc_setmsgport'. Now that we have `/servers/startup', we can do this in main, before we start our message service loop. A complication arises because the traditional startup server is single-threaded. Handle this by tweaking startup not to bind itself to `/servers/startup' before it is ready. * proc/main.c (main): Try to lookup `/servers/startup' and send the message here, or... * proc/msg.c (S_proc_setmsgport): ... fall back to the old way here. * proc/proc.h (startup_fallback): New variable. * startup/startup.c (main): Move code installing ourself on `/servers/startup' (install_as_translator): ... here. (launch_core_servers): And use it here, just before we reply to `/hurd/auth'.
* auth: remove implicit assumption about the bootstrap processJustus Winter2015-01-171-1/+14
| | | | | | | | The current code assumes that it can speak the startup protocol over its bootstrap port. * auth/auth.c (main): Generalize by trying to use `/servers/startup' before falling back to the bootstrap port.
* auth: simplify expressionJustus Winter2015-01-171-2/+2
| | | | * auth/auth.c (S_auth_{user,server}_authenticate): Simplify expression.
* startup: give the tasks we create a nameJustus Winter2015-01-171-0/+2
| | | | * startup/startup.c (run): Name the tasks we start.
* libports: silence pointless error messageJustus Winter2015-01-171-0/+5
| | | | | * libports/manage-multithread.c (adjust_priority): Silence pointless error message.
* libdiskfs: fix port leakJustus Winter2015-01-171-0/+1
| | | | * libdiskfs/boot-start.c (get_console): Deallocate `device_master'.
* libfshelp: improve error handlingJustus Winter2015-01-171-3/+3
| | | | | | * libfshelp/start-translator-long.c (fshelp_start_translator_long): Once we have a task, go to `lose_task' so that we do not leave hosed tasks around.
* random: fix typoJustus Winter2015-01-041-1/+1
| | | | * random/gnupg-random.c (read_pool): Fix typo in comment.
* Backport Linux changes for proper TCP EOF handlingSamuel Thibault2015-01-033-32/+31
| | | | | | | | | | | | | Notably when remote eagerly sends a RST: we want to return EOF to the application, not EPIPE. * pfinet/linux-src/net/ipv4/tcp_output.c (tcp_connect): Set sk->done to 0. * pfinet/linux-src/net/ipv4/tcp_input.c (tcp_fin): Set RCV_SHUTDOWN, and sk->done to 1. * pfinet/linux-src/net/ipv4/tcp.c (tcp_recv_urg): Only return ENOTCONN when we never actually connect. Always return 0 when reception is closed. (tcp_recvmsg): When any data is available, ignore errors and EOF. When no data is available, first check for reception being closed, then for errors.
* procfs: Fix typos in comments (found by codespell)Stefan Weil2015-01-034-5/+5
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* libshouldbeinlibc: Fix typo in local variable nameStefan Weil2015-01-031-3/+3
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* misc: Fix typos in comments (found by codespell)Stefan Weil2015-01-036-7/+7
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* console: Fix typos in commentsStefan Weil2015-01-032-2/+2
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* console-client: Fix typos in commentsStefan Weil2015-01-038-14/+14
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* aclocal.m4, configure.ac: Fix typos and grammar in comment (found by codespell)Stefan Weil2015-01-032-3/+3
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* lib*: Fix typos in comments (found by codespell)Stefan Weil2015-01-037-8/+8
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>