COMPILATION LISTING OF SEGMENT bjm_open_all_after_crash Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/04/85 0941.3 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* format: style4,indattr,ifthenstmt,ifthen,idind33,^indcomtxt */ 8 9 bjm_open_all_after_crash: 10 proc (Old_boot_dir, Bj_oid_p, Bj_uid_p, N_bjs_opened_for_recovery, Code); 11 12 /* DESCRIPTION: 13* This program is intended to be called during DMS crash recovery by the 14* DMS Daemon. It finds the BJ unique id to pathname table in the 15* directory specified and loops through it calling the normal opening 16* program once it has the name. The opening id returned and the unique id 17* found are returned in the arrays located by Bj_oid_p and Bj_uid_p. 18**/ 19 20 /* HISTORY: 21* 22*Written by Lee A. Newcomb, 01/06/83. 23*Modified: 24*03/07/83 by L. A. Newcomb: use dm_log_sv_codes.incl.pl1. 25*04/06/83 by L. A. Newcomb: use bjm_$open_bj_for_recovery and 26* $find_old_uid_pn_table. 27*03/05/85 by Steve Herbst: Replaced dm_log_ with dm_misc_util_$log. 28**/ 29 30 /* START DECLARATIONS (except include files) */ 31 32 dcl ( /* parameters */ 33 Old_boot_dir char (*), /* INPUT: dir. with the old bootload's tables */ 34 Bj_oid_p ptr, /* INPUT: loc. of BJ opening id array */ 35 Bj_uid_p ptr, /* INPUT: loc. of BJ unique id array */ 36 N_bjs_opened_for_recovery fixed bin, /* OUTPUT: how successful we were */ 37 Code fixed bin (35) /* OUTPUT: normal error code, recovery fails if ^= 0 */ 38 ) parameter; 39 40 dcl ( /* automatics */ 41 bj_oid_p ptr, /* local copy of parameter */ 42 bj_uid_p ptr, /* local copy of parameter */ 43 curr_bj_oid bit (36) aligned, /* holder before storing in caller's array */ 44 code fixed bin (35), /* local error code holder */ 45 have_an_error bit (1) aligned, /* used for setting return Code after loop */ 46 idx fixed bin, /* index to loop through BJ UID-pathname table */ 47 n_bjs_opened_for_recovery fixed bin /* local copy of parameter */ 48 ) automatic; 49 50 dcl ( /* arrays the caller expects filled in */ 51 bj_oid based (bj_oid_p), /* based on the local version of */ 52 bj_uid based (bj_uid_p) /* the parameters */ 53 ) bit (36) aligned dim (1:n_bjs_opened_for_recovery); 54 55 dcl ( /* error codes */ 56 dm_error_$bj_not_all_opened_after_crash 57 ) fixed bin (35) ext static; 58 59 dcl /* external entries called */ 60 before_journal_manager_$open_bj_for_recovery 61 entry (char (*), char (*), bit (36) aligned, fixed bin (35)), 62 before_journal_manager_$find_old_uid_pn_table 63 entry (char (*), ptr, fixed bin (35)), 64 dm_misc_util_$log entry options (variable); 65 66 /* END DECLARATIONS */ 67 68 /* copy much used input parameters to automatic and init. output parameters */ 69 70 bj_oid_p = Bj_oid_p; 71 bj_uid_p = Bj_uid_p; 72 73 N_bjs_opened_for_recovery = 0; /* assume all BJ's were closed */ 74 Code = 0; /* and let's be optimistic */ 75 76 n_bjs_opened_for_recovery = 0; /* set local holder of # of BJ's we've opened */ 77 78 79 /* First things first, we have to find the old UID-pathname table used */ 80 /* by the previous DMS boot. */ 81 82 call before_journal_manager_$find_old_uid_pn_table (Old_boot_dir, bj_pn_table_ptr, Code); 83 if Code ^= 0 then do; /* could not find the table */ 84 call dm_misc_util_$log (LOG_SV, Code, "bjm_open_all_after_crash", 85 "Could not find BJ UID-pathname table in dir. ^a.", Old_boot_dir); 86 return; /* no cleanup to do */ 87 end; 88 89 90 /* Now loop through the table, opening before journals as we find them. */ 91 /* When an opening is successful, store the required data in the */ 92 /* return arrays. */ 93 94 have_an_error = ""b; /* to detect an error on one or more opens */ 95 96 do idx = 1 to bj_pn_table.max_n_entries; 97 98 if bj_pn_table.bj_uid (idx) ^= ""b then do; /* have an occupied entry */ 99 /* N.B., we pass dir & entry by value for alignment */ 100 call before_journal_manager_$open_bj_for_recovery ((bj_pn_table.dir (idx)), 101 (bj_pn_table.entry (idx)), curr_bj_oid, code); 102 if code ^= 0 then do; 103 have_an_error = "1"b; /* so we can set Code at end */ 104 call dm_misc_util_$log (LOG_SV, code, "bjm_open_all_after_crash", 105 "Error trying to open ^a>^a.", bj_pn_table.dir (idx), bj_pn_table.entry (idx)); 106 end; 107 108 else do; /* no problems, record data */ 109 n_bjs_opened_for_recovery = n_bjs_opened_for_recovery + 1; 110 bj_oid (n_bjs_opened_for_recovery) = curr_bj_oid; 111 bj_uid (n_bjs_opened_for_recovery) = bj_pn_table.bj_uid (idx); 112 end; 113 114 end; /* of trying to open a filled entry */ 115 end; /* of opening loop */ 116 117 /* now must see if any errors were encountered so can tell caller */ 118 119 if have_an_error then 120 Code = dm_error_$bj_not_all_opened_after_crash; 121 122 /* DONE */ 123 N_bjs_opened_for_recovery = n_bjs_opened_for_recovery; /* tell caller how many we got for her */ 124 125 return; 126 127 /* end bjm_open_all_after_crash; */ 128 129 /* INCLUDE FILES start next page */ 130 1 1 /* BEGIN INCLUDE FILE: dm_bj_pn_table.incl.pl1 */ 1 2 /* 1 3*This vector relates a BJ UID to its pathname. 1 4* 1 5*Written by Andre Bensoussan June/July 1982 1 6*Modified: 1 7*09/29/82 by Lee A. Newcomb: To make word aligned, convert to use 1 8* dm_system_data_$bj_max_n_journals, and store max_n_entries 1 9* for use with crash recovery. 1 10**/ 1 11 /* format: style4,indattr,idind33,^indcomtxt */ 1 12 1 13 dcl bj_pn_table_ptr ptr; 1 14 1 15 dcl 1 bj_pn_table based (bj_pn_table_ptr) aligned, 1 16 2 max_n_entries fixed bin, /* know how long the table is for crash recovery */ 1 17 2 bj_path_to_uid_relation dim (dm_system_data_$bj_max_n_journals refer (bj_pn_table.max_n_entries)), 1 18 3 dir char (168), 1 19 3 entry char (32), 1 20 3 bj_uid bit (36); 1 21 1 22 /* END INCLUDE FILE: dm_bj_pn_table.incl.pl1 */ 131 132 2 1 /* BEGIN INCLUDE FILE dm_log_sv_codes.incl.pl1 */ 2 2 2 3 /* format: ^indcom */ 2 4 2 5 /* DESCRIPTION: 2 6* These are the severity codes used by the dms daemon when calling its logger. 2 7* The severity is ranked thusly: 2 8* 2 9* severity log write situation 2 10* -------- --- ----- --------- 2 11* 0 no yes standard output, query, etc. 2 12* 1 yes yes fatal error, terminate dms daemon. 2 13* 2 yes yes nonfatal error. 2 14* 3 yes yes informative message. 2 15* 4 yes no log information only. 2 16**/ 2 17 2 18 /* HISTORY: 2 19* 2 20*Written by M. Pandolf, 10/06/82. 2 21*Modified: 2 22*12/10/84 by R. Michael Tague: Rename and reformat description/history. 2 23*01/13/85 by Lee A. Newcomb: Renamed to dm_log_sv_codes from 2 24* dm_daemon_sv_codes as the severity codes for the DM log are not 2 25* restrained to the DM Daemon's use. 2 26*01/24/85 by Lee A. Newcomb: Fixed to say dm_log_sv_codes.incl.pl1 in the 2 27* BEGIN and END INCLUDE comments, instead of dm_daemon_sv_codes.==. 2 28**/ 2 29 2 30 /* format: style5 */ 2 31 2 32 dcl (PRINT_SV, QUERY_SV) fixed bin internal static 2 33 options (constant) init (0); 2 34 dcl (CRASH_SV, FATAL_SV) fixed bin internal static 2 35 options (constant) init (1); 2 36 dcl ERROR_SV fixed bin internal static 2 37 options (constant) init (2); 2 38 dcl INFORM_SV fixed bin internal static 2 39 options (constant) init (3); 2 40 dcl LOG_SV fixed bin internal static 2 41 options (constant) init (4); 2 42 2 43 /* END INCLUDE FILE dm_log_sv_codes.incl.pl1 */ 133 134 135 136 end bjm_open_all_after_crash; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/04/85 0826.3 bjm_open_all_after_crash.pl1 >spec>on>7192.pbf-04/04/85>bjm_open_all_after_crash.pl1 131 1 01/07/85 0857.4 dm_bj_pn_table.incl.pl1 >ldd>include>dm_bj_pn_table.incl.pl1 133 2 03/06/85 1031.1 dm_log_sv_codes.incl.pl1 >ldd>include>dm_log_sv_codes.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. Bj_oid_p parameter pointer dcl 32 ref 9 70 Bj_uid_p parameter pointer dcl 32 ref 9 71 Code parameter fixed bin(35,0) dcl 32 set ref 9 74* 82* 83 84* 119* LOG_SV 000007 constant fixed bin(17,0) initial dcl 2-40 set ref 84* 104* N_bjs_opened_for_recovery parameter fixed bin(17,0) dcl 32 set ref 9 73* 123* Old_boot_dir parameter char unaligned dcl 32 set ref 9 82* 84* before_journal_manager_$find_old_uid_pn_table 000014 constant entry external dcl 59 ref 82 before_journal_manager_$open_bj_for_recovery 000012 constant entry external dcl 59 ref 100 bj_oid based bit(36) array dcl 50 set ref 110* bj_oid_p 000100 automatic pointer dcl 40 set ref 70* 110 bj_path_to_uid_relation 1 based structure array level 2 dcl 1-15 bj_pn_table based structure level 1 dcl 1-15 bj_pn_table_ptr 000112 automatic pointer dcl 1-13 set ref 82* 96 98 100 100 104 104 111 bj_uid based bit(36) array dcl 50 in procedure "bjm_open_all_after_crash" set ref 111* bj_uid 63 based bit(36) array level 3 in structure "bj_pn_table" dcl 1-15 in procedure "bjm_open_all_after_crash" ref 98 111 bj_uid_p 000102 automatic pointer dcl 40 set ref 71* 111 code 000105 automatic fixed bin(35,0) dcl 40 set ref 100* 102 104* curr_bj_oid 000104 automatic bit(36) dcl 40 set ref 100* 110 dir 1 based char(168) array level 3 dcl 1-15 set ref 100 104* dm_error_$bj_not_all_opened_after_crash 000010 external static fixed bin(35,0) dcl 55 ref 119 dm_misc_util_$log 000016 constant entry external dcl 59 ref 84 104 entry 53 based char(32) array level 3 dcl 1-15 set ref 100 104* have_an_error 000106 automatic bit(1) dcl 40 set ref 94* 103* 119 idx 000107 automatic fixed bin(17,0) dcl 40 set ref 96* 98 100 100 104 104 111* max_n_entries based fixed bin(17,0) level 2 dcl 1-15 ref 96 n_bjs_opened_for_recovery 000110 automatic fixed bin(17,0) dcl 40 set ref 76* 109* 109 110 111 123 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. CRASH_SV internal static fixed bin(17,0) initial dcl 2-34 ERROR_SV internal static fixed bin(17,0) initial dcl 2-36 FATAL_SV internal static fixed bin(17,0) initial dcl 2-34 INFORM_SV internal static fixed bin(17,0) initial dcl 2-38 PRINT_SV internal static fixed bin(17,0) initial dcl 2-32 QUERY_SV internal static fixed bin(17,0) initial dcl 2-32 NAME DECLARED BY EXPLICIT CONTEXT. bjm_open_all_after_crash 000051 constant entry external dcl 9 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 450 470 341 460 Length 702 341 20 176 106 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME bjm_open_all_after_crash 171 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME bjm_open_all_after_crash 000100 bj_oid_p bjm_open_all_after_crash 000102 bj_uid_p bjm_open_all_after_crash 000104 curr_bj_oid bjm_open_all_after_crash 000105 code bjm_open_all_after_crash 000106 have_an_error bjm_open_all_after_crash 000107 idx bjm_open_all_after_crash 000110 n_bjs_opened_for_recovery bjm_open_all_after_crash 000112 bj_pn_table_ptr bjm_open_all_after_crash THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. before_journal_manager_$find_old_uid_pn_table before_journal_manager_$open_bj_for_recovery dm_misc_util_$log THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$bj_not_all_opened_after_crash LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 9 000044 70 000064 71 000070 73 000073 74 000074 76 000075 82 000076 83 000116 84 000121 86 000161 94 000162 96 000163 98 000173 100 000177 102 000236 103 000240 104 000242 106 000313 109 000314 110 000315 111 000321 115 000325 119 000327 123 000335 125 000340 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved