src/stored/match_bsr.c
BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev)
{
   BSR *bsr;
   BSR *found_bsr = NULL;

   /* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */
   if (!root_bsr) {
      Dmsg0(dbglevel, "NULL root bsr pointer passed to find_next_bsr.\n");
      return NULL;
   }
   if (!root_bsr->use_positioning ||
       !root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) {
      Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
      return NULL;
   }
   Dmsg2(dbglevel, "use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
   root_bsr->mount_next_volume = false;
   /* Walk through all bsrs to find the next one to use => smallest file,block */
   for (bsr=root_bsr; bsr; bsr=bsr->next) {
      if (bsr->done || !match_volume(bsr, bsr->volume, &dev->VolHdr, 1)) {
         continue;
      }
      if (found_bsr == NULL) {
         found_bsr = bsr;
      } else {
         found_bsr = find_smallest_volfile(found_bsr, bsr);
      }
   }
   /*
    * If we get to this point and found no bsr, it means
    *  that any additional bsr's must apply to the next
    *  tape, so set a flag.
    */
   if (found_bsr == NULL) {
      root_bsr->mount_next_volume = true;
   }
   return found_bsr;
}
/*
 * Find the next bsr that applies to the current tape.
 *   It is the one with the smallest VolFile position.
 */
Find the next bsr that applies to the current tape.
It is the one with the smallest VolFile position.
Find the next bsr that applies to the current tape . It is the one with the smallest VolFile position .
BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev)
{
   BSR *bsr;
   BSR *found_bsr = NULL;
   if (!root_bsr) {
      Dmsg0(dbglevel, "NULL root bsr pointer passed to find_next_bsr.\n");
      return NULL;
   }
   if (!root_bsr->use_positioning ||
       !root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) {
      Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
      return NULL;
   }
   Dmsg2(dbglevel, "use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
   root_bsr->mount_next_volume = false;
   for (bsr=root_bsr; bsr; bsr=bsr->next) {
      if (bsr->done || !match_volume(bsr, bsr->volume, &dev->VolHdr, 1)) {
         continue;
      }
      if (found_bsr == NULL) {
         found_bsr = bsr;
      } else {
         found_bsr = find_smallest_volfile(found_bsr, bsr);
      }
   }
   if (found_bsr == NULL) {
      root_bsr->mount_next_volume = true;
   }
   return found_bsr;
}
BSR * find_next_bsr ( BSR * root_bsr , DEVICE * dev ) { BSR * bsr ; BSR * found_bsr = NULL ; if ( ! root_bsr ) { Dmsg0 ( dbglevel , " \n " ) ; return NULL ; } if ( ! root_bsr -> use_positioning || ! root_bsr -> reposition || ! dev -> has_cap ( CAP_POSITIONBLOCKS ) ) { Dmsg2 ( dbglevel , " \n " , root_bsr -> use_positioning , root_bsr -> reposition ) ; return NULL ; } Dmsg2 ( dbglevel , " \n " , root_bsr -> use_positioning , root_bsr -> reposition ) ; root_bsr -> mount_next_volume = false ; for ( bsr = root_bsr ; bsr ; bsr = bsr -> next ) { if ( bsr -> done || ! match_volume ( bsr , bsr -> volume , & dev -> VolHdr , 1 ) ) { continue ; } if ( found_bsr == NULL ) { found_bsr = bsr ; } else { found_bsr = find_smallest_volfile ( found_bsr , bsr ) ; } } if ( found_bsr == NULL ) { root_bsr -> mount_next_volume = true ; } return found_bsr ; }
Find the next bsr that applies to the current tape.
Find the next bsr that applies to the current tape .
/* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */ /* Walk through all bsrs to find the next one to use => smallest file,block */ /*
    * If we get to this point and found no bsr, it means
    *  that any additional bsr's must apply to the next
    *  tape, so set a flag.
    */