Function int get_resources(struct resources *res,ERR_PARAM)
takes pointer to the allocated structure struct resources and
fills it in with information about hard disks in the computer and
their partition structure. The function processes in several steps:
rs_parcount and rs_pars.
rs_fstypes and rs_fspars.
exist. The detection
of presence of drives is done by calling function
int try_device(char *devicename). This function returns
one if the device named devicename is present in the computer and
zero otherwise.
rs_diskcount is filled and memory for rs_disks is allocated.
int fill_disk(char *devicename,struct disk_info *diskinfo,struct fs_pars *filesystems,ERR_PARAM) is called to obtain information about all detected drives.
di_disk and ud_part)
of disks, partitions and directories are filled.
The function int fill_disk(char *devicename,struct disk_info *diskinfo,struct fs_pars *filesystems,ERR_PARAM) obtains information about
partition structure on device named devicename and fills in
structure diskinfo using filesystem parameters stored
in filesystem. The function processes in several steps:
devicename is detected and
filled in structure diskinfo.
diskinfo
in di_parcount and di_pars.
read_partition of
Partitioner module is called.
This function fills in structure diskinfo information
about partition structure of the device.
fc_identify is called for each found partition
on the device and for all known filesystems. If any of filesystems
is detected, its function fc_getparams is called and this function
fills in the filesystem parameters. If any of the filesystem is
successfully detected the detection process is aborted and
the functions fc_identify of other filesystems are not called.
The filesystems are detected in decreasing order as they are stored
in array regfs. The last filesystem (regfs[0]) should
be `unknown filesystem' which detection is always positive.