COMPILATION LISTING OF SEGMENT detach_lv Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1723.5 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 detach_lv: dlv: procedure; 12 13 /* This program is a command that may be called to detach a logical volume. 14* * Created on 04/08/76 by Bill Silver. 15* * Modified on 12/09/78 by Michael R. Jordan for version 3 list info. 16* * Modified on 05/03/82 by J. Bongiovanni for version 4 list info. 17* * 18* * demoun, dmt volume 19* * 20* * volume Specifies the name of the logical volume or volumes to be detached. 21* * A user may detach all logical volumes attached for his/her 22* * process by specifying: 23* * "all" 24* * A user may detach one logical volume by specifying its volume name. 25**/ 26 27 /* AUTOMATIC DATA */ 28 29 dcl pointers (1) ptr; /* Pointer array for temp segment manager. */ 30 31 dcl arg_len fixed bin; /* Length of an argument string. */ 32 dcl arg_ptr ptr; /* Pointer to an argument string. */ 33 dcl ecode fixed bin (35); /* error_table_ code. */ 34 dcl i fixed bin; 35 dcl num_args fixed bin; /* Number of command arguments. */ 36 dcl num_detached fixed bin; /* Number of volumes detached. */ 37 dcl seg_size fixed bin (19); /* Max size of temp segment. */ 38 dcl volume_name char (32); /* Name of volume to be detached. */ 39 40 41 /* BASED DATA */ 42 43 dcl argument char (arg_len) based (arg_ptr); /* Used to reference argument string. */ 44 45 46 /* EXTERNAL ENTRIES CALLED */ 47 48 dcl cleanup condition; 49 50 dcl (addr, null) builtin; 51 52 dcl error_table_$noarg fixed bin (35) external; 53 54 dcl com_err_ entry options (variable); 55 dcl cu_$arg_count entry (fixed bin); 56 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 57 dcl get_temp_segments_ entry (char (*), (1) ptr, fixed bin (35)); 58 dcl hcs_$get_max_length_seg entry (ptr, fixed bin (19), fixed bin (35)); 59 dcl rcp_$copy_list entry (ptr, fixed bin (19), fixed bin (35)); 60 dcl rcp_$detach_lv entry (bit (36) aligned, fixed bin (35)); 61 dcl release_temp_segments_ entry (char (*), (1) ptr, fixed bin (35)); 62 /* */ 1 1 /* Begin include file ... rcp_list_info.incl.pl1 1 2* * 1 3* * Created on 01/29/75 by Bill Silver. 1 4* * Changed on 04/02/76 by Bill Silver to add lv entries. 1 5* * Modified on 12/09/78 by Michael R. Jordan to add reservation information (version 3). 1 6* * Modified 8/81 by M.R. Jordan to expand reservation information (version 4). 1 7* * This include file defines arrays of entries that contain information 1 8* * about the resources that a process has assigned and attached. 1 9**/ 1 10 dcl rli_ptr ptr; /* Pointer to base of RCP list structure. */ 1 11 dcl dassign_ptr ptr; /* Pointer to a device assignment entry. */ 1 12 dcl attach_ptr ptr; /* Pointer to an attachment entry. */ 1 13 dcl lv_ptr ptr; /* Pointer to an lv entry. */ 1 14 dcl device_resv_ptr ptr; /* Pointer to a device reservation entry. */ 1 15 dcl vol_resv_ptr ptr; /* Pointer to a volume reservation entry. */ 1 16 1 17 dcl rli_version_4 fixed bin internal static init (4); 1 18 1 19 dcl 1 rli based (rli_ptr) aligned, /* Base of RCP list structure. */ 1 20 2 head like rli_header, /* header of structure. */ 1 21 2 dassigns (0 refer (rli.head.num_dassign)) 1 22 like dassign, /* An array of device assignment entries. */ 1 23 2 attaches (0 refer (rli.head.num_attach)) 1 24 like attach, /* An array of attachment entries. */ 1 25 2 lvs (0 refer (rli.head.num_lv)) 1 26 like lv, /* An array of lv attachment entries. */ 1 27 2 device_resvs (0 refer (rli.head.num_device_resv)) 1 28 like device_resv, 1 29 2 vol_resvs (0 refer (rli.head.num_vol_resv)) 1 30 like vol_resv, 1 31 2 end bit (36); /* Dummy used to reference end of structure. */ 1 32 1 33 dcl 1 rli_header based aligned, /* Header of RCP list info structure. */ 1 34 2 version_num fixed bin, /* Current version number. Now = 1. */ 1 35 2 num_lv fixed bin, /* Number of lv attachment entries. */ 1 36 2 num_dassign fixed bin, /* Number of device assignment entries. */ 1 37 2 num_attach fixed bin, /* Number of attachment entries. */ 1 38 2 num_device_resv fixed bin, /* Number of devices reserved. */ 1 39 2 num_vol_resv fixed bin; /* Number of volumes reserved. */ 1 40 1 41 dcl 1 dassign based (dassign_ptr) aligned, /* Structure of a device assignment entry. */ 1 42 2 device_name char (8), /* Device name. */ 1 43 2 dtypex fixed bin, /* Device type index. */ 1 44 2 model fixed bin, /* Device model number. */ 1 45 2 num_qualifiers fixed bin, /* Number of device qualifiers. */ 1 46 2 qualifiers (4) fixed bin (35), /* Device qualifiers. */ 1 47 2 state_time fixed bin (71), /* Time assignment put into current state. */ 1 48 2 state fixed bin, /* Current state of assignment. */ 1 49 2 level fixed bin, /* Current validation level. */ 1 50 2 disposition bit (36), /* Disposition of assignment. */ 1 51 2 flags, 1 52 (3 attached bit (1)) unaligned, /* ON => device is attached. */ 1 53 2 rcp_id bit (36), /* RCP ID for this assignment. */ 1 54 2 usage_time fixed bin, /* Number of minutes device may be assigned. */ 1 55 2 wait_time fixed bin; /* Number of minutes user must wait for assignment. */ 1 56 1 57 dcl 1 attach based (attach_ptr) aligned, /* Structure of an attachment entry. */ 1 58 2 device_name char (8), /* Name of attached device. */ 1 59 2 volume_name char (32), /* Name of attached volume. */ 1 60 2 dtypex fixed bin, /* Device type index. */ 1 61 2 state_time fixed bin (71), /* Time attachment put into current state. */ 1 62 2 state fixed bin, /* Current state of this attachment. */ 1 63 2 level fixed bin, /* Current validation level. */ 1 64 2 flags, /* Info flags. */ 1 65 (3 priv bit (1), /* ON => attached with privilege. */ 1 66 3 writing bit (1)) unal, /* ON => attached for writing. */ 1 67 2 rcp_id bit (36), /* RCP ID for this attachment. */ 1 68 2 workspace_max fixed bin (19), /* Max size of IOI workspace buffer. */ 1 69 2 timeout_max fixed bin (52), /* Max IOI time-out interval. */ 1 70 2 ioi_index fixed bin, /* Index used to communicate with IOI. */ 1 71 2 usage_time fixed bin, /* Number of minutes device may be attached. */ 1 72 2 wait_time fixed bin; /* Number of minutes user must wait for attachment. */ 1 73 1 74 dcl 1 lv based (lv_ptr) aligned, /* Structure of an LV entry. */ 1 75 2 volume_name char (32), /* Logical volume name. */ 1 76 2 state_time fixed bin (71), /* Time lv attached for process. */ 1 77 2 rcp_id bit (36); /* RCP ID for this lv attachment. */ 1 78 1 79 dcl 1 device_resv based (device_resv_ptr) aligned, /* Structure of a device reservation. */ 1 80 2 reservation_id fixed bin (71), 1 81 2 reserved_by char (32), 1 82 2 dtypex fixed bin, 1 83 2 device_name char (8); 1 84 1 85 dcl 1 vol_resv based (vol_resv_ptr) aligned, /* Structure of a volume reservation. */ 1 86 2 reservation_id fixed bin (71), 1 87 2 reserved_by char (32), 1 88 2 vtypex fixed bin, 1 89 2 volume_name char (32); 1 90 1 91 /* End of include file ... rcp_list_info.incl.pl1 */ 63 64 /* */ 65 /* Begin command: detach_lv 66**/ 67 ecode, /* Initialize. */ 68 num_detached = 0; 69 volume_name = " "; 70 71 call cu_$arg_count (num_args); /* Total number of command arguments. */ 72 73 if num_args < 1 /* Was any volume specified? */ 74 then do; /* No, no argument. */ 75 call com_err_ (error_table_$noarg, "detach_lv", "No volume specified."); 76 return; 77 end; 78 79 call cu_$arg_ptr (1, arg_ptr, arg_len, ecode); /* Get volume name. */ 80 if ecode ^= 0 81 then do; 82 call com_err_ (ecode, "detach_lv", "Error getting volume name argument."); 83 return; 84 end; 85 86 volume_name = argument; /* Remember volume name. */ 87 88 /* User wants to detach one or more logical volumes from her/his process. 89* * Get temporary segment for RCP list info structure. 90* * Set up cleanup handler to release temp segment. 91**/ 92 pointers (1) = null (); 93 on cleanup begin; 94 if pointers (1) ^= null () 95 then call release_temp_segments_ ("detach_lv", pointers, ecode); 96 end; 97 98 call get_temp_segments_ ("detach_lv", pointers, ecode); 99 if ecode ^= 0 /* Unable to get temporary working segment? */ 100 then do; /* Yes. */ 101 call com_err_ (ecode, "detach_lv", "Error getting temporary segment"); 102 goto RETURN; 103 end; 104 105 call hcs_$get_max_length_seg (pointers (1), seg_size, ecode); 106 if ecode ^= 0 /* We need max size of temp segment. */ 107 then do; 108 call com_err_ (ecode, "detach_lv", "Error getting max seg length of temp segment"); 109 goto RETURN; 110 end; 111 112 rli_ptr = pointers (1); /* Temp segment used for RCP info. */ 113 rli.version_num = rli_version_4; 114 115 call rcp_$copy_list (rli_ptr, seg_size, ecode); 116 if ecode ^= 0 /* Error copying process's RCP info? */ 117 then do; /* Yes. */ 118 call com_err_ (ecode, "detach_lv", "Error copying RCP info"); 119 goto RETURN; 120 end; 121 122 do i = 1 to rli.head.num_lv; /* Look at each attached logical volume. */ 123 lv_ptr = addr (rli.lvs (i)); /* Get pointer to lv attach entry. */ 124 if (volume_name = "all") | /* Detaching all lvs? */ 125 (volume_name = lv.volume_name) /* Or this lv? */ 126 then do; /* Yes, detach this logical volume. */ 127 num_detached = num_detached + 1; 128 call rcp_$detach_lv (lv.rcp_id, ecode); 129 if ecode ^= 0 130 then call com_err_ (ecode, "detach_lv", "Error detaching ^a", lv.volume_name); 131 end; 132 end; 133 134 if num_detached = 0 /* Did we detach any volumes? */ 135 then if volume_name = "lv" /* No. */ 136 then call com_err_ (0, "detach_lv", "No logical volumes attached"); 137 else call com_err_ (0, "detach_lv", "Logical volume ^a not attached", volume_name); 138 139 RETURN: 140 call release_temp_segments_ ("detach_lv", pointers, ecode); 141 if ecode ^= 0 142 then call com_err_ (ecode, "detach_lv", "Error releasing temp segment"); 143 144 return; 145 146 end detach_lv; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1606.6 detach_lv.pl1 >dumps>old>recomp>detach_lv.pl1 63 1 03/19/82 1647.0 rcp_list_info.incl.pl1 >ldd>include>rcp_list_info.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. addr builtin function dcl 50 ref 123 arg_len 000102 automatic fixed bin(17,0) dcl 31 set ref 79* 86 arg_ptr 000104 automatic pointer dcl 32 set ref 79* 86 argument based char unaligned dcl 43 ref 86 attach based structure level 1 dcl 1-57 cleanup 000124 stack reference condition dcl 48 ref 93 com_err_ 000012 constant entry external dcl 54 ref 75 82 101 108 118 129 134 137 141 cu_$arg_count 000014 constant entry external dcl 55 ref 71 cu_$arg_ptr 000016 constant entry external dcl 56 ref 79 dassign based structure level 1 dcl 1-41 device_resv based structure level 1 dcl 1-79 ecode 000106 automatic fixed bin(35,0) dcl 33 set ref 67* 79* 80 82* 94* 98* 99 101* 105* 106 108* 115* 116 118* 128* 129 129* 139* 141 141* error_table_$noarg 000010 external static fixed bin(35,0) dcl 52 set ref 75* get_temp_segments_ 000020 constant entry external dcl 57 ref 98 hcs_$get_max_length_seg 000022 constant entry external dcl 58 ref 105 head based structure level 2 dcl 1-19 i 000107 automatic fixed bin(17,0) dcl 34 set ref 122* 123* lv based structure level 1 dcl 1-74 lv_ptr 000134 automatic pointer dcl 1-13 set ref 123* 124 128 129 lvs based structure array level 2 dcl 1-19 set ref 123 null builtin function dcl 50 ref 92 94 num_args 000110 automatic fixed bin(17,0) dcl 35 set ref 71* 73 num_attach 3 based fixed bin(17,0) level 3 dcl 1-19 ref 123 num_dassign 2 based fixed bin(17,0) level 3 dcl 1-19 ref 123 num_detached 000111 automatic fixed bin(17,0) dcl 36 set ref 67* 127* 127 134 num_lv 1 based fixed bin(17,0) level 3 dcl 1-19 ref 122 pointers 000100 automatic pointer array dcl 29 set ref 92* 94 94* 98* 105* 112 139* rcp_$copy_list 000024 constant entry external dcl 59 ref 115 rcp_$detach_lv 000026 constant entry external dcl 60 ref 128 rcp_id 12 based bit(36) level 2 dcl 1-74 set ref 128* release_temp_segments_ 000030 constant entry external dcl 61 ref 94 139 rli based structure level 1 dcl 1-19 rli_header based structure level 1 dcl 1-33 rli_ptr 000132 automatic pointer dcl 1-10 set ref 112* 113 115* 122 123 rli_version_4 constant fixed bin(17,0) initial dcl 1-17 ref 113 seg_size 000112 automatic fixed bin(19,0) dcl 37 set ref 105* 115* version_num based fixed bin(17,0) level 3 dcl 1-19 set ref 113* vol_resv based structure level 1 dcl 1-85 volume_name 000113 automatic char(32) unaligned dcl 38 in procedure "dlv" set ref 69* 86* 124 124 134 137* volume_name based char(32) level 2 in structure "lv" dcl 1-74 in procedure "dlv" set ref 124 129* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. attach_ptr automatic pointer dcl 1-12 dassign_ptr automatic pointer dcl 1-11 device_resv_ptr automatic pointer dcl 1-14 vol_resv_ptr automatic pointer dcl 1-15 NAMES DECLARED BY EXPLICIT CONTEXT. RETURN 000763 constant label dcl 139 set ref 102 109 119 detach_lv 000145 constant entry external dcl 11 dlv 000136 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1204 1236 1044 1214 Length 1440 1044 32 165 137 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME dlv 152 external procedure is an external procedure. on unit on line 93 82 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME dlv 000100 pointers dlv 000102 arg_len dlv 000104 arg_ptr dlv 000106 ecode dlv 000107 i dlv 000110 num_args dlv 000111 num_detached dlv 000112 seg_size dlv 000113 volume_name dlv 000132 rli_ptr dlv 000134 lv_ptr dlv THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_count cu_$arg_ptr get_temp_segments_ hcs_$get_max_length_seg rcp_$copy_list rcp_$detach_lv release_temp_segments_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$noarg LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000135 67 000152 69 000154 71 000157 73 000165 75 000170 76 000223 79 000224 80 000243 82 000245 83 000275 86 000276 92 000303 93 000305 94 000321 96 000352 98 000353 99 000400 101 000402 102 000432 105 000433 106 000446 108 000450 109 000500 112 000501 113 000503 115 000505 116 000520 118 000522 119 000552 122 000553 123 000563 124 000604 127 000614 128 000615 129 000626 132 000664 134 000666 137 000726 139 000763 141 001010 144 001042 ----------------------------------------------------------- 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