.title DISKINFO - get disk information .ident /V1.03/ .sbttl Documentation ; ; This routine gets miscellaneous information about disks ; for the SHOWDISKS program. ; ; Calling format: ; ; stat=DISKINFO(device, logical, loglen, maxblocks, freeblocks) ; ; Eric F. Richards ; 18-Mar-86 ; Gould OSD VAXcluster V4.2 ; $devdef ; define devchar bits $dvidef ; define getdvi codes $ssdef ; define system service offsets numargs = 5 ; number of arguments device = 4 ; addr of devname descr logical = 8 ; addr of return logical loglen = 12 ; addr for length of logical maxblk = 16 ; addr of buffer for maxblks freblk = 20 ; addr of buffer for freblks .sbttl Main Code .psect $code, long, nowrt, exe, pic, shr .entry DISKINFO, ^m cmpb #numargs, (ap) ; enough arguments? bgequ 10$ ; if so, skip error handler movzwl #ss$_insfarg, r0 ; else, this is the error ret ; ...and this is how we handle it 10$: clrq -(sp) ; clear buffer for shadow info, devchar movl sp, r3 ; save buffer address movl logical(ap), r0 ; get pointer of the descr clrl -(sp) ; mark end of item list pushl loglen(ap) ; write length of log name here pushl 4(r0) ; write logical name here pushl # ; we want volume's logical name movw (r0), (sp) ; this is the buffer length .if df dvi$_shdw_member ; if we have shadow sets here clrl -(sp) ; length of boolean not needed pushal 4(r3) ; write shadow set boolean here pushl #!4; shadow set member info code .endc clrl -(sp) ; length of devchar not needed pushl r3 ; write dev chars here pushl #!4 ; request code, length clrl -(sp) ; length of this not needed pushl maxblk(ap) ; where to write max block count pushl #!4 ; request max block count, longword clrl -(sp) ; length of this not needed pushl freblk(ap) ; where to write free block count pushl #!4 ; request free blocks, longword movl sp, r0 ; save pointer to request list clrq -(sp) ; make room for I/O status block movl sp, r2 ; save its address $getdviw_s devnam=@device(ap),- ; get the info itmlst=(r0), - ; using these items iosb=(r2) ; use this I/O status block blbc r0, 100$ ; on error get out blbc (r2), 90$ ; ditto above movzwl #ss$_devnotmount, r0 ; assume not mounted bbc #dev$v_mnt, (r3), 100$ ; go home if so .iif df dvi$_shdw_member, - ; also, check for shadowset code blbs 4(r3), 100$ ; skip if a shadow volume movzwl #ss$_devnotdism, r0 ; assume marked for dismount bbs #dev$v_dmt, (r3), 100$ ; go home if so movzwl #ss$_devforeign, r0 ; assume mounted foreign bbs #dev$v_for, (r3), 100$ ; go home if so movzwl #ss$_writlck, r0 ; assume write-locked bbs #dev$v_swl, (r3), 100$ ; go home if so 90$: movzwl (r2), r0 ; get status from IOSB 100$: ret ; go home to caller .end ; that's all, folks!