*/
struct afs_fheader theader;
- theader.magic = AFS_FHMAGIC;
- theader.firstCSize = AFS_FIRSTCSIZE;
- theader.otherCSize = AFS_OTHERCSIZE;
- theader.version = AFS_CI_VERSION;
- theader.dataSize = sizeof(struct fcache);
+ afs_InitFHeader(&theader);
afs_osi_Write(afs_cacheInodep, 0, &theader, sizeof(theader));
}
ReleaseWriteLock(&afs_xdcache);
return 0;
}
+void
+afs_InitFHeader(struct afs_fheader *aheader)
+{
+ memset(aheader, 0, sizeof(*aheader));
+ aheader->magic = AFS_FHMAGIC;
+ aheader->version = AFS_CI_VERSION;
+ aheader->dataSize = sizeof(struct fcache);
+ aheader->firstCSize = AFS_FIRSTCSIZE;
+ aheader->otherCSize = AFS_OTHERCSIZE;
+}
+
/*
* afs_InitCacheInfo
*
}
if (!goodFile) {
/* write out a good file label */
- theader.magic = AFS_FHMAGIC;
- theader.firstCSize = AFS_FIRSTCSIZE;
- theader.otherCSize = AFS_OTHERCSIZE;
- theader.dataSize = sizeof(struct fcache);
- theader.version = AFS_CI_VERSION;
+ afs_InitFHeader(&theader);
afs_osi_Write(tfile, 0, &theader, sizeof(theader));
/*
* Truncate the rest of the file, since it may be arbitrarily
afs_int32 aflags, afs_int32 ninodes,
afs_int32 nusers, afs_int32 dynamic_vcaches);
extern void afs_ComputeCacheParms(void);
+extern void afs_InitFHeader(struct afs_fheader *aheader);
extern int afs_InitCacheInfo(char *afile);
extern int afs_InitVolumeInfo(char *afile);
extern int afs_InitCellInfo(char *afile);