From e04f324b5dc87391d9fc08820a4ff22b7dda84c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 16 May 2012 09:52:00 -0400 Subject: [PATCH] Windows: Apply MAX_FID_COUNT to AFS Redirector Provide consistency between the SMB path parser and the AFS redirector path processing by using the same constant, MAX_FID_COUNT, for both. MAX_FID_COUNT is the maximum number of unique file ids that can exist in a path after all mount points and symlinks have been expanded. The current value is 512. Change-Id: Ife1a29ce7c064c986589bc9e2836899864da2f76 Reviewed-on: http://gerrit.openafs.org/7412 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_vnodeops.c | 1 - src/WINNT/afsd/cm_vnodeops.h | 3 +++ src/WINNT/afsrdr/user/RDRFunction.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 411f53a4f7..36cefd47ce 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -1969,7 +1969,6 @@ long cm_NameI(cm_scache_t *rootSCachep, clientchar_t *pathp, long flags, int symlinkCount; /* count of # of symlinks traversed */ int extraFlag; /* avoid chasing mt pts for dir cmd */ int phase = 1; /* 1 = tidPathp, 2 = pathp */ -#define MAX_FID_COUNT 512 cm_fid_t fids[MAX_FID_COUNT]; /* array of fids processed in this path walk */ int fid_count = 0; /* number of fids processed in this path walk */ int i; diff --git a/src/WINNT/afsd/cm_vnodeops.h b/src/WINNT/afsd/cm_vnodeops.h index 07080d2854..8d2e84de45 100644 --- a/src/WINNT/afsd/cm_vnodeops.h +++ b/src/WINNT/afsd/cm_vnodeops.h @@ -59,6 +59,9 @@ typedef int (*cm_DirFuncp_t)(struct cm_scache *, struct cm_dirEntry *, void *, #define CM_PREFIX_VOL "@vol:" #define CM_PREFIX_VOL_CCH 5 +/* Maximum number of expanded components in a path */ +#define MAX_FID_COUNT 512 + /* arrays */ extern fschar_t cm_foldUpper[]; diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index 0f8d99a4ae..a53dcf6f9f 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -148,8 +148,8 @@ RDR_SetInitParams( OUT AFSRedirectorInitInfo **ppRedirInitInfo, OUT DWORD * pRed (*ppRedirInitInfo)->GlobalFileId.Hash = cm_data.rootFid.hash; (*ppRedirInitInfo)->ExtentCount.QuadPart = cm_data.buf_nbuffers; (*ppRedirInitInfo)->CacheBlockSize = cm_data.blockSize; - (*ppRedirInitInfo)->MaxPathLinkCount = 512; /* this needs to become a registry value */ - (*ppRedirInitInfo)->NameArrayLength = 32; /* this needs to become a registry value */ + (*ppRedirInitInfo)->MaxPathLinkCount = MAX_FID_COUNT; + (*ppRedirInitInfo)->NameArrayLength = MAX_FID_COUNT; if (cm_virtualCache || cm_data.bufferSize <= maxMemoryCacheSize) { osi_Log0(afsd_logp, "RDR_SetInitParams Initializing Memory Extent Interface"); (*ppRedirInitInfo)->MemoryCacheOffset.QuadPart = (LONGLONG)cm_data.bufDataBaseAddress;