genode/repos/os/src/server/fs_log
Christian Prochaska b0935ef9b2 VFS: nonblocking interface
The VFS library can be used in single-threaded or multi-threaded
environments and depending on that, signals are handled by the same thread
which uses the VFS library or possibly by a different thread. If a VFS
plugin needs to block to wait for a signal, there is currently no way
which works reliably in both environments.

For this reason, this commit makes the interface of the VFS library
nonblocking, similar to the File_system session interface.

The most important changes are:

- Directories are created and opened with the 'opendir()' function and the
  directory entries are read with the recently introduced 'queue_read()'
  and 'complete_read()' functions.

- Symbolic links are created and opened with the 'openlink()' function and
  the link target is read with the 'queue_read()' and 'complete_read()'
  functions and written with the 'write()' function.

- The 'write()' function does not wait for signals anymore. This can have
  the effect that data written by a VFS library user has not been
  processed by a file system server yet when the library user asks for the
  size of the file or closes it (both done with RPC functions at the file
  system server). For this reason, a user of the VFS library should
  request synchronization before calling 'stat()' or 'close()'. To make
  sure that a file system server has processed all write request packets
  which a client submitted before the synchronization request,
  synchronization is now requested at the file system server with a
  synchronization packet instead of an RPC function. Because of this
  change, the synchronization interface of the VFS library is now split
  into 'queue_sync()' and 'complete_sync()' functions.

Fixes #2399
2017-08-28 16:49:38 +02:00
..
main.cc file system: use Id_space instead of Node_handle_registry 2017-08-17 10:59:43 +02:00
README Make label prefixing more strict 2016-11-30 13:37:07 +01:00
session.h VFS: nonblocking interface 2017-08-28 16:49:38 +02:00
target.mk server/fs_log: improve client isolation 2016-08-29 17:29:34 +02:00

LOG server that writes log messages onto a file system.

Log files are creating in a directory tree formed from session labels.
As an example the session label "init -> nitpicker" would create
a log file at "init/nitpicker.log".

The option to truncate files at the start of each LOG session is available
through session policy, as well the option to merge the logs of any
session matching a given policy. When a merged policy label contains a
trailing "->", the log filename takes the name of the next label element.

When a default-policy node specifies a merge, all sessions are merged into
the file "/log".

:Example configuration:
! <start name="log_file">
!   <resource name="RAM" quantum="1M"/>
!   <provides><service name="LOG"/></provides>
!   <config>
!     <policy label_prefix="nic_drv" truncate="no"/>
!     <policy label_prefix="cli_monitor -> " merge="yes"/>
!     <default-policy truncate="yes"/>
!   </config>
! </start>