bareos: master 87b270ad

Author Committer Branch Timestamp Parent
mvwieringen mvwieringen master 2016-05-21 13:38 master f412c015 Pending
Changeset dird: Add support for caching vol_lists.

This patch adds support for caching the returned vol_list from
get_vol_list_from_storage(). We allocate a so called
runtime_storage_status_t (rss) in the STORERES which has all runtime values.
The vol_list is now also returned as a new type called changer_vol_list_t
which has the old dlist, a timestamp with the unix time this data was
retrieved and a reference count. The cached vol_list is valid for
CacheStatusInterval seconds (30) defined in the config of the storage.
The runtime_storage_status_t also contains a mutex that is used for exclusive
access to the autochanger so we never try to perform multiple operations at
the same time but always serialize those. As there are full and partial
volume_lists we keep the type also in the changer_vol_list_t so we only
return the right type depending on the listall flag of
get_vol_list_from_storage().

Now that we cache the vol_lists we should also not remove entries from it
anymore as the list is no longer a trow away list.

This patch also introduces a new set of types e.g. drive_number_t for
drives, slot_number_t for slots.
mod - src/dird/dird.h Diff File
mod - src/dird/dird_conf.c Diff File
mod - src/dird/dird_conf.h Diff File
mod - src/dird/jobq.c Diff File
mod - src/dird/protos.h Diff File
mod - src/dird/sd_cmds.c Diff File
mod - src/dird/storage.c Diff File
mod - src/dird/ua_cmds.c Diff File
mod - src/dird/ua_impexp.c Diff File
mod - src/dird/ua_label.c Diff File
mod - src/dird/ua_purge.c Diff File
mod - src/dird/ua_select.c Diff File
mod - src/dird/ua_status.c Diff File
mod - src/dird/ua_update.c Diff File
mod - src/include/baconfig.h Diff File