src/stored/vol_mgr.c
void free_volume_lists()
{
   VOLRES *vol;

   free_volume_list();           /* normal append list */

   if (read_vol_list) {
      lock_read_volumes();
      foreach_dlist(vol, read_vol_list) {
         if (vol->dev) {
            Dmsg2(dbglvl, "free read_vol_list Volume=%s dev=%s\n", vol->vol_name, vol->dev->print_name());
         } else {
            Dmsg1(dbglvl, "free read_vol_list Volume=%s No dev\n", vol->vol_name);
         }
         free(vol->vol_name);
         vol->vol_name = NULL;
         vol->destroy_mutex();
      }
      delete read_vol_list;
      read_vol_list = NULL;
      unlock_read_volumes();
   }
}
/* Release all Volumes from the list */
Release all Volumes from the list
Release all Volumes from the list
void free_volume_lists()
{
   VOLRES *vol;
   free_volume_list();           
   if (read_vol_list) {
      lock_read_volumes();
      foreach_dlist(vol, read_vol_list) {
         if (vol->dev) {
            Dmsg2(dbglvl, "free read_vol_list Volume=%s dev=%s\n", vol->vol_name, vol->dev->print_name());
         } else {
            Dmsg1(dbglvl, "free read_vol_list Volume=%s No dev\n", vol->vol_name);
         }
         free(vol->vol_name);
         vol->vol_name = NULL;
         vol->destroy_mutex();
      }
      delete read_vol_list;
      read_vol_list = NULL;
      unlock_read_volumes();
   }
}
void free_volume_lists ( ) { VOLRES * vol ; free_volume_list ( ) ; if ( read_vol_list ) { lock_read_volumes ( ) ; foreach_dlist ( vol , read_vol_list ) { if ( vol -> dev ) { Dmsg2 ( dbglvl , " \n " , vol -> vol_name , vol -> dev -> print_name ( ) ) ; } else { Dmsg1 ( dbglvl , " \n " , vol -> vol_name ) ; } free ( vol -> vol_name ) ; vol -> vol_name = NULL ; vol -> destroy_mutex ( ) ; } delete read_vol_list ; read_vol_list = NULL ; unlock_read_volumes ( ) ; } }
Release all Volumes from the list
Release all Volumes from the list
/* normal append list */