1
2
3
4
5
6
7
8 accept_rpv:
9 procedure;
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 dcl pvt$n_entries fixed bin external;
42 dcl pvt$root_lvid bit (36) aligned external;
43 dcl pvt$root_pvtx fixed bin external;
44 dcl pvt$rlv_needs_salv bit (1) aligned external;
45 dcl pvt$rpv_needs_salv bit (1) aligned external;
46 dcl pvt$rpvs_requested bit (1) aligned external;
47 dcl salv_data$rpv bit (1) aligned external;
48
49 dcl accept_fs_disk entry (fixed bin, fixed bin (35));
50 dcl config_$find entry (char (4) aligned, ptr);
51 dcl config_$find_parm entry (char (4) aligned, ptr);
52 dcl make_sdw$reset_hcp entry;
53 dcl read_disk entry (fixed bin, fixed bin, ptr, fixed bin (35));
54 dcl salvager$volume_salvage entry (fixed bin, bit (36) aligned, fixed bin (35));
55 dcl (syserr, syserr$error_code) entry options (variable);
56 dcl wired_shutdown$enable entry;
57
58 dcl all_root_vols_accepted bit (1);
59 dcl code fixed bin (35);
60 dcl i fixed bin;
61 dcl pvtx fixed bin;
62 dcl severity fixed bin;
63 dcl n_hc_volmap_pages fixed bin;
64 dcl salv_rlv_request bit (1);
65 dcl 1 buffer aligned like label;
66
67 dcl (addr, hbound, null, string) builtin;
68 %page;
69 labelp = addr (buffer);
70 pvt_arrayp = addr (pvt$array);
71
72 call config_$find_parm ("hcpt", intk_cardp);
73 if intk_cardp = null ()
74 then severity = LOG;
75 else severity = ANNOUNCE;
76
77
78
79 do pvtx = 1 to pvt$n_entries;
80 pvtep = addr (pvt_array (pvtx));
81 if pvte.hc_part_used & ^pvte.rpv then do;
82 call read_disk (pvtx, LABEL_ADDR, labelp, code);
83 if code ^= 0
84 then call syserr$error_code (CRASH, code, "accept_rpv: Cannot read label of ^a.", name (pvte));
85
86 if label.lvid ^= pvt$root_lvid
87 then call syserr (CRASH, "accept_rpv: pv ^a lv ^a (^a) is not part of root.", label.pv_name,
88 label.lv_name, name (pvte));
89 end;
90 end;
91
92
93
94 pvt$rpvs_requested = "0"b;
95 salv_rlv_request = "0"b;
96 intk_cardp = null ();
97 call config_$find ("intk", intk_cardp);
98 if intk_cardp ^= null ()
99 then do i = 1 to hbound (intk_card.parms, 1);
100 if intk_card.parms (i) = "rpvs" then do;
101 intk_card.parms (i) = "";
102 pvt$rpvs_requested = "1"b;
103 end;
104 else if intk_card.parms (i) = "rlvs" then do;
105 intk_card.parms (i) = "";
106 pvt$rpvs_requested = "1"b;
107 salv_rlv_request = "1"b;
108 end;
109 end;
110
111 pvtx = pvt$root_pvtx;
112 pvtep = addr (pvt_array (pvtx));
113
114 salv_data$rpv = "1"b;
115
116 if pvt$rpv_needs_salv | pvt$rpvs_requested
117 then pvt$rlv_needs_salv = "1"b;
118
119 if pvt$rpvs_requested
120 then call salvager$volume_salvage (pvtx, ""b, code);
121
122 do pvtx = 1 to pvt$n_entries;
123 pvtep = addr (pvt_array (pvtx));
124 if pvte.hc_part_used
125 then do;
126 n_hc_volmap_pages = pvte.volmap_stock_ptr -> record_stock.n_volmap_pages;
127 call syserr (severity, "accept_rpv: HC part on ^a used ^d out of ^d records.", name (pvte),
128 (pvte.totrec - pvte.nleft + n_hc_volmap_pages), pvte.totrec + n_hc_volmap_pages);
129 end;
130 end;
131
132 call accept_fs_disk (pvt$root_pvtx, code);
133 if code ^= 0 then call syserr$error_code (CRASH, code, "accept_rpv: Error accepting RPV");
134
135 call wired_shutdown$enable;
136
137 fgbxp = addr (flagbox$);
138 fgbx.ssenb = "1"b;
139
140
141
142
143 call make_sdw$reset_hcp;
144
145 do i = 1 to pvt$n_entries;
146 pvtep = addr (pvt_array (i));
147 pvte.brother_pvtx = 0;
148 end;
149
150
151
152 all_root_vols_accepted = "1"b;
153 do pvtx = 1 to pvt$n_entries;
154 pvtep = addr (pvt_array (pvtx));
155 if pvte.root_lv & ^pvte.rpv then do;
156 if salv_rlv_request
157 then call salvager$volume_salvage (pvtx, ""b, code);
158 call accept_fs_disk (pvtx, code);
159 if code ^= 0 then all_root_vols_accepted = "0"b;
160
161 end;
162 end;
163
164 salv_data$rpv = "0"b;
165
166 if all_root_vols_accepted then pvt$rpvs_requested = "0"b;
167
168 return;
169
170
171
172 name:
173 procedure (Pvte) returns (char (8) aligned);
174
175 dcl 1 Pvte aligned like pvte parameter;
176 dcl 1 dname aligned,
177 2 dev char (4) unaligned,
178 2 u char (1) unaligned,
179 2 num pic "99" unaligned,
180 2 sv char (1) unaligned;
181
182
183 dname.dev = Pvte.devname;
184 dname.u = "_";
185 dname.num = Pvte.logical_area_number;
186 if Pvte.is_sv then dname.sv = valid_sv_array (Pvte.sv_num);
187 else dname.sv = "";
188 return (string (dname));
189 end name;
190 %page;
191 %include disk_pack;
192 %include flagbox;
193 %include fs_vol_label;
194 %include fs_dev_types;
195 %include config_intk_card;
196 %include pvte;
197 %include stock_seg;
198 %include syserr_constants;
199 %page;
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 note
231
232
233 XXX
234
235
236
237
238
239
240
241
242 XXX
243
244
245
246
247
248 end accept_rpv;