ok = find_recycled_volume(jcr, InChanger, mr);
Dmsg2(100, "find_recycled_volume %d FW=%d\n", ok, mr->FirstWritten);
if (!ok) {
- /*
- * 3. Try pruning Volumes
+ /*
+ * 3. Try recycling any purged volume
*/
- prune_volumes(jcr);
ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
- if (InChanger) {
- InChanger = false;
- if (!ok) {
- continue; /* retry again accepting any volume */
- }
- }
- Dmsg2(200, "find_recycled_volume2 %d FW=%d\n", ok, mr->FirstWritten);
- if (!ok && create) {
+ if (!ok) {
/*
- * 4. Try "creating" a new Volume
+ * 4. Try pruning Volumes
*/
- ok = newVolume(jcr, mr);
+ prune_volumes(jcr);
+ ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
+ if (InChanger) {
+ InChanger = false;
+ if (!ok) {
+ continue; /* retry again accepting any volume */
+ }
+ }
+ Dmsg2(200, "find_recycled_volume2 %d FW=%d\n", ok, mr->FirstWritten);
+ if (!ok && create) {
+ /*
+ * 5. Try "creating" a new Volume
+ */
+ ok = newVolume(jcr, mr);
+ }
}
}
* Returns: on failure - reason = NULL
* on success - reason - pointer to reason
*/
-void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, char **reason)
+void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **reason)
{
int ok;