OFS(4) OFS(4) NAME ofs - mount a file server speaking Op using Styx SYNOPSIS o/ofs [ -Adv ] [ -C alg ] [ -k keyfile ] [ -m mnt ] [ -c dir ] netaddr [ path ] DESCRIPTION Ofs dials the Op file server found at addr and mounts it at mnt. Here, addr may be a file representing a connection, like /fd/0 or any other file. It speaks both Styx (as a server) and Op (as a client) and provides a Styx file server to mount in Inferno file trees served from Op servers. Usu- ally, the server mounted is oxport(4), used to export a name space using Op. The path (subtree) served by the Op server is / by default, but may be supplied as an option. This program exists because Op is faster than Styx, regard- ing latency, on network links with bad latency, being the main reason that Op requires less RPCs than Styx for doing the same thing. However, there are some issues to be taken into account when using this program to export devices. See intro(O) for a discussion. In general, files are retrieved from the server with a sin- gle get(O) operation. Big files require further RPCs. All writes are indeed write-through, although those that are not the first write, and use a full Styx packet, are sent asyn- chronously (like in delayed writes). If mnt is given, it mounts itself using flags MREPL and MCREATE at the directory named by mnt. Otherwise, it uses standard input to serve files speaking Styx (this is intended for use with mount(1). By default, ofs authenticates the client when mounting itself, and encrypts the channel using RC4. Authentication can be disabled with the -A flag, and the algorithm used to sign/encrypt the channel may be changed using -C and supply- ing the algorithm name in arg (as said in ssl(3)). The key- file used for authentication follows the standard convention used in Inferno, but may be otherwise specified to be keyfile using -k. When the special name auto is given in mnt the program reads a system name from the connection, before mounting it, and uses /term/remotename to automatically mount the remote tree. The system name is read by first reading 9 bytes, which should be a UTF-8 string with 8 digits in printable form and a new line. Then, it reads so many bytes and takes OFS(4) OFS(4) that string (in UTF-8) to be the remote system name. Flag -d enables (very) verbose debug diagnostics. Trying to access a file named !!DUMP dumps the internal state of the cache, for debugging. Flag -v makes the program report some protocol statistics before exiting. Flag -c instructs ofs to use a local, on-disk, cache located at dir to keep files fetched/update from/to the server. The cache is only used to serve read requests for files that are not entirely cached on-memory (that is, for files that are not quite small). The directory structure reflects that of the server. One nice side-effect of using this cache is that files updated to the server are still kept in the local disk, should the connection to the server fail. EXAMPLE Import (using Op) a remote file tree and mount it at /n/pc. o/ofs -m /n/pc tcp!opserver.org!10000 Import a locally-served file tree using mount (ie., start Ofs using standard input as the Styx connection). mount -c {o/ofs -C rc4 tcp!127.0.0.1!10000} /n/pc Listen for calls from a remote export program, and make remote trees available at /term/$remotesysname (encrypting the channel). Where, $remotesysname is given by the export program at the other end. listen -tv 'tcp!*!17004' { o/ofs -A -d -m auto /fd/0 >[2]/dev/cons& } SOURCE /usr/octopus/port/ofs SEE ALSO intro(O) and oxport(4).