1
2
3
4
5
6
7
8
9
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 note
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 update_vtoce: procedure (a_astep);
92 dsw = "0"b;
93 go to join;
94
95 deact: entry (a_astep, a_code);
96 dsw = "1"b;
97 join:
98
99 dcl a_astep ptr;
100
101
102 dcl 1 local_vtoce like vtoce aligned;
103 dcl 1 local_aste like aste aligned;
104
105 dcl (pvtx, vtocx) fixed bin (17);
106 dcl dsw bit (1);
107 dcl code fixed bin (35);
108 dcl a_code fixed bin (35);
109 dcl (n, i, pts, max) fixed bin (17);
110 dcl deposit_list (0:255) bit (22) aligned;
111 dcl pageno_list (0:255) fixed bin aligned;
112 dcl 1 saved_fm aligned,
113 2 fm (0:255) bit (18) unaligned;
114
115 dcl curtime bit (36) aligned;
116 dcl dt fixed bin (35);
117 dcl read_vtoce bit (1) aligned;
118 dcl parts_write bit (3);
119
120 dcl ALL_PARTS bit (3) int static options (constant) init ("111"b);
121 dcl PART_ONE bit (3) int static options (constant) init ("100"b);
122
123 dcl vtoc_man$get_vtoce entry (bit (36) aligned, fixed bin, fixed bin, bit (3), ptr, fixed bin (35));
124 dcl vtoc_man$put_vtoce entry (bit (36) aligned, fixed bin, fixed bin, bit (3), ptr, fixed bin (35));
125 dcl vtoc_man$await_vtoce entry (bit (36) aligned, fixed bin, fixed bin, fixed bin (35));
126 dcl pc$get_file_map entry (ptr, ptr, ptr, fixed bin, ptr, ptr);
127 dcl pc$deposit_list entry (fixed bin, fixed bin, ptr, fixed bin, ptr);
128 dcl filemap_checksum_ entry (ptr, fixed bin, bit (36) aligned);
129
130 dcl (addr, bin, bit, clock, fixed, unspec) builtin;
131
132 dcl sst$checksum_filemap fixed bin (35) external;
133 dcl sst$pts (0:3) fixed bin (35) external static;
134
135 dcl error_table_$hardcore_sdw fixed bin (35) external;
136
137
138
139
140
141 ^L
142
143
144 n = 0;
145 astep = a_astep;
146 if aste.hc_sdw then do;
147 if dsw then a_code = error_table_$hardcore_sdw;
148 return;
149 end;
150 vtocep = addr (local_vtoce);
151 pvtx = fixed (aste.pvtx); if pvtx <= 0 then return;
152 vtocx = aste.vtocx;
153 pts = sst$pts (fixed (aste.ptsi));
154
155 read_vtoce = "0"b;
156
157
158
159 if aste.dirsw & (aste.tqsw (0) | aste.tqsw (1))
160 then read_vtoce = "1"b;
161 if pts > 96 & aste.fmchanged
162 then read_vtoce = "1"b;
163
164 if read_vtoce then do;
165 call vtoc_man$get_vtoce ("0"b, pvtx, vtocx, ALL_PARTS, vtocep, code);
166 if code ^= 0 then go to serious_problem;
167 end;
168
169
170
171
172 if ^read_vtoce
173 then unspec (vtoce) = ""b;
174
175 call pc$get_file_map (astep, addr (local_aste), addr (vtoce.fm), n, addr (deposit_list), addr (pageno_list));
176 if aste.fm_damaged & (sst$checksum_filemap ^= 0) then n = 0;
177
178 astep = addr (local_aste);
179
180
181
182 if ^read_vtoce & aste.fmchanged & (pts > 96)
183 then do;
184 read_vtoce = "1"b;
185 unspec (saved_fm.fm) = unspec (vtoce.fm);
186 call vtoc_man$get_vtoce ("0"b, pvtx, vtocx, ALL_PARTS, vtocep, code);
187 if code ^= 0 then goto serious_problem;
188 unspec (vtoce.fm) = unspec (saved_fm.fm);
189 end;
190
191
192
193
194
195 curtime = bit (bin (clock (), 52), 52);
196
197 vtoce.uid = aste.uid;
198 vtoce.msl = aste.msl;
199 vtoce.csl = aste.csl;
200 vtoce.records = aste.records;
201
202 vtoce.dtu = aste.dtu;
203 vtoce.dtm = aste.dtm;
204
205 vtoce.nqsw = aste.nqsw;
206 vtoce.deciduous = aste.hc_sdw;
207 vtoce.per_process = aste.per_process;
208 vtoce.damaged = aste.damaged;
209 vtoce.fm_damaged = aste.fm_damaged;
210 vtoce.synchronized = aste.synchronized;
211 vtoce.dnzp = aste.dnzp;
212 vtoce.gtpd = aste.gtpd;
213 vtoce.nid = aste.nid;
214 vtoce.dirsw = aste.dirsw;
215
216
217
218
219 if aste.dirsw then
220 do;
221 vtoce.master_dir = aste.master_dir;
222 do i = 0, 1;
223 vtoce.used (i) = aste.used (i);
224 vtoce.quota (i) = aste.quota (i);
225 if aste.tqsw (i) then
226 do;
227 dt = fixed (curtime, 36) - fixed (vtoce.trp_time (i), 36);
228 vtoce.trp (i) = vtoce.trp (i) + fixed (aste.used (i) * dt * .65536e-1 + .5e0, 71);
229 vtoce.trp_time (i) = curtime;
230 end;
231 end;
232 end;
233 else seg_vtoce.usage = seg_aste.usage;
234
235
236
237
238 if read_vtoce then do;
239 parts_write = ALL_PARTS;
240 max = 255;
241 end;
242 else do;
243 parts_write = PART_ONE;
244 max = 95;
245 end;
246
247 do i = pts to max; vtoce.fm (i) = update_vtoce_null_addr; end;
248
249 if sst$checksum_filemap = 0 then do;
250 vtoce.fm_checksum_valid = "0"b;
251 vtoce.fm_checksum = ""b;
252 end;
253 else if read_vtoce | (pts <= 96) then do;
254 vtoce.fm_checksum_valid = "1"b;
255 call filemap_checksum_ (addr (vtoce.fm), fixed (vtoce.csl, 9), vtoce.fm_checksum);
256 end;
257
258 call vtoc_man$put_vtoce ("0"b, pvtx, vtocx, parts_write, vtocep, code);
259 if code ^= 0 then go to serious_problem;
260
261
262
263
264 if n > 0 then do;
265 call vtoc_man$await_vtoce ("0"b, pvtx, vtocx, code);
266 if code ^= 0 then go to serious_problem;
267 call pc$deposit_list (pvtx, n, addr (deposit_list), vtocx, addr (pageno_list));
268 end;
269
270
271
272
273 if aste.fmchanged then a_astep -> aste.fmchanged1 = "0"b;
274
275 if dsw then a_code = 0;
276 return;
277
278 serious_problem:
279 if dsw then a_code = code;
280 a_astep -> aste.fmchanged = "1"b;
281 if n > 0
282 then addr (pvt$array) -> pvt_array (aste.pvtx).vol_trouble_count
283 = addr (pvt$array) -> pvt_array (aste.pvtx).vol_trouble_count + 1;
284 return;
285 ^L
286 %include vtoce;
287 %include pvte;
288 %include aste;
289 %include null_addresses;
290
291 end update_vtoce;