2 ===================================================================
3 --- match_bsr.c (révision 8116)
4 +++ match_bsr.c (copie de travail)
6 BSR *return_bsr = found_bsr;
9 - uint32_t found_bsr_sfile, bsr_sfile;
10 - uint32_t found_bsr_sblock, bsr_sblock;
11 + uint32_t found_bsr_sfile=0, bsr_sfile=0;
12 + uint32_t found_bsr_sblock=0, bsr_sblock=0;
14 /* Find the smallest file in the found_bsr */
15 - vf = found_bsr->volfile;
16 - found_bsr_sfile = vf->sfile;
17 - while ( (vf=vf->next) ) {
18 - if (vf->sfile < found_bsr_sfile) {
19 - found_bsr_sfile = vf->sfile;
21 + for (vf = found_bsr->volfile; vf ; vf = vf->next) {
24 + found_bsr_sfile = MIN(found_bsr_sfile, vf->sfile);
26 + found_bsr_sfile = vf->sfile;
32 - /* Find the smallest file in the bsr */
34 - bsr_sfile = vf->sfile;
35 - while ( (vf=vf->next) ) {
36 - if (vf->sfile < bsr_sfile) {
37 - bsr_sfile = vf->sfile;
38 + if (!ok) { /* No unused volfile in found_bsr */
42 + /* Find the smallest file in the found_bsr */
44 + for (vf = bsr->volfile; vf ; vf = vf->next) {
47 + bsr_sfile = MIN(bsr_sfile, vf->sfile);
49 + bsr_sfile = vf->sfile;
55 + if (!ok) { /* No unused volfile in bsr */
59 /* if the bsr file is less than the found_bsr file, return bsr */
60 if (found_bsr_sfile > bsr_sfile) {
62 } else if (found_bsr_sfile == bsr_sfile) {
64 /* find smallest block in found_bsr */
65 - vb = found_bsr->volblock;
66 - found_bsr_sblock = vb->sblock;
67 - while ( (vb=vb->next) ) {
68 - if (vb->sblock < found_bsr_sblock) {
69 - found_bsr_sblock = vb->sblock;
71 + for (vb = found_bsr->volblock; vb ; vb = vb->next) {
74 + found_bsr_sblock = MIN(found_bsr_sblock, vb->sblock);
76 + found_bsr_sblock = vb->sblock;
81 + ASSERT(ok); /* a file is not done, so we have a bloc... */
83 /* Find smallest block in bsr */
85 - bsr_sblock = vb->sblock;
86 - while ( (vb=vb->next) ) {
87 - if (vb->sblock < bsr_sblock) {
88 - bsr_sblock = vb->sblock;
90 + for (vb = bsr->volblock; vb ; vb = vb->next) {
93 + bsr_sblock = MIN(bsr_sblock, vb->sblock);
95 + bsr_sblock = vb->sblock;
102 /* Compare and return the smallest */
103 if (found_bsr_sblock > bsr_sblock) {
107 + Dmsg5(dbglevel, "find_smallest_volfile bsr=0x%p %i > %i | %i > %i\n", return_bsr, found_bsr_sfile, bsr_sfile, found_bsr_sblock, bsr_sblock);