]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/testing/next_vol.patch
Fix link rules
[bacula/bacula] / bacula / patches / testing / next_vol.patch
1 Index: src/dird/next_vol.c
2 ===================================================================
3 --- src/dird/next_vol.c (revision 7929)
4 +++ src/dird/next_vol.c (working copy)
5 @@ -94,33 +94,31 @@
6                  */
7                 if (prune) {
8                    Dmsg0(150, "Call prune_volumes\n");
9 -                  ok = prune_volumes(jcr, InChanger, mr);
10 +                  prune_volumes(jcr, InChanger, mr);
11                 }
12 -              if (!ok) {
13 -                 ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
14 -                 if (!ok && create) {
15 -                    Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
16 -                          ok, index, InChanger, mr->VolStatus);
17 -                    /*
18 -                     * 5. Try pulling a volume from the Scratch pool
19 -                     */ 
20 -                    ok = get_scratch_volume(jcr, InChanger, mr);
21 -                    Dmsg4(050, "after get scratch volume ok=%d index=%d InChanger=%d Vstat=%s\n",
22 -                          ok, index, InChanger, mr->VolStatus);
23 -                 }
24 -                 /*
25 -                  * If we are using an Autochanger and have not found
26 -                  * a volume, retry looking for any volume. 
27 -                  */
28 -                 if (!ok && InChanger) {
29 -                    InChanger = false;
30 -                    continue;           /* retry again accepting any volume */
31 -                 }
32 -              }
33 +
34 +               ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
35 +               if (!ok && create) {
36 +                  Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
37 +                        ok, index, InChanger, mr->VolStatus);
38 +                  /*
39 +                   * 5. Try pulling a volume from the Scratch pool
40 +                   */ 
41 +                  ok = get_scratch_volume(jcr, InChanger, mr);
42 +                  Dmsg4(050, "after get scratch volume ok=%d index=%d InChanger=%d Vstat=%s\n",
43 +                        ok, index, InChanger, mr->VolStatus);
44 +               }
45 +               /*
46 +                * If we are using an Autochanger and have not found
47 +                * a volume, retry looking for any volume. 
48 +                */
49 +               if (!ok && InChanger) {
50 +                  InChanger = false;
51 +                  continue;           /* retry again accepting any volume */
52 +               }
53             }
54           }
55  
56 -
57           if (!ok && create) {
58              /*
59               * 6. Try "creating" a new Volume
60 Index: src/dird/autoprune.c
61 ===================================================================
62 --- src/dird/autoprune.c        (revision 7929)
63 +++ src/dird/autoprune.c        (working copy)
64 @@ -196,6 +196,13 @@
65           }
66  
67           /*
68 +          * Continue if this volume is not usable
69 +          */
70 +         if (ok && !lmr.Recycle) {
71 +            ok = false;
72 +         }
73 +
74 +         /*
75            * If purged and not moved to another Pool, 
76            *   then we stop pruning and take this volume.
77            */