2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id: validator.h 25683 2007-04-09 05:45:37Z sonic $
7 * -date------ -name------------------- -description-----------------------------
8 * 02-jan-2008 [Tomasz Wiszkowski] created disk validation procedures
9 * 04-jan-2008 [Tomasz Wiszkowski] corrected tabulation
10 * 07-jan-2008 [Tomasz Wiszkowski] partitioned procedures to prepare non-recursive scan
19 * call this function to initiate validation
21 LONG
launchValidator(struct AFSBase
*afsbase
, struct Volume
*volume
);
22 LONG
checkValid(struct AFSBase
*afs
, struct Volume
*vol
);
26 /********************************************************
28 ********************************************************/
40 /* elements regarding to currently validated file */
46 /********************************************************
48 ********************************************************/
72 ValFlg_DisableReq_MaybeNotAFS
= 1, /* consider these FLAGS */
73 ValFlg_DisableReq_DataLossImminent
= 2, /* next value = 4 */
77 * validation entry point for new process
79 LONG
validate(struct AFSBase
*, struct Volume
*);
82 * initiate validation once structures are initially ready.
83 * walks through all structures and collects used blocks
85 ValidationResult
start_superblock(DiskStructure
*ds
);
89 * returns 0 if checksum is ok, otherwise a new checksum.
90 * a new checksum is recorded to the structure automatically,
93 ULONG
verify_checksum(DiskStructure
*ds
, ULONG
* block
);
94 ULONG
verify_bm_checksum(DiskStructure
*ds
, ULONG
* block
);
97 * various per-block operations:
98 * - check_block does the most generic checks (checksum, block type, range and stuff like that)
99 * - collect_bitmap is called with root block where we begin root block acquisition - nonrecursive
101 ValidationResult
check_block(DiskStructure
* ds
, struct BlockCache
* block
);
102 ValidationResult
collect_bitmap(DiskStructure
* ds
, struct BlockCache
* block
);
103 ValidationResult
collect_file_extensions(DiskStructure
* ds
, struct BlockCache
* block
);
106 * collect all bitmap blocks, starting with first extension block
107 * all root blocks are already collected
109 ValidationResult
collect_directory_blocks(DiskStructure
*ds
, ULONG ext
);
112 * record bitmap back to disk
114 void record_bitmap(DiskStructure
* ds
);
117 * call to allocate bitmap in disk structure.
118 * returns 0 if all went ok, otherwise other value
119 * (just in case someone needed error handling here)
121 LONG
bm_allocate_bitmap(DiskStructure
*ds
);
122 void bm_free_bitmap(DiskStructure
*ds
);
125 * bitmap operations ;]
127 BitmapResult
bm_mark_block(DiskStructure
*ds
, ULONG block
);
132 void bm_add_bitmap_block(DiskStructure
*ds
, ULONG blk
);
133 void bm_add_bitmap_extension_block(DiskStructure
*ds
, ULONG blk
);
135 #endif /* __AROS__ */
136 #endif /* VALIDATOR_H */