filesys − general description of file system interface
{
init_routine,open_routine,read_routine,
write_routine,ioctl_routine,close_routine
}
New file systems and protocol support is added to the standalone i/o
system by write the file system or protocol implementation routines
and making a new entry to the file system configuration structure
_fs_table in the file saio/conf.c. The format of a file system
configuration entry is shown above.
The fields in a file system
configuration entry have the following usage:
init_routine(iop)
The initialization routine is called during the startup initialization
of the standalone i/o library when a program is run.
The main function of the initialization routine is to initialize
global data of the file system routines. The initialization routine
usually does not reference a hardware device.
open_routine(iop, path, flags)
The open routine is called in response to a
request. It is called after the standalone i/o system has called
the device driver open routine. It is passed a pointer to a
struct iob associated with the descriptor being opened, the
component of the file to be opened,
and
indicating if the open is read-only, write-only, or read-write.
The main function of the file system open routine is to establish
enough context regarding file named in
so that future read and write requests may be accomplished. For
UNIX file systems, this is accomplished by locating and reading
the appropriate struct inode from the device. Protocol implementations
locate an appropriate file server during the open.
read_routine(iop, buffer, count)
The read routine is passed a pointer to a struct iob
associated with the descriptor being read, the address
of a user’s
and a byte
indicating the amount of data to transfer. The read routine accomplishes
the data transfer by referring to data established during the open
and making calls to the lower level device driver. The lower level
device driver is called indirectly through the struct iob,
allowing a file system implementation to serve multiple devices.
write_routine(iop, buffer, count)
The write routine functions similarly to the read routine to accomplish
writes to a file system or via a protocol.
ioctl_routine(iop, command, argument)
The ioctl routine implements any special functions possible on the
file system or protocol. It is passed a struct iob pointer
associated with the descriptor being operated on,
a
indicating the operation to perform, and
an
that is specific to the command.
close_routine(iop)
The close routine is passed a pointer to a struct iob associated
with the descriptor being closed. The close routine performs any
clean-up activities necessary with terminating access to the descriptor.
intro(4spp)