Filesystem specific parameter is described by struct user_parameter
defined in fslib.h
. Each parameter has its ID (it needn't be
unique across different filesystem types), user readable name, type of
contained value (INTERVAL, BOOLEAN, STRING, DISCRETE_STRING, and
DISCRETE_NUMBER), type flags (see fslib.h
for details), and value.
See fslib.h
for definition of each type.
For discrete parameters (UPT_DISCRETE_STRING and UPT_DISCRETE_NUMBER)
the pointers to arrays of possible parameter values are set to the same
array for all the parameters of the same type, e.g. for parameters for
the same type of the same filesystem. Thus it is sufficient (and only
possible without resulting in error) to deallocate only arrays in record
rs_fspars
.
The library allows to specify filesystem specific parameters for newly
created filesystems. Function get_resources()
provides information
about current filesystems. Function commit_disks
expects parameters
for partitions to create - if ommited their values will be set to their
defaults.
There are three places where parameters structure (struct
user_parameter
) are found. Each of them is listed below:
struct resources.rs_pars
- Global parameters describing the whole
operation process. These parameters are not specific to any of the
filesystems. These parameters may include maximum buffer memory to use
by data modification algorithms etc. In `val' fields are supplied the
default values on library->client.
struct resources.rs_fspars -> fp_pars
or struct fs_pars
-> fp_pars
- Parameters related to the filesystem where specified.
In `val' field are supplied the default values used for new filesystem
of desired type (such as `Cluster size'). Client creating new
filesystem will copy this structure to the partition-bound filesystem
being initialized and adjusts the values according to its (Client's)
needs.
struct resources.rs_disks -> di_up -> up_up
or struct
disk_info -> di_up -> up_up
or struct user_partition ->
up_up
- Parameters for the existing filesystem. `val' fields contain
the CURRENT values if they are reflected in physical filesystem
structure, otherwise (like resize safety level) they are set to their
default values. Changing of `val' field of the former case results in
filesystem restructuralization (like `reblocking').
Any of filesystem specific parameter can be unset; in that case the
parameter will be set by the library to its default (its value will not
be returned when function called just for checking). The structure of
UPT_DISCRETE_STRING and UPT_DISCRETE_NUMBER type parameter should
contain pointers to the arrays of their possible values (it is not
necessary and even not recommended to copy values from the arrays
returned by function get_resources to any newly allocated memory
location; it is enough to use pointers to arrays in structures returned
by function get_resources
).