2
* Copyright (c) International Business Machines Corp., 2000
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12
* the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* MODULE_NAME: xfsckint.h
20
* prototypes for functions NOT INTENDED FOR CONSUMPTION
21
* OUTSIDE THE FSCK UTILITY
23
* COMPONENT_NAME: jfs utilities
40
---------------------- functions defined in fsckbmap ---------------------
43
retcode_t rebuild_blkall_map ( void );
45
retcode_t verify_blkall_map ( void );
48
---------------------- functions defined in fsckconn ---------------------
51
int32_t adjust_parents ( fsck_inode_recptr, inoidx_t );
53
int32_t check_connectedness ( void );
55
int32_t check_dir_integrity ( void );
57
int32_t check_link_counts ( void );
60
---------------------- functions defined in fsckdire ---------------------
63
int32_t fsck_dtDelete( dinode_t *, component_t *, uint32_t * );
65
int32_t fsck_dtInsert( dinode_t *, component_t *, uint32_t * );
68
---------------------- functions defined in fsckdtre ---------------------
71
retcode_t direntry_add ( dinode_t *, uint32_t, UniChar * );
73
retcode_t direntry_get_inonum ( uint32_t, int, UniChar *, int,
74
UniChar *, uint32_t *);
76
retcode_t direntry_get_objnam ( uint32_t, uint32_t, int *, UniChar *);
78
retcode_t direntry_remove ( dinode_t *, uint32_t );
80
retcode_t dTree_processing ( dinode_t *, inoidx_t,fsck_inode_recptr,
81
fsck_msg_info_ptr, int );
83
retcode_t dTree_search( dinode_t *, UniChar *, reg_idx_t, UniChar *,
84
reg_idx_t, dtslot_t **, int8_t *, fsck_inode_recptr );
86
retcode_t find_first_dir_leaf ( dinode_t *, dtpage_t **, fsblkidx_t *,
89
void init_dir_tree( dtroot_t * );
91
retcode_t process_valid_dir_data ( dinode_t *,inoidx_t, fsck_inode_recptr,
92
fsck_msg_info_ptr, int );
94
retcode_t reconnect_fs_inodes( void );
97
---------------------- functions defined in fsckimap ---------------------
100
retcode_t AIS_redundancy_check( void );
102
retcode_t AIS_replication( void );
104
retcode_t rebuild_agg_iamap ( void );
106
retcode_t rebuild_fs_iamaps ( void );
108
retcode_t record_dupchk_inode_extents ( void );
110
retcode_t verify_agg_iamap ( void );
112
retcode_t verify_fs_iamaps ( void );
115
---------------------- functions defined in fsckino ---------------------
118
#define inode_type_recognized(iptr)\
119
( ISDIR(iptr->di_mode) || \
120
ISREG(iptr->di_mode) || \
121
ISLNK(iptr->di_mode) || \
122
ISBLK(iptr->di_mode) || \
123
ISCHR(iptr->di_mode) || \
124
ISFIFO(iptr->di_mode)|| \
125
ISSOCK(iptr->di_mode) )
127
retcode_t backout_ACL ( dinode_t *, fsck_inode_recptr );
129
retcode_t backout_EA ( dinode_t *, fsck_inode_recptr );
131
retcode_t calculate_dasd_used ( void );
133
retcode_t clear_ACL_field ( fsck_inode_recptr, dinode_t * );
135
retcode_t clear_EA_field ( fsck_inode_recptr, dinode_t * );
137
retcode_t display_path( inoidx_t, int, uint32_t, char *,
140
retcode_t display_paths ( inoidx_t, fsck_inode_recptr, fsck_msg_info_ptr );
142
retcode_t first_ref_check_inode ( dinode_t *, inoidx_t, fsck_inode_recptr,
145
retcode_t get_path ( inoidx_t, uint32_t, char **, fsck_inode_recptr );
147
retcode_t in_inode_data_check( fsck_inode_recptr, fsck_msg_info_ptr );
149
retcode_t inode_is_in_use ( dinode_t *, uint32_t );
151
retcode_t parent_count( fsck_inode_recptr );
153
retcode_t record_valid_inode ( dinode_t *, inoidx_t, fsck_inode_recptr,
156
retcode_t release_inode ( inoidx_t, fsck_inode_recptr, dinode_t * );
158
retcode_t unrecord_valid_inode ( dinode_t *, inoidx_t, fsck_inode_recptr,
161
retcode_t validate_ACL ( dinode_t *, inoidx_t, fsck_inode_recptr,
164
retcode_t validate_dasd_used ( void );
166
retcode_t validate_data ( dinode_t *, inoidx_t, fsck_inode_recptr,
169
retcode_t validate_dir_data ( dinode_t *, inoidx_t, fsck_inode_recptr,
172
retcode_t validate_EA ( dinode_t *, inoidx_t, fsck_inode_recptr,
175
retcode_t validate_record_fileset_inode ( uint32_t, inoidx_t, dinode_t *,
179
---------------------- functions defined in fsckmeta ---------------------
182
retcode_t agg_clean_or_dirty ( void );
184
retcode_t fatal_dup_check ( void );
186
retcode_t first_ref_check_agg_metadata ( void );
188
retcode_t first_ref_check_fixed_metadata ( void );
190
retcode_t first_ref_check_fs_metadata ( void );
192
retcode_t first_ref_check_inode_extents ( void );
194
retcode_t record_fixed_metadata (void );
196
retcode_t replicate_superblock ( void );
198
retcode_t validate_fs_metadata ( void );
200
retcode_t validate_repair_superblock ( void );
202
retcode_t validate_select_agg_inode_table ( void );
205
---------------------- functions defined in fsckmsgs ---------------------
208
void fsck_send_msg( int, int, int );
211
---------------------- functions defined in fsckpfs ---------------------
214
retcode_t ait_node_get ( fsblkidx_t, xtpage_t * );
216
retcode_t ait_node_put ( fsblkidx_t, xtpage_t * );
218
retcode_t ait_special_read_ext1 ( int );
220
retcode_t blkmap_find_bit( fsblkidx_t, mappgidx_t *, reg_idx_t *, fsck_bitmask_ptr );
222
retcode_t blkmap_flush( void );
224
retcode_t blkmap_get_ctl_page ( blk_cntrlptr );
226
retcode_t blkmap_get_page( mappgidx_t, blk_pageptr *);
228
retcode_t blkmap_put_ctl_page ( blk_cntrlptr );
230
retcode_t blkmap_put_page( mappgidx_t );
232
retcode_t blktbl_ctl_page_put ( dbmap_t * );
234
retcode_t blktbl_dmap_get( fsblkidx_t, dmap_t ** );
236
retcode_t blktbl_dmap_put( dmap_t * );
238
retcode_t blktbl_dmaps_flush( void );
240
retcode_t blktbl_Ln_page_get( int8_t, fsblkidx_t, dmapctl_t ** );
242
retcode_t blktbl_Ln_page_put( dmapctl_t * );
244
retcode_t blktbl_Ln_pages_flush( void );
246
retcode_t close_volume( void );
248
retcode_t default_volume( void );
250
retcode_t dnode_get ( fsblkidx_t, reg_idx_t, dtpage_t ** );
252
retcode_t ea_get ( fsblkidx_t, reg_idx_t, char *, reg_idx_t *,
253
reg_idx_t *, agg_byteidx_t * );
255
retcode_t fscklog_put_buffer ( void );
257
retcode_t iag_get ( int, int, int, iagno_t, iag_t ** );
259
retcode_t iag_get_first ( int, int, int, iag_t ** );
261
retcode_t iag_get_next ( iag_t ** );
263
retcode_t iag_put ( iag_t * );
265
retcode_t iags_flush ( void );
267
retcode_t inodes_flush ( void );
269
retcode_t inode_get ( int, int, inoidx_t, dinode_t ** );
271
retcode_t inode_get_first_fs ( int, inoidx_t *,dinode_t ** );
273
retcode_t inode_get_next ( inoidx_t *, dinode_t ** );
275
retcode_t inode_put ( dinode_t * );
277
retcode_t inotbl_get_ctl_page ( int, dinomap_t ** );
279
retcode_t inotbl_put_ctl_page ( int, dinomap_t * );
281
retcode_t mapctl_get ( fsblkidx_t, void ** );
283
retcode_t mapctl_put ( void * );
285
retcode_t mapctl_flush ( void );
287
retcode_t node_get ( fsblkidx_t, xtpage_t ** );
289
retcode_t open_volume ( char * );
291
retcode_t readwrite_device( agg_byteidx_t, reg_idx_t, reg_idx_t *,
294
retcode_t recon_dnode_assign ( fsblkidx_t, dtpage_t ** );
296
retcode_t recon_dnode_get( fsblkidx_t, dtpage_t ** );
298
retcode_t recon_dnode_put( dtpage_t * );
300
retcode_t recon_dnode_release( dtpage_t * );
303
---------------------- functions defined in fsckruns ---------------------
306
void fsck_hbeat_start ( void );
308
void fsck_hbeat_stop ( void );
311
---------------------- functions defined in fsckwsp ---------------------
314
int alloc_vlarge_buffer( void );
316
int alloc_wrksp( uint32_t, int, int, void ** ); /* called from both fsck modules
317
* and from logredo modules
320
retcode_t blkall_decrement_owners ( fsblkidx_t );
322
retcode_t blkall_increment_owners ( fsblkidx_t );
324
retcode_t blkall_ref_check ( fsblkidx_t, int * );
326
retcode_t dire_buffer_alloc( dtpage_t ** );
328
retcode_t dire_buffer_release( dtpage_t * );
330
retcode_t directory_buffers_alloc( void );
332
retcode_t directory_buffers_release( void );
334
retcode_t dtreeQ_dequeue( dtreeQ_elem_ptr * );
336
retcode_t dtreeQ_enqueue( dtreeQ_elem_ptr );
338
retcode_t dtreeQ_get_elem ( dtreeQ_elem_ptr * );
340
retcode_t dtreeQ_rel_elem ( dtreeQ_elem_ptr );
342
retcode_t establish_agg_workspace ( void );
344
retcode_t establish_ea_iobuf ( void );
346
retcode_t establish_fs_workspace ( void );
348
retcode_t establish_io_buffers ( void );
350
retcode_t establish_wsp_block_map_ctl ( void );
352
retcode_t extent_record ( fsblkidx_t, fsblkidx_t );
354
retcode_t extent_unrecord ( fsblkidx_t, fsblkidx_t );
356
retcode_t fsck_alloc_fsblks ( int32_t, fsblkidx_t * );
358
retcode_t fsck_dealloc_fsblks ( int32_t, fsblkidx_t );
360
retcode_t fscklog_end ( void );
362
retcode_t fscklog_init ( void );
364
retcode_t fscklog_start ( void );
366
retcode_t get_inode_extension ( fsck_inode_extptr * );
368
retcode_t get_inorecptr ( int, int, inoidx_t, fsck_inode_recptr * );
370
retcode_t get_inorecptr_first ( int, inoidx_t *, fsck_inode_recptr * );
372
retcode_t get_inorecptr_next ( int, inoidx_t *, fsck_inode_recptr * );
374
retcode_t init_agg_record ( void );
376
retcode_t process_extent( fsck_inode_recptr, uint32_t, fsblkidx_t, int8_t,
377
int8_t, fsck_msg_info_ptr, uint32_t *, int8_t *, int );
379
retcode_t release_inode_extension ( fsck_inode_extptr );
381
retcode_t release_logredo_allocs( void );
383
retcode_t temp_inode_buf_alloc( char ** );
385
retcode_t temp_inode_buf_release( char * );
387
retcode_t temp_node_buf_alloc( char ** );
389
retcode_t temp_node_buf_release( char * );
391
retcode_t treeQ_dequeue( treeQ_elem_ptr * );
393
retcode_t treeQ_enqueue( treeQ_elem_ptr );
395
retcode_t treeQ_get_elem ( treeQ_elem_ptr * );
397
retcode_t treeQ_rel_elem ( treeQ_elem_ptr );
399
retcode_t treeStack_pop ( fsck_inode_recptr * );
401
retcode_t treeStack_push ( fsck_inode_recptr );
403
retcode_t workspace_release ( void );
406
---------------------- functions defined in fsckxtre ---------------------
409
retcode_t find_first_leaf ( dinode_t *, xtpage_t **, fsblkidx_t *,
410
int8_t *, int8_t * );
412
retcode_t init_xtree_root( dinode_t * );
414
retcode_t process_valid_data ( dinode_t *, inoidx_t, fsck_inode_recptr,
415
fsck_msg_info_ptr, int );
417
retcode_t xTree_processing( dinode_t *, inoidx_t, fsck_inode_recptr,
418
fsck_msg_info_ptr, int );
420
retcode_t xTree_search( dinode_t *, fsblkidx_t, xad_t **, int8_t * );
423
---------------------- functions defined in xchkdsk.c ---------------------
426
void report_readait_error( retcode_t, retcode_t, int );