Next Previous Contents

3.3 Data structures used for data location

The data structures described in this section are data structures used to describe relation between data (i.e. files) in the actual partition and newly created partitions. The whole system is designed in a very complex way to be extendable to support future features (e.g. splitting, joining and even more sofisticated actions with partitions).

The data in the filesystem of undetected (or not yet detected) type are (and can be) represented only by the structure corresponding to its root directory. The record up_dircount is set to the number of different directories from which files should be moved to the partition. These directories are listed in the record up_dirs; if up_dircount is set to zero (only empty filesystem should be created) then up_dirs should be set to NULL. The root directory (ud_name set to NULL) represents all the files contained in the whole partition, the root subdirectories represents corresponding filesystem subtrees. The root directory itself (all non-directory entries of the root, typically only files) is described by an empty string `'.

The record ud_part identifies (uniquely) the partition contaning the specified directory - the program using the library should not change this number, although there are defined macros MK_PART_ID, DISK_PART_ID and PART_PART_ID for converting part_id_t type to identification of disks and partitions. The disks and partitions are numbered from 1 in the order returned by function get_resources; for each of disks are partitions numbered from 0 (i.e. numbers of partitions are not unique in the system). The numbering of disks and partitions is not in any relation to naming linux devices. The directories are numbered from 0 but more than one (root) directory is not implemented yet.


Next Previous Contents