MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfCheckParent

Function adfCheckParent

dep/adflib/src/adf_salv.c:157–175  ·  view source on GitHub ↗

* adfCheckParent * */

Source from the content-addressed store, hash-verified

155 *
156 */
157RETCODE adfCheckParent(struct Volume* vol, SECTNUM pSect)
158{
159 struct GenBlock block;
160
161 if (adfIsBlockFree(vol, pSect)) {
162 (*adfEnv.wFct)("adfCheckParent : parent doesn't exists");
163 return RC_ERROR;
164 }
165
166 /* verify if parent is a DIR or ROOT */
167 adfReadGenBlock(vol, pSect, &block);
168 if ( block.type!=T_HEADER
169 || (block.secType!=ST_DIR && block.secType!=ST_ROOT) ) {
170 (*adfEnv.wFct)("adfCheckParent : parent secType is incorrect");
171 return RC_ERROR;
172 }
173
174 return RC_OK;
175}
176
177
178/*

Callers 2

adfUndelDirFunction · 0.85
adfUndelFileFunction · 0.85

Calls 2

adfIsBlockFreeFunction · 0.85
adfReadGenBlockFunction · 0.85

Tested by

no test coverage detected