[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Caution: This text just tries to give a general picture. For real info read the code. If you have any questions, mail arla-drinkers@stacken.kth.se.
How does arla work The relation between Arlad and XFS 5.1 The life of a file Tools and libs 5.4 The files in arlad/ pioctl and kafs
Arla consists of two parts, a userland process (arlad) and the kernel-module (xfs).
Arlad is written in user-space for simpler debugging (and less rebooting). As a uset space program arlad does not have the same limitations as if it would be written in the kernel. To avoid performance loss as much as possible, xfs is caching data.
xfs and arlad communicate with each other via a char-device-driver. There is a rpc-protocol currenly used specially written for this (`arlad/message.c')
xfs is written to be as simple as possible. Theoretically, xfs could be used by other user-space daemons to implement a file system. Some parts, such as syscalls, are arla-specific. These parts are designed to be as general as possible.
For example, xfs does not recognize which pioctl the user-level program calls, it just passes this information on to arlad.
Userland --------- Edit file | Arlad | ------> Network | --------- ----|-----------------|[1]---- ------- ------- Kernel | VFS | <--[2]--> | XFS | ------- ------- |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Step by step description of what happens during the creation of a file. The names are inspired of BSD-style VFS-layer but the idea is the same in most operating systems.
What other tools does the arla suite consists of
util/libutil.a
- A library for the most often used
rx/librx.a
- The library for the rx protocol
lwp/liblwp.a
- The library for the lwp thread-package
ydr/ydr
- A stub generator that replaces rxgen.
rxkad/librxkad.a
- The rx Kerberos authentication package.
lib/roken/libroken.a
- The library that will unbreak
lib/ko/libko.a
- A library of functions that are arlad-core
appl/lib/libarlalib.a
- A broken library that does all
appl/fs/fs
- The fs util, extra feature
appl/vos/vos
- The vos util.
appl/pts/pts
- The pts util, extra feature: dump.
appl/udebug/udebug
- Debug your ubik server.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Rx is run over UDP.
One of rxgen or ydr is used to generate stub-files, ydr is better since it generates prototypes, too.
The current implemetation of rx it not that beautiful.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
LWP is a preepmtive thread package. It does it's context-switching by creating a private stack for each thread. The heart of the package is select(2).
The stack is checked for overruns in context-switches, but that is often too late. It might be an idea to add a red zone at the top of the stack to be able to detect overruns.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is a short describtion of the files to bring new deveplopers up to speed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These are the files that contain operating specific functions. Today it's just conv_dir().
The pioctl interface is the only part of xfs that is afs related.
pioctl is a ioctl but called with a path instead of a filedescriptor.
When you probe if there is a live afsclient you first run
k_hasafs()
that probes if there is an afsclient around.
It also sets up some static variables in the library. So if you
start to do pioctl()
w/o running k_hasafs()
, you're
up to funny errors, and/or get a corefile.
k_hasafs()
does an AFSCALL_PIOCTL
with opcode
VIOCSETTOK
and insize == 0, ie you try to set a token
(ticket) that is 0 bytes long. This is cleary invalid and kafs
expects to find an EINVAL
returned from syscall(2)
.
The pioctl is used more then just for AFSCALL_PIOCTL
, an other
use is AFSCALL_SETPAG
(setting pag). It has also been in use for
setting xfs debugging levels.
When xfs discovers that a path is given in the pioctl()
it does a
VOP_LOOKUP
on the path and if the returned value is a vnode that
resides in afs then it extracts the xfs-handle for that node (that just
happens to be the VenusFid) and passes that on to arlad.
The only ugly thing about the current implentation is that the syscall code assumes that the arlad on "xfs-fd" is the arlad that should get this syscall.
An example of using pioctl()
:
int fs_getfilecellname(char *path, char *cell, size_t len) { struct ViceIoctl a_params; a_params.in_size=0; a_params.out_size=len; a_params.in=NULL; a_params.out=cell; if (k_pioctl(path,VIOC_FILE_CELL_NAME,&a_params,1) == -1) return errno; return 0; } int main (int argc, char **argv) { char cell[100]; if (!k_hasafs()) errx (1, "there is no afs"); if (fs_getfilecellname (".", cell, sizeof(cell))) errx (1, "fs_getfilecellname failed"); printf ("cell for `.' is %s", cell); return 0; } |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |