is a driver level implementation of the Inferno log structured
filesystem, a file system designed with modern flash devices
(such as NAND flash) in mind.
is itself hardware independent, requiring other
devices to provide the physical medium. Currently only
devices are supported.
The file system maintains two storage regions on the same medium:
a log-structured hierarchical file system that implements all the
functionality communicable by the 9P protocol
and a boot
partition that offers a fixed amount of flat storage suitable for
holding such things as a kernel boot image, boot parameters etc. The
boot partition can be accessed and updated without understanding all
but the simplest facts about the hierarchical file system, making it
easy to implement boot loaders with small footprints.
The physical layout of the file system varies from medium to medium,
so that the specialised features of the medium can be accounted for.
The user table is maintained in memory; there is one table, shared between
all file systems supported by this driver. There is no distinction between
users and groups: a user is a group with one member.
The user table records a mapping
as well as recording the leader and members of each group. A
is a string naming a user or group that is stored in the file system. A
is the string naming a user or group that is used in
file system protocol messages (see
There is a distinction so that
can be safely reused, even though
Configuration and control of the file systems is by writing commands to
- fsys name
- Sets the current file system to
which must be configured. Subsequent commands, not prefixed with
will by applied to the name file system.
- [fsys name] config flash-device
- Configures file system
to be written to
This does not initialise or format the filesystem, but simply bind
For each configured
two files appear in the device name space,
The former serves the 9P protocol giving access to the hierarchical file system;
the latter is a fixed size file that represents the boot partition.
- [fsys name] format bootsize
- Formats the underlying medium as a
format file system. Sufficent storage is set aside to create a boot partition of at
bytes. Some medium implementations (eg, for NAND flash) store file system
parameters (eg, location, size and boot partition size) to enable automatic
location of file systems and improve bad block detection. These must
be part of the boot partition so that they are easily accessible to boot loaders,
so such medium implementations may also enforce a minimum size for the
- [fsys name] open [-P] [-W]
- Initialises the specified file system, and makes it available for use. The file
system structure is verified, bad blocks are repaired and, in the case of the
log structured file system, and the log replayed to regenerate the directory structure.
option reduces the permission control on
requests. Specifically it allows the
to be changed by anyone.
option removes all file access controls, allowing anyone to open any file in
- [fsys name] sweep
- Forces the log to be swept, if it has been written to since last being swept.
The log is normally swept automatically when space is low.
- [fsys name] sync
- Flush any buffered log or data to the underlying device.
Use before shutting down the system if the device is not unmounted.
(See notes below.)
- [fsys name] trace [level]
is non-zero, internal diagnostics for the log file system are enabled at the
given level. If
is zero, or missing, tracing is disabled.
- [fsys name] unconfig
- removes the configuration. The file system must not be mounted, or the
boot partition open, before doing this.
- uname uname uid
- uname uname :uid
- adds the user with uname
to the in-memory table
- uname uname %newname
throughout the user table
- uname uname =leader
- sets the group leader to the uname
- uname uname =
- removes the group leader; then all members are leaders
- uname uname +member
- add the uname
to the group
- uname uname -member
- removes the uname
from the group
The file system log may be subject to a small amount of buffering for efficiency
purposes; therefore, it is necessary to unmount the file system before disconnecting
the power to avoid losing recent updates. Failure to do this does not result in
inconsistencies in the file system, but some recent changes will be lost.
of any file or directory, with all fields set to
(also known as a
will cause the log to be written to disk. Note that during a dismount, and also a
is also applied to the underlying
device. Furthermore, since some buffering is used on the log,
needless use of
will consume log space more rapidly than normal, although it will be recovered during
the next sweep.
The log is automatically swept when space is low, so there is not normally any
need to use the