src/stored/vol_mgr.c
static VOLRES *find_read_volume(const char *VolumeName)
{
   VOLRES vol, *fvol;

   if (read_vol_list->empty()) {
      Dmsg0(dbglvl, "find_read_vol: read_vol_list empty.\n");
      return NULL;
   }
   /* Do not lock reservations here */
   lock_read_volumes();
   vol.vol_name = bstrdup(VolumeName);
   /* Note, we do want a simple name_compare on volume name only here */
   fvol = (VOLRES *)read_vol_list->binary_search(&vol, name_compare);
   free(vol.vol_name);
   Dmsg2(dbglvl, "find_read_vol=%s found=%d\n", VolumeName, fvol!=NULL);
   unlock_read_volumes();
   return fvol;
}
/*
 * Search for a Volume name in the read Volume list.
 *
 *  Returns: VOLRES entry on success
 *           NULL if the Volume is not in the list
 */
Search for a Volume name in the read Volume list.
Returns: VOLRES entry on success
NULL if the Volume is not in the list
Search for a Volume name in the read Volume list . Returns : VOLRES entry on success NULL if the Volume is not in the list
static VOLRES *find_read_volume(const char *VolumeName)
{
   VOLRES vol, *fvol;
   if (read_vol_list->empty()) {
      Dmsg0(dbglvl, "find_read_vol: read_vol_list empty.\n");
      return NULL;
   }
   lock_read_volumes();
   vol.vol_name = bstrdup(VolumeName);
   fvol = (VOLRES *)read_vol_list->binary_search(&vol, name_compare);
   free(vol.vol_name);
   Dmsg2(dbglvl, "find_read_vol=%s found=%d\n", VolumeName, fvol!=NULL);
   unlock_read_volumes();
   return fvol;
}
static VOLRES * find_read_volume ( const char * VolumeName ) { VOLRES vol , * fvol ; if ( read_vol_list -> empty ( ) ) { Dmsg0 ( dbglvl , " \n " ) ; return NULL ; } lock_read_volumes ( ) ; vol . vol_name = bstrdup ( VolumeName ) ; fvol = ( VOLRES * ) read_vol_list -> binary_search ( & vol , name_compare ) ; free ( vol . vol_name ) ; Dmsg2 ( dbglvl , " \n " , VolumeName , fvol != NULL ) ; unlock_read_volumes ( ) ; return fvol ; }
Search for a Volume name in the read Volume list.
Search for a Volume name in the read Volume list .
/* Do not lock reservations here */ /* Note, we do want a simple name_compare on volume name only here */