* \param aflags
*
*/
-void
+int
afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags)
{
struct dcache *tdp;
afs_warn("afsd: memory cache too large for available memory.\n");
afs_warn("afsd: AFS files cannot be accessed.\n\n");
dcacheDisabled = 1;
+ return code;
} else
afs_warn("Memory cache: Allocating %d dcache entries...",
aDentries);
cacheDiskType = AFS_FCACHE_TYPE_UFS;
afs_cacheType = &afs_UfsCacheOps;
}
+ return 0;
}
/*!
afs_int32 dynamic_vcaches)
{
afs_int32 i;
+ int code;
struct volume *tv;
AFS_STATCNT(afs_CacheInit);
afs_cacheFiles = afiles;
afs_cacheStats = astatSize;
afs_vcacheInit(astatSize);
- afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags);
+ code = afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags);
+ if (code) {
+ return code;
+ }
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)
/*
* Save current credentials for later access to disk cache files.
extern struct osi_file *afs_cacheInodep;
extern int DCHash(struct VenusFid *fid, afs_int32 chunk);
extern int DVHash(struct VenusFid *fid);
-extern void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
- int aflags);
+extern int afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
+ int aflags);
extern int afs_PutDCache(struct dcache *adc);
extern void afs_FlushDCache(struct dcache *adc);
extern void shutdown_dcache(void);
cparams.setTimeFlag = 0;
cparams.memCacheFlag = cacheFlags;
cparams.dynamic_vcaches = afsd_dynamic_vcaches;
- afsd_syscall(AFSOP_CACHEINIT, &cparams);
+ code = afsd_syscall(AFSOP_CACHEINIT, &cparams);
+ if (code) {
+ printf("%s: Error %d during cache init.\n", rn, code);
+ exit(1);
+ }
/* do it before we init the cache inodes */
if (enable_splitcache) {