/* Extract the following into lkstat.h which lkstat.c expects to find in the current directory */ ------------------------lkstat.h----------------------------- #define RSB$M_DIRENTRY 1 #define RSB$M_VALINVLD 2 #define RSB$M_DIR_RQD 4 #define RSB$M_RM_PEND 8 #define RSB$M_RM_IP 16 #define RSB$M_RM_ACCEPT 32 #define RSB$M_RM_RBLD 64 #define RSB$M_RM_WAIT 128 #define RSB$M_RM_DEFLECT 256 #define RSB$M_DIR_IP 512 #define RSB$M_RBLD_IP 1024 #define RSB$M_RBLD_RQD 2048 #define RSB$M_RBLD_ACT 4096 #define RSB$M_CHK_BTR 8192 #define RSB$K_LENGTH 112 #define RSB$C_LENGTH 112 #define RSB$K_MAXLEN 31 #define RSB$S_RSBDEF 112 #pragma nostandard struct rsb { unsigned long rsb$l_hshchn; /* hash chain */ unsigned long rsb$l_hshchnbk; /* hash chain back pointer */ unsigned short rsb$w_size; /* size of rsb */ unsigned char rsb$b_type; /* structure type */ unsigned char rsb$b_depth; /* depth in tree */ unsigned char rsb$b_ggmode; /* group grant mode */ unsigned char rsb$b_cgmode; /* conversion grant mode */ variant_union { unsigned short rsb$w_status; /* status */ variant_struct { unsigned rsb$v_direntry : 1; /* entered in dir during failover */ unsigned rsb$v_valinvld : 1; /* value block invalid */ unsigned rsb$v_dir_rqd : 1; /* directory entry required */ unsigned rsb$v_rm_pend : 1; /* resource remaster op pending */ unsigned rsb$v_rm_ip : 1; /* resource being remastered */ unsigned rsb$v_rm_accept : 1; /* new master accepts */ unsigned rsb$v_rm_rbld : 1; /* always rebuild tree */ unsigned rsb$v_rm_wait : 1; /* block local activity */ unsigned rsb$v_rm_deflect : 1; /* deflect remote interest */ unsigned rsb$v_dir_ip : 1; /* directory entry being created */ unsigned rsb$v_rbld_ip : 1; /* rebuild in progress */ unsigned rsb$v_rbld_rqd : 1; /* rebuild required for this tree */ unsigned rsb$v_rbld_act : 1; /* lock rbld active for tree */ unsigned rsb$v_chk_btr : 1; /* check for better master */ unsigned rsb$v_fill : 2; } rsb$r_status_bits; } rsb$r_status_overlay; unsigned long rsb$l_grqfl; /* granted queue forward link */ unsigned long rsb$l_grqbl; /* granted queue backward link */ unsigned long rsb$l_cvtqfl; /* conversion queue forward link */ unsigned long rsb$l_cvtqbl; /* conversion queue backward link */ unsigned long rsb$l_wtqfl; /* wait queue forward link */ unsigned long rsb$l_wtqbl; /* wait queue backward link */ unsigned long rsb$l_valblk[4]; /* value block */ unsigned long rsb$l_csid; /* system id of master sys. */ unsigned long rsb$l_rrsfl; /* root list forward link */ unsigned long rsb$l_rrsbl; /* root list backward link */ unsigned long rsb$l_srsfl; /* tree list forward link */ unsigned long rsb$l_srsbl; /* tree list backward link */ unsigned long rsb$l_rm_csid; /* pendng remaster csid */ unsigned long rsb$l_rtrsb; /* pointer to root rsb */ unsigned long rsb$l_clurcb; /* remaster control block */ unsigned short rsb$w_activity; /* resource activity counter */ unsigned short rsb$w_lckcnt; /* count of locks on resource */ unsigned long rsb$l_valseqnum; /* value block seq. number */ unsigned short rsb$w_refcnt; /* sub rsb reference count */ unsigned short rsb$w_blkastcnt; /* blocking ast count */ unsigned short rsb$w_hashval; /* hash value */ unsigned short rsb$w_rqseqnm; /* request sequence number */ unsigned long rsb$l_parent; /* address of parent rsb */ unsigned short rsb$w_group; /* group number */ unsigned char rsb$b_rmod; /* access mode of resource */ unsigned char rsb$b_rsnlen; /* resource name length */ unsigned char rsb$t_resnam[RSB$K_MAXLEN]; /* start of resource name */ }; #pragma standard #define LKB$M_PKAST 16 #define LKB$M_NODELETE 32 #define LKB$M_QUOTA 64 #define LKB$M_KAST 128 #define LKB$M_DCPLAST 1 #define LKB$M_DBLKAST 2 #define LKB$M_ASYNC 4 #define LKB$M_BLKASTQED 8 #define LKB$M_MSTCPY 16 #define LKB$M_NOQUOTA 32 #define LKB$M_TIMOUTQ 64 #define LKB$M_WASSYSOWN 128 #define LKB$M_CVTTOSYS 256 #define LKB$M_PROTECT 512 #define LKB$M_RESEND 1024 #define LKB$M_RM_RBRQD 2048 #define LKB$M_FLOCK 4096 #define LKB$M_IP 8192 #define LKB$K_ACBLEN 52 /* length of acb portion of lkb */ #define LKB$C_ACBLEN 52 /* length of acb portion of lkb */ #define LKB$K_LKIDSIZ 18 #define LKB$C_LKIDSIZ 18 #define LKB$K_GRANTED 1 /* granted */ #define LKB$K_CONVERT 0 /* conversion */ #define LKB$K_WAITING -1 /* waiting */ #define LKB$K_RETRY -2 /* retry request */ #define LKB$K_SCSWAIT -3 /* scs wait */ #define LKB$K_RSPNOTQED -4 /* response not queued */ #define LKB$K_RSPQUEUED -5 /* response queued */ #define LKB$K_RSPGRANTD -6 /* response granted */ #define LKB$K_RSPDOLOCL -7 /* response do locally */ #define LKB$K_RSPRESEND -8 /* response resend */ #define LKB$K_RSPWAIT -9 /* response wait */ #define LKB$K_LENGTH 100 /* length of lkb */ #define LKB$C_LENGTH 100 /* length of lkb */ #define LKB$S_LKBDEF 100 #pragma nostandard struct lkb { unsigned long lkb$l_astqfl; /* ast queue forward link */ unsigned long lkb$l_astqbl; /* ast queue backward link */ unsigned short lkb$w_size; /* size of lkb in bytes */ unsigned char lkb$b_type; /* structure type */ variant_union { unsigned char lkb$b_rmod; /* access mode of request */ variant_struct { unsigned lkb$v_fill : 4; /* mode subfield */ unsigned lkb$v_pkast : 1; /* piggy back special kernel ast */ unsigned lkb$v_nodelete : 1; /* don't delete acb on delivery */ unsigned lkb$v_quota : 1; /* account for quota */ unsigned lkb$v_kast : 1; /* special kernel ast */ } lkb$r_mode_bits; } lkb$r_mode_overlay; unsigned long lkb$l_pid; /* process id of requesting process */ variant_union { unsigned long lkb$l_ast; /* address of ast routine */ variant_struct { unsigned short lkb$w_rqseqnm; /* request seq. number */ unsigned short lkb$w_fill; } lkb$r_rqseqnm; } lkb$r_ast_overlay; variant_union { unsigned long lkb$l_astprm; /* ast parameter */ unsigned long lkb$l_epid; /* epid (master copies only) */ } lkb$r_astprm_overlay; variant_union { unsigned long lkb$l_kast; /* special kernel ast address */ unsigned long lkb$l_duetime; /* duetime for waiting locks */ } lkb$r_kast_overlay; unsigned long lkb$l_cplastadr; /* address of completion ast routine*/ unsigned long lkb$l_blkastadr; /* address of blocking ast routine */ variant_union { unsigned long lkb$l_lksb; /* address of lock status block */ unsigned long lkb$l_dlckpri; /* deadlock priority (master copies)*/ } lkb$r_lksb_overlay; unsigned short lkb$w_flags; /* user specified flags */ variant_union { unsigned short lkb$w_status; /* internal status */ variant_struct { unsigned lkb$v_dcplast : 1; /* deliver completion ast */ unsigned lkb$v_dblkast : 1; /* deliver blocking ast */ unsigned lkb$v_async : 1; /* request completed asynchronously*/ unsigned lkb$v_blkastqed : 1; /* blocking ast has been queued */ unsigned lkb$v_mstcpy : 1; /* lkb is a master copy */ unsigned lkb$v_noquota : 1; /* don't charge quota */ unsigned lkb$v_timoutq : 1; /* lkb is on timeout queue */ unsigned lkb$v_wassysown : 1; /* was system owned lock */ unsigned lkb$v_cvttosys : 1; /* cvt back to sys. owned */ unsigned lkb$v_protect : 1; /* protected lock */ unsigned lkb$v_resend : 1; /* resend during failover */ unsigned lkb$v_rm_rbrqd : 1; /* remaster rebuild required */ unsigned lkb$v_flock : 1; /* fork lock */ unsigned lkb$v_ip : 1; /* operation in progress */ unsigned lkb$v_fill_2 : 2; } lkb$r_status_bits; } lkb$r_status_overlay; unsigned long lkb$l_lkst1; /* first lock status longword */ variant_union { unsigned long lkb$l_lkst2; /* second lock status longword */ unsigned long lkb$l_lkid; /* lock id */ } lkb$r_lkst1_overlay; unsigned char lkb$b_rqmode; /* request mode */ unsigned char lkb$b_grmode; /* granted mode */ unsigned char lkb$b_state; /* lock state */ unsigned char lkb$b_efn; /* event flag number */ unsigned long lkb$l_sqfl; /* state queue forward link */ unsigned long lkb$l_sqbl; /* state queue backward link */ unsigned long lkb$l_ownqfl; /* owner queue forward link */ unsigned long lkb$l_ownqbl; /* owner queue backward link */ unsigned long lkb$l_parent; /* address of parent lkb */ unsigned short lkb$w_refcnt; /* sub lkb reference count */ unsigned char lkb$b_tslt; /* timestamp lifetime */ unsigned char lkb$b_fill; unsigned long lkb$l_rsb; /* address of owner rsb */ unsigned long lkb$l_remlkid; /* remote lock id */ variant_union { unsigned long lkb$l_csid; /* cluster system id (master only) */ unsigned long lkb$l_oldastprm; /* old ast parameter */ } lkb$r_csid_overlay; unsigned long lkb$l_oldblkast; /* old blocking ast addr, */ unsigned long lkb$l_lckctx; /* address of context block */ }; #pragma standard #define HM2$C_LEVEL1 257 /* 401 octal = structure level 1 */ #define HM2$C_LEVEL2 512 /* 1000 octal = structure level 2 */ #define HM2$M_READCHECK 1 #define HM2$M_WRITCHECK 2 #define HM2$M_ERASE 4 #define HM2$M_NOHIGHWATER 8 #define HM2$M_CLASS_PROT 16 #define HM2$S_HM2DEF 512 #pragma nostandard struct hm2 { unsigned long hm2$l_homelbn; /* LBN of home (i.e., this) block */ unsigned long hm2$l_alhomelbn; /* LBN of alternate home block */ unsigned long hm2$l_altidxlbn; /* LBN of alternate index file header */ variant_union { unsigned short hm2$w_struclev; /* volume structure level */ variant_struct { unsigned char hm2$b_strucver; /* structure version number */ unsigned char hm2$b_struclev; /* main structure level */ } hm2$r_struclev_bytes; } hm2$r_struclev_overlay; unsigned short hm2$w_cluster; /* storage bitmap cluster factor */ unsigned short hm2$w_homevbn; /* VBN of home (i.e., this) block */ unsigned short hm2$w_alhomevbn; /* VBN of alternate home block */ unsigned short hm2$w_altidxvbn; /* VBN of alternate index file header */ unsigned short hm2$w_ibmapvbn; /* VBN of index file bitmap */ unsigned long hm2$l_ibmaplbn; /* LBN of index file bitmap */ unsigned long hm2$l_maxfiles; /* maximum # files on volume */ unsigned short hm2$w_ibmapsize; /* index file bitmap size, blocks */ unsigned short hm2$w_resfiles; /* # reserved files on volume */ unsigned short hm2$w_devtype; /* disk device type */ unsigned short hm2$w_rvn; /* relative volume number of this volume */ unsigned short hm2$w_setcount; /* count of volumes in set */ variant_union { unsigned short hm2$w_volchar; /* volume characteristics */ variant_struct { unsigned hm2$v_readcheck : 1; /* verify all read operations */ unsigned hm2$v_writcheck : 1; /* verify all write operations */ unsigned hm2$v_erase : 1; /* erase all files on delete */ unsigned hm2$v_nohighwater : 1; /* turn off high-water marking */ unsigned hm2$v_class_prot : 1; /* enable classification checks */ unsigned hm2$v_fill : 11; } hw2$r_volchar_bits; } hw2$r_volchar_overlay; unsigned long hm2$l_volowner; /* volume owner UIC */ unsigned long hm2$l_sec_mask; /* volume security mask */ unsigned short hm2$w_protect; /* volume protection */ unsigned short hm2$w_fileprot; /* default file protection */ unsigned short hm2$w_recprot; /* default file record protection */ unsigned short hm2$w_checksum1; /* first checksum */ unsigned long hm2$q_credate[2]; /* volume creation date */ unsigned char hm2$b_window; /* default window size */ unsigned char hm2$b_lru_lim; /* default LRU limit */ unsigned short hm2$w_extend ; /* default file extend */ unsigned long hm2$q_retainmin[2]; /* minimum file retention period */ unsigned long hm2$q_retainmax[2]; /* maximum file retention period */ unsigned long hm2$q_revdate[2]; /* volume revision date */ unsigned long hm2$r_min_class[5]; /* volume minimum security class */ unsigned long hm2$r_max_class[5]; /* volume maximum security class */ unsigned short hm2$w_filetab_fid[3]; /* file lookup table FID */ variant_union { unsigned short hm2$w_lowstruclev; /* lowest struclev on volume */ variant_struct { unsigned char hm2$b_lowstrucver; /* structure version num */ unsigned char hm2$b_lowstruclev; /* main structure level */ } hm2$r_lowstruclev_bytes; } hm2$r_lowstruclev_overlay; variant_union { unsigned short hm2$w_highstruclev; /* highest struclev on volume */ variant_struct { unsigned char hm2$b_highstrucver; /* structure version num */ unsigned char hm2$b_highstruclev; /* main structure level */ } hm2$r_highstruclev_bytes; } hm2$r_highstruclev_overlay; unsigned short hm2$w_pad[155]; unsigned long hm2$l_serialnum; /* pack serial number */ unsigned char hm2$t_strucname[12]; /* structure (volume set name) */ unsigned char hm2$t_volname[12]; /* volume name */ unsigned char hm2$t_ownername[12]; /* volume owner name */ unsigned char hm2$t_format[12]; /* volume format type */ unsigned short hm2$w_pad2; unsigned short hm2$w_checksum2; /* second checksum */ }; #pragma standard #define FH2$C_LEVEL1 257 /* 401 octal = structure level 1 */ #define FH2$C_LEVEL2 512 /* 1000 octal = structure level 2 */ #define FH2$M_VCC_STATE 1792 #define FH2$M_ALM_STATE 1835008 #define FH2$M_WASCONTIG 1 #define FH2$M_NOBACKUP 2 #define FH2$M_WRITEBACK 4 #define FH2$M_READCHECK 8 #define FH2$M_WRITCHECK 16 #define FH2$M_CONTIGB 32 #define FH2$M_LOCKED 64 #define FH2$M_CONTIG 128 #define FH2$M_BADACL 2048 #define FH2$M_SPOOL 4096 #define FH2$M_DIRECTORY 8192 #define FH2$M_BADBLOCK 16384 #define FH2$M_MARKDEL 32768 #define FH2$M_NOCHARGE 65536 #define FH2$M_ERASE 131072 #define FH2$M_ALM_AIP 262144 #define FH2$M_ALM_ARCHIVED 524288 #define FH2$M_ALM_DELETED 1048576 #define FH2$M_ONLY_RU 1 #define FH2$M_RUJNL 2 #define FH2$M_BIJNL 4 #define FH2$M_AIJNL 8 #define FH2$M_ATJNL 16 #define FH2$M_NEVER_RU 32 #define FH2$M_JOURNAL_FILE 64 #define FH2$C_RU_FACILITY_RMS 1 /* RMS */ #define FH2$C_RU_FACILITY_DBMS 2 /* DBMS */ #define FH2$C_RU_FACILITY_RDB 3 /* Rdb/VMS */ #define FH2$C_RU_FACILITY_CHKPNT 4 /* Checkpoint/Restart */ #define FH2$K_LENGTH 80 /* length of header area */ #define FH2$C_LENGTH 80 /* length of header area */ #define FH2$K_SUBSET0_LENGTH 88 /* length of header area */ #define FH2$C_SUBSET0_LENGTH 88 /* length of header area */ #define FH2$K_FULL_LENGTH 108 /* length of full header */ #define FH2$C_FULL_LENGTH 108 /* length of full header */ #define FH2$S_FH2DEF 512 #pragma nostandard struct fh2 { unsigned char fh2$b_idoffset; /* ident area offset in words */ unsigned char fh2$b_mpoffset; /* map area offset in words */ unsigned char fh2$b_acoffset; /* access control list offset in words */ unsigned char fh2$b_rsoffset; /* reserved area offset in words */ unsigned short fh2$w_seg_num; /* file segment number */ variant_union { unsigned short fh2$w_struclev; /* file structure level */ variant_struct { unsigned char fh2$b_strucver; /* file structure version */ unsigned char fh2$b_struclev; /* principal file struct level */ } fh2$r_struclev_bytes; } fh2$r_struclev_overlay; variant_union { unsigned short fh2$w_fid[3]; variant_struct { unsigned short fh2$w_fid_num; unsigned short fh2$w_fid_seq; variant_union { unsigned short fh2$w_fid_rvn; variant_struct { unsigned char fh2$b_fid_rvn; unsigned char fh2$b_fid_nmx; } fh2$r_rvn_bytes; } fh2$r_rvn_overlay; } fh2$r_fid_words; } fh2$r_fid_overlay; variant_union { unsigned short fh2$w_ext_fid[3]; variant_struct { unsigned short fh2$w_ex_fidnum; unsigned short fh2$w_ex_fidseq; variant_union { unsigned short fh2$w_ex_fidrvn; variant_struct { unsigned char fh2$b_ex_fidrvn; unsigned char fh2$b_ex_fidnmx; } fh2$r_ex_rvn_bytes; } fh2$r_exe_rvn_overlay; } fh2$r_ex_fid_words; } fh2$r_ex_fid_overlay; unsigned short fh2$w_recattr[16]; variant_union { unsigned long fh2$l_filechar; variant_struct { unsigned fh2$v_wascontig : 1; /* file was (and should be) contig */ unsigned fh2$v_nobackup : 1; /* file is not to be backed up */ unsigned fh2$v_writeback : 1; /* file may be write-back cached */ unsigned fh2$v_readcheck : 1; /* verify all read operations */ unsigned fh2$v_writcheck : 1; /* verify all write operations */ unsigned fh2$v_contigb : 1; /* keep file as contiguous as poss */ unsigned fh2$v_locked : 1; /* file is deaccess locked */ unsigned fh2$v_contig : 1; /* file is contiguous */ unsigned fh2$v_vcc_state : 3; unsigned fh2$v_badacl : 1; /* ACL is invalid */ unsigned fh2$v_spool : 1; /* intermediate spool file */ unsigned fh2$v_directory : 1; /* file is a directory */ unsigned fh2$v_badblock : 1; /* file contains bad blocks */ unsigned fh2$v_markdel : 1; /* file is marked for delete */ unsigned fh2$v_nocharge : 1; /* file space is not to be charged */ unsigned fh2$v_erase : 1; /* erase file contents before del */ unsigned fh2$v_alm_aip : 1; /* Archive in progress */ unsigned fh2$v_alm_archived : 1; /* File archived */ unsigned fh2$v_alm_deleted : 1; /* File contents deleted */ unsigned fh2$v_fill : 11; } fh2$r_filechar_bits; } fh2$r_filechar_overlay; unsigned short fh2$w_recprot; /* record protection */ unsigned char fh2$b_map_inuse; /* number of map area words in use */ unsigned char fh2$b_acc_mode; /* least privileged access mode */ variant_union { unsigned long fh2$l_fileowner; /* file owner UIC */ variant_struct { unsigned short fh2$w_uicmember; /* UIC member number */ unsigned short fh2$w_uicgroup; /* UIC group number */ } fh2$r_fileowner_bytes; } fh2$r_fileowner_overlay; unsigned short fh2$w_fileprot; /* file protection */ variant_union { unsigned short fh2$w_backlink[3]; variant_struct { unsigned short fh2$w_bk_fidnum; unsigned short fh2$w_bk_fidseq; variant_union { unsigned short fh2$w_bk_fidrvn; variant_struct { unsigned char fh2$b_bk_fidrvn; unsigned char fh2$b_bk_fidnmx; } fh2$r_backlink_rvn_bytes; } fh2$r_backlink_rvn_overlay; } fh2$r_backlink_rvn_words; } fh2$r_backlink_rvn_overlay; variant_union { unsigned char fh2$b_journal; variant_struct { unsigned fh2$v_only_ru : 1; /* file accessible only in rec unit */ unsigned fh2$v_rujnl : 1; /* enable recovery unit journal */ unsigned fh2$v_bijnl : 1; /* enable before image journal */ unsigned fh2$v_aijnl : 1; /* enable after image journal */ unsigned fh2$v_atjnl : 1; /* enable audit trail journal */ unsigned fh2$v_never_ru : 1; /* file never accessible in rec uni */ unsigned fh2$v_journal_file : 1; /* this is a journal file */ unsigned fh2$v_fill_2 : 1; } fh2$r_journal_bits; } fh2$r_journal_overlay; unsigned char fh2$b_ru_active; /* If non-zero, file has active rec uni */ unsigned short fh2$w_pad; unsigned long fh2$l_highwater; /* high-water mark in file */ unsigned long fh2$l_pad2[2]; unsigned long fh2$r_class_prot[5]; /* security classification mask */ unsigned short fh2$w_pad3[201]; unsigned short fh2$w_checksum; /* file header checksum */ }; #pragma standard