pass3.c (4c723140a407d2ba326c134a26cec9569dc52d46) pass3.c (af6726e657c0b1148075650d763ee80f9d863dbf)
1/*
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 if (got_sigalarm) {
65 setproctitle("%s p3 %d%%", cdevname,
66 (int)((inplast - inpindex - 1) * 100 / inplast));
67 got_sigalarm = 0;
68 }
69 inp = inpsort[inpindex];
70 state = inoinfo(inp->i_number)->ino_state;
71 if (inp->i_number == ROOTINO ||
1/*
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 if (got_sigalarm) {
65 setproctitle("%s p3 %d%%", cdevname,
66 (int)((inplast - inpindex - 1) * 100 / inplast));
67 got_sigalarm = 0;
68 }
69 inp = inpsort[inpindex];
70 state = inoinfo(inp->i_number)->ino_state;
71 if (inp->i_number == ROOTINO ||
72 (inp->i_parent != 0 && state != DSTATE))
72 (inp->i_parent != 0 && !S_IS_DUNFOUND(state)))
73 continue;
74 if (state == DCLEAR)
75 continue;
76 /*
77 * If we are running with soft updates and we come
78 * across unreferenced directories, we just leave
79 * them in DSTATE which will cause them to be pitched
80 * in pass 4.
81 */
82 if ((preen || bkgrdflag) &&
73 continue;
74 if (state == DCLEAR)
75 continue;
76 /*
77 * If we are running with soft updates and we come
78 * across unreferenced directories, we just leave
79 * them in DSTATE which will cause them to be pitched
80 * in pass 4.
81 */
82 if ((preen || bkgrdflag) &&
83 resolved && usedsoftdep && state == DSTATE) {
83 resolved && usedsoftdep && S_IS_DUNFOUND(state)) {
84 if (inp->i_dotdot >= ROOTINO)
85 inoinfo(inp->i_dotdot)->ino_linkcnt++;
86 continue;
87 }
88 for (loopcnt = 0; ; loopcnt++) {
89 orphan = inp->i_number;
90 if (inp->i_parent == 0 ||
84 if (inp->i_dotdot >= ROOTINO)
85 inoinfo(inp->i_dotdot)->ino_linkcnt++;
86 continue;
87 }
88 for (loopcnt = 0; ; loopcnt++) {
89 orphan = inp->i_number;
90 if (inp->i_parent == 0 ||
91 inoinfo(inp->i_parent)->ino_state != DSTATE ||
91 !INO_IS_DUNFOUND(inp->i_parent) ||
92 loopcnt > countdirs)
93 break;
94 inp = getinoinfo(inp->i_parent);
95 }
96 if (loopcnt <= countdirs) {
97 if (linkup(orphan, inp->i_dotdot, NULL)) {
98 inp->i_parent = inp->i_dotdot = lfdir;
99 inoinfo(lfdir)->ino_linkcnt--;

--- 28 unchanged lines hidden ---
92 loopcnt > countdirs)
93 break;
94 inp = getinoinfo(inp->i_parent);
95 }
96 if (loopcnt <= countdirs) {
97 if (linkup(orphan, inp->i_dotdot, NULL)) {
98 inp->i_parent = inp->i_dotdot = lfdir;
99 inoinfo(lfdir)->ino_linkcnt--;

--- 28 unchanged lines hidden ---