ReiserFS is based on fast balanced trees (B+Tree) to organise file
system objects. File systems objects are the structures used to maintain
file information: access time, file permissions, etc. In other words,
the information contained within an i-node, directories and the files'
data. ReiserFS calls those objects, stat data items, directory
items and direct/indirect items, respectively. ReiserFS only
provides metadata journaling. In case of a non-planned reboot, data
in blocks that were being used at the time of the crash could have
been corrupted; thus ReiserFS does not guarantee the file contents
themselves are uncorrupted.
Unformatted nodes are logical blocks with no given format,
used to store file data, and the direct items consist of file
data itself. Also, those items are of variable size and stored within
the leaf nodes of the tree, sometimes with others in case there is
enough space within the node. File information is stored close to
file data, since the file system always tries to put stat data items
and the direct/indirect items of the same file together. Opposed to
direct items, the file data pointed by indirect items is not stored
within the tree. This special management of direct items is due to
small file support: tail packing.
Tail packing is a special ReiserFS feature. Tails are files
that are smaller than a logical block, or the trailing portions of
files that do not fill up a complete block. To save disk space, ReiserFS
uses tail packing to hold tails into as small a space as possible.
Generally, this allows a ReiserFS to hold around 5% more than an
equivalent Ext2 file system. The direct items are intended to keep
small file data and even the tails of the files. Therefore, several
tails could be kept within the same leaf node.
ReiserFS has an excellent small-file performance because it is able
to incorporate these tails into its B-Tree so that they are really
close to the stat data. Since tails do not fill up a complete
block, they can waste disk space.
The problem is that using this technique of keeping the file's tails
together would increase external fragmentation, since the file data
is now further from the file tail. Moreover, the task of packing tails
is time-consuming and leads to performance penalties. This is a consequence
of the memory shifts needed when someone appends data to a file. Namesys
realised this problem and allows system administrator to disable the
tail packing by specifying the notail option at the time
the file system is mounted or event remounted.
ReiserFS uses fixed size block (4KB) oriented allocation
that affects negatively to the performance of I/O operations of large
files. The other weakness of ReiserFS is that the sparse file performance
is significantly worse compared to ext2, although Namesys is working
on optimising this case.
Figure:
Block based allocation
|
|
|