06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

verify_vol pHILE+ <strong>System</strong> <strong>Calls</strong><br />

(correct fault) should be returned only if the FDB indicates the fault is fixable (refer<br />

to the FDB description below). If status = 1 is returned for a non-fixable fault, it is<br />

ignored and verification continues.<br />

If verify_vol() is being used simply to verify volume correctness, then, when<br />

called, faultp() can return a status of 0, which continues the rest of volume<br />

verification, or a status of 2, which terminates verify_vol() and returns an error<br />

to the caller.<br />

verify_vol() can also be integrated into a “volume repair” utility with an operator<br />

interface. This utility should implement faultp() so that it will<br />

■ Display each fault in detail;<br />

■ Indicate if the fault is fixable;<br />

■ And if so, ask the user if he wants it fixed;<br />

■ And if so, return status = 1 to verify_vol().<br />

Faults that are not fixable may require additional user action. For example, you may<br />

perform the following steps repeatedly:<br />

1. Use verify_vol() to correct all fixable errors and obtain a list of non-fixable<br />

errors.<br />

2. Examine, copy, and delete the affected files, as required.<br />

When step 1 produces no more faults, you can consider the volume corrected.<br />

The Fault Descriptor Block (FDB)<br />

The structure fault_desc_block defines the FDB in phile.h as follows:<br />

typedef struct fault_desc_block {<br />

unsigned long fdb_code; /* fault code */<br />

unsigned long fdb_fn1; /* file number for file 1 */<br />

unsigned long fdb_fn2; /* file number for file 2 */<br />

char *fdb_path1; /* pathname for file 1 */<br />

char *fdb_path2; /* pathname for file 2 */<br />

unsigned long fdb_bn; /* block number */<br />

unsigned long fdb_fixable;/* fault fixable indicator */<br />

} FAULT_DESC_BLOCK;<br />

2-132 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!