📄 fsckwsp.h
字号:
/* * Copyright (c) International Business Machines Corp., 2000-2002 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#ifndef H_FSCKWSP#define H_FSCKWSP#include "fscklog.h"#include <jfs_dmap.h>#include <jfs_dtree.h>#include <jfs_xtree.h>#include <jfs_filsys.h>#include <jfs_imap.h>#include <jfs_dinode.h>#include "fsck_base.h"#include "fsckcbbl.h"/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * fsck uses the structures and types in this file to define its workspace. * *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *//*---------------------------------------------------------------------------- * type dtree_Q_elem describes one node which is to be visited in the * traversal of a directory B+ Tree * */struct dtreeQelem { struct dtreeQelem *next; struct dtreeQelem *prev; int64_t node_addr; pxd_t node_pxd; uint8_t node_key_len; UniChar node_key[JFS_NAME_MAX]; int8_t node_level; uint32_t node_size;};#define dtreeQ_elem_length sizeof(struct dtreeQelem)/*---------------------------------------------------------------------------- * type tree_Q_elem describes one node which is to be visited in the * traversal of a non-directory B+ Tree * */struct treeQelem { struct treeQelem *next; struct treeQelem *prev; int64_t node_addr; int64_t node_first_offset; pxd_t node_pxd; int8_t node_level; int8_t last_ext_uneven;};#define treeQ_elem_length sizeof(struct treeQelem)/*---------------------------------------------------------------------------- * type dupall_blkrec describes range of aggregate blocks which has been * found to have more than 1 inode claiming to own it. * */struct dupall_blkrec { int64_t first_blk; int64_t last_blk; uint8_t first_ref_resolved; uint8_t avail_byte; uint16_t owner_count; struct dupall_blkrec *next; struct dupall_blkrec *prev;};#define dupall_blkrec_length sizeof(struct dupall_blkrec)/*---------------------------------------------------------------------------- * * Each (4096 byte) page in the block map describes 32768 * blocks in the aggregate. *//* * the fsck Workspace Block Map control page * */struct fsck_blk_map_hdr { /* * the 1st 1024 bytes are the clrbblks to fsck * communication area */ struct fsckcbbl_record cbblrec; /* 128 */ char avail_0[896]; /* 896 */ /* 1024 byte boundary */ /* * the next 2048 bytes are the fsck block map * header area */ struct { char eyecatcher[8]; /* 8 */ int32_t last_entry_pos; /* 4 */ int32_t next_entry_pos; /* 4 */ char start_time[20]; /* 20 */ char end_time[20]; /* 20 */ int32_t return_code; /* 4 */ char *super_buff_addr; /* 4 -- for the dump reader */ char *agg_record_addr; /* 4 -- for the dump reader */ char *bmap_record_addr; /* 4 -- for the dump reader */ char avail_1[8]; /* 8 */ int64_t fscklog_agg_offset; /* 8 */ int8_t fscklog_full; /* 1 */ int8_t fscklog_buf_allocated; /* 1 */ int8_t fscklog_buf_alloc_err; /* 1 */ char avail_2[1]; /* 1 */ int32_t num_logwrite_errors; /* 4 */ char avail_3[32]; /* 32 */ struct fscklog_error logerr[125]; /* 1920 = 120 * 16 */ } hdr; /* subtotal, 2048 bytes */ /* * the last 1024 bytes are available */ char avail_5[1024]; /* 1024 */}; /* total: 4096 bytes */#define fbmh_eyecatcher_string "wspblkmp"/* * a page in the fsck Workspace Block Map */struct fsck_blk_map_page { uint32_t fsck_blkmap_words[1024]; /* 4096 bytes */};/*---------------------------------------------------------------- * structure blkmap_wspace describes the portion of the aggregate * record allocated for use when verifying * the aggregate block map. * */struct blkmap_wspace { uint32_t dmap_map[LPERDMAP]; /* bit map of blk allocations */ int8_t dmap_wsp_tree[TREESIZE - LPERDMAP]; int8_t dmap_wsp_leafs[LPERDMAP]; int8_t L0_wsp_tree[CTLTREESIZE - LPERCTL]; int8_t L0_wsp_leafs[LPERCTL]; int8_t L1_wsp_tree[CTLTREESIZE - LPERCTL]; int8_t L1_wsp_leafs[LPERCTL]; int8_t L2_wsp_tree[CTLTREESIZE - LPERCTL]; int8_t L2_wsp_leafs[LPERCTL]; int64_t AG_free[MAXAG];};/*---------------------------------------------------------------- * structure fsck_iag_record describes one Inode Allocation * Group belonging to an inode table in * the aggregate * */struct fsck_iag_record { uint32_t AG_num; uint32_t backed_inodes; uint32_t unused_backed_inodes; uint32_t unbacked_extents;};#define iag_record_length sizeof(struct fsck_iag_record)/*---------------------------------------------------------------- * structure fsck_ag_record describes one Allocation Group * as it relates to an inode table in the * aggregate * */struct fsck_ag_record { uint32_t backed_inodes; uint32_t unused_backed_inodes; int32_t frext_list_first; int32_t frext_list_last; int32_t frext_list_len; int32_t frino_list_first; int32_t frino_list_last; int32_t frino_list_len; int8_t frext_list_bad; int8_t frino_list_bad; char unused[14];};#define ag_record_length sizeof(struct fsck_ag_record)/*---------------------------------------------------------------- * structure fsck_iam_record describes one Inode Allocation Map * in the aggregate * */struct fsck_iam_record { int64_t first_leaf_offset; /* offset of first leaf for imap inode */ int8_t imap_is_rootleaf; int8_t friag_list_bad; char unused[2]; int32_t bkd_inodes; /* count of backed inodes */ int32_t unused_bkd_inodes; /* count of available backed inodes */ int32_t num_iags; /* number of IAGs in the inode tbl */ int32_t friag_list_last; int32_t friag_list_len; struct fsck_iag_record *iag_tbl; /* ptr to info by iag */ struct fsck_ag_record *ag_tbl; /* ptr to info by ag */};#define iam_record_length sizeof(struct fsck_iam_record)/*---------------------------------------------------------------- * structure fsck_inode_record describes one inode belonging to * the aggregate or to a fileset * in the aggregate * *//* * the possible values for inode_type * (since inode_type is 4 bits wide, valid range is 0-15) */#define unused_inode 0#define file_inode 1#define strm_descr_inode 2#define stream_inode 3#define directory_inode 4#define symlink_inode 5#define block_special_inode 6#define char_special_inode 7#define FIFO_inode 8#define SOCK_inode 9#define metadata_inode 14#define unrecognized_inode 15#define add_direntry_extension 'A'#define rmv_direntry_extension 'R'#define rmv_badentry_extension 'B'#define parent_extension 'P'struct fsck_inode_ext_record { char ext_type; /* 1 : extens type (see constants above) */ unsigned ino_type:4; /* .5: see constants above * describes the inonum inode. * This is only interesting when * type is rmv_direntry_extension. */ unsigned unused_byte:20; /* 2.5: unused */ struct fsck_inode_ext_record *next; /* * 4 : addr next extension record */ uint32_t inonum; /* 4 : inode number */};/* * the inode record data */struct fsck_inode_record { uint32_t inonum; /* 4.0 : key */ /* 3 : 24 flag bits */ unsigned in_use:1; unsigned selected_to_rls:1; unsigned crrct_link_count:1; unsigned crrct_prnt_inonum:1; unsigned adj_entries:1; unsigned cant_chkea:1; unsigned clr_ea_fld:1; unsigned clr_acl_fld:1; unsigned ignore_ea_blks:1; unsigned ignore_acl_blks:1; unsigned ignore_alloc_blks:1; unsigned inline_data_err:1; unsigned reconnect:1; unsigned unxpctd_prnts:1; unsigned badblk_inode:1; unsigned involved_in_dups:1; unsigned crrct_cumm_blks:1; unsigned rebuild_dirtable:1; unsigned inlineea_on:1; unsigned inlineea_off:1; unsigned check_dir_index:1; unsigned avail_flagbits:3; /* end of flag bits */ int8_t inode_type; /* 1 : see constants above */ int32_t link_count; /* 4 : Stored link count is added to this. * Decremented for each observed link. */ uint32_t parent_inonum; /* 4 : If this is a directory inode and * the unxpctd_prnts bit is set, then * this field contains the inode number * stored in the parent field on disk. * Otherwise, this is the inode number * of the first observed parent. */ int64_t cumm_blocks; /* 8 : number of blocks allocated to the * inode and, if this is a directory, to each * inode described in an entry */ int32_t dtree_level; /* 4 : distance, in the fileset directory tree, * from the root (inode 2) */ struct fsck_inode_ext_record *ext_rec; /* 4.0: extension record address */};#define inode_record_length sizeof(struct fsck_inode_record)#define inode_is_metadata( X ) \ ( (int8_t) ((X)->inode_type) == (int8_t) metadata_inode )/*---------------------------------------------------------------------------- * type inode_tbl_t is an array of pointers to inode records * * There is one of these tables for each allocated inode extent which * has at least one inode in use. * */struct inode_tbl_t { char eyecatcher[8]; /* 8.0 */ struct fsck_inode_record *inorectbl[32]; /* 128 */};#define inode_tbl_length sizeof( struct inode_tbl_t )/*---------------------------------------------------------------------------- * type inode_ext_tbl_t is an array of pointers to inode tables * * There is one of these tables for each allocated IAG which * has at least one allocated extent with an inode in use. * */struct inode_ext_tbl_t { char eyecatcher[8]; /* 8.0 */ struct inode_tbl_t *inotbl[128]; /* 512 */};#define inode_ext_tbl_length sizeof( struct inode_ext_tbl_t )/*---------------------------------------------------------------------------- * type IAG_tbl_t is an array of pointers to inode extent tables * * There is one of these tables for each fileset in the aggregate, * and is allocated dynamically when the number of IAGs in the * fileset Inode Map is known. * */struct IAG_tbl_t { char eyecatcher[8]; /* 8.0 */ struct inode_ext_tbl_t *inoext_tbl[1]; /* 4.0 */};/*---------------------------------------------------------------------------- * type wsp_ext_rec describes one extent of storage which fsck * has allocated for its workspace. * */struct wsp_ext_rec { struct wsp_ext_rec *next; int8_t from_high_memory; int8_t for_logredo; char avail[2]; uint32_t extent_length; char *extent_addr; uint32_t last_byte_used;};/*---------------------------------------------------------------------------- * type recon_buf_record describes one dnode I/O buffer used during * inode reconnect processing * */struct recon_buf_record { dtpage_t dnode_buf; struct recon_buf_record *stack_next; int64_t dnode_blkoff; int64_t dnode_byteoff; char reserved[12];};/*---------------------------------------------------------------------------- * type treeStack_record describes one stack element used during DASD * limits processing * */struct treeStack_record { struct fsck_inode_record *inorec; struct treeStack_record *next;};#define treeStack_elem_length sizeof(struct treeStack_record)/*---------------------------------------------------------------------------- * structure fsck_agg_record describes the aggregate */struct fsck_agg_record { char eyecatcher[8]; uint32_t ondev_jlog_fsblk_length; int64_t ondev_jlog_fsblk_offset; int64_t ondev_wsp_byte_length; int64_t ondev_wsp_byte_offset; uint32_t ondev_wsp_fsblk_length; int64_t ondev_wsp_fsblk_offset; uint32_t ondev_fscklog_fsblk_length; int64_t ondev_fscklog_fsblk_offset; int64_t ondev_fscklog_byte_length; int64_t ondev_fscklog_byte_offset; uint32_t log2_blksize; uint32_t blksperpg; uint32_t log2_blksperpg; uint32_t log2_blksperag; int64_t sb_agg_fsblk_length; uint32_t inode_stamp; /* taken from the agg self inode, every * in-use, valid inode must have a * matching di_inostamp. */ int inode_count; /* num inodes owned by the aggregate */ int inodes_inuse; /* num aggregate nodes now in use */ int fset_inodes_inuse; /* num fileset inodes in use */ int fset_inodes_seen; /* num fileset inodes scanned. */ int fset_inode_count; /* num inodes in the filesets */ int64_t dup_block_count; /* num multiply-allocated
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -