From 900dc5b31baea50370fba93b1f96002ad6652c8d Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 20 Jan 2010 11:38:43 -0500 Subject: [PATCH] switch to always attempting cache-config-by-path solve the "are we built for linux fh or inode" problem: just always use path. Change-Id: I076ee495b29e4a2dc964ce04001f86e100528fb6 Reviewed-on: http://gerrit.openafs.org/1133 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afsd/afsd.c | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index c70990d23..67106ea7e 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -2309,21 +2309,44 @@ mainproc(struct cmd_syndesc *as, void *arock) */ if (afsd_debug) printf - ("%s: Calling AFSOP_CACHEINODE for each of the %d files in '%s'\n", + ("%s: Calling AFSOP_CACHEFILE for each of the %d files in '%s'\n", rn, cacheFiles, cacheBaseDir); - if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) /* ... and again ... */ + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) { + /* ... and again ... */ + int nocachefile = 0; for (currVFile = 0; currVFile < cacheFiles; currVFile++) { + if (!nocachefile) { + sprintf(fullpn_VFile, "%s/D%d/V%d", cacheBaseDir, dir_for_V[currVFile], currVFile); + code = call_syscall(AFSOP_CACHEFILE, fullpn_VFile); + if (code) { + if (currVFile == 0) { + if (afsd_debug) + printf + ("%s: Calling AFSOP_CACHEINODE for each of the %d files in '%s'\n", + rn, cacheFiles, cacheBaseDir); + nocachefile = 1; + } else { + printf + ("%s: Error calling AFSOP_CACHEFILE for '%s'\n", + rn, fullpn_VFile); + exit(1); + } + } else { + continue; + } + /* fall through to setup-by-inode */ + } #ifdef AFS_SGI62_ENV call_syscall(AFSOP_CACHEINODE, (afs_uint32) (inode_for_V[currVFile] >> 32), (afs_uint32) (inode_for_V[currVFile] & 0xffffffff)); -#else -#if defined(LINUX_USE_FH) || defined(AFS_CACHE_VNODE_PATH) - sprintf(fullpn_VFile, "%s/D%d/V%d", cacheBaseDir, dir_for_V[currVFile], currVFile); - call_syscall(AFSOP_CACHEFILE, fullpn_VFile); -#else +#elif !(defined(LINUX_USE_FH) || defined(AFS_CACHE_VNODE_PATH)) call_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]); -#endif +#else + printf + ("%s: Error calling AFSOP_CACHEINODE: not configured\n", + rn); + exit(1); #endif } -- 2.39.5