STABLE14-windows-virtual-memory-20041224

* The variable used to determine whether a file or virtual memory
    mapped cache is used was not properly initialized to a default
    value. If the registry setting "NonPersistentCaching" was not
    set, the choice would be random.   Properly initialized to be
    "file".

 * The memory mapped view was never unmapped before closing the file
   at service shutdown.  This is now properly cleaned up.

 * Default location of Cache file is now %TEMP%\AFSCache


(cherry picked from commit d3d4af7795dd7371750bfdb9612b6419561cf32b)
This commit is contained in:
Jeffrey Altman 2005-01-31 03:53:21 +00:00 committed by Derrick Brashear
parent 70389dbf83
commit 5e90243279
9 changed files with 55 additions and 14 deletions

View File

@ -1,3 +1,15 @@
Since 1.3.77:
* The variable used to determine whether a file or virtual memory
mapped cache is used was not properly initialized to a default
value. If the registry setting "NonPersistentCaching" was not
set, the choice would be random. Properly initialized to be
"file".
* The memory mapped view was never unmapped before closing the file
at service shutdown. This is now properly cleaned up.
* Default location of Cache file is now %TEMP%\AFSCache
Since 1.3.76:
* A bug affecting new installations of 1.3.75/76 would result in

View File

@ -463,7 +463,18 @@ As of 1.3.75, a new registry value, HKLM\SOFTWARE\OpenAFS\Client
filenames using the ANSI Code Page instead of the OEM Code Page. The ANSI
Code Page is a compatible superset of Latin-1. This setting is not the
default setting because making this change would prevent OpenAFS for Windows
from being able to access filenames containing the above characters.
from being able to access filenames containing the above characters which
were created without this setting.
30. There is a known issue with storing Windows Roaming Profiles when
the profile contains either directories or files with names which cannot
be represented in the local OEM character set. In this case, attempts
to write the profile back to AFS will fail. OpenAFS for Windows does
not currently support UNICODE. To avoid this problem some sites run
logoff scripts (assigned by group policy) which rename all files to use
only the supported characters for the locale.
------------------------------------------------------------------------

View File

@ -388,7 +388,7 @@ int afsd_InitCM(char **reasonP)
long maxcpus;
long ltt, ltto;
long rx_mtu, rx_nojumbo;
long virtualCache;
long virtualCache = 0;
char rootCellName[256];
struct rx_service *serverp;
static struct rx_securityClass *nullServerSecurityClassp;
@ -622,9 +622,12 @@ int afsd_InitCM(char **reasonP)
}
afsi_log("Cache path %s", cm_CachePath);
} else {
GetWindowsDirectory(cm_CachePath, sizeof(cm_CachePath));
cm_CachePath[2] = 0; /* get drive letter only */
StringCbCatA(cm_CachePath, sizeof(cm_CachePath), "\\AFSCache");
dummyLen = ExpandEnvironmentStrings("%TEMP%\AFSCache", cm_CachePath, sizeof(cm_CachePath));
if (dummyLen > sizeof(cm_CachePath)) {
afsi_log("Cache path [%%TEMP%%\\AFSCache] longer than %d after expanding env strings",
sizeof(cm_CachePath));
osi_panic("CachePath too long", __FILE__, __LINE__);
}
afsi_log("Default cache path %s", cm_CachePath);
}

View File

@ -1181,6 +1181,7 @@ void afsd_Main(DWORD argc, LPTSTR *argv)
DismountGlobalDrives();
smb_Shutdown();
rx_Finalize();
buf_Shutdown();
#ifdef REGISTER_POWER_NOTIFICATIONS
/* terminate thread used to flush cache */

View File

@ -86,6 +86,9 @@ int buf_cacheType = CM_BUF_CACHETYPE_FILE;
static
HANDLE CacheHandle;
static
VOID * ViewOfFile;
static
SYSTEM_INFO sysInfo;
#endif /* !DJGPP */
@ -334,11 +337,11 @@ long buf_Init(cm_buf_ops_t *opsp)
}
return CM_ERROR_INVAL;
}
data = MapViewOfFile(hm,
FILE_MAP_ALL_ACCESS,
0, 0,
buf_nbuffers * buf_bufferSize);
if (data == NULL) {
ViewOfFile = MapViewOfFile(hm,
FILE_MAP_ALL_ACCESS,
0, 0,
buf_nbuffers * buf_bufferSize);
if (ViewOfFile == NULL) {
afsi_log("Error mapping view of file: 0x%X", GetLastError());
if (hf != INVALID_HANDLE_VALUE)
CloseHandle(hf);
@ -346,6 +349,8 @@ long buf_Init(cm_buf_ops_t *opsp)
return CM_ERROR_INVAL;
}
CloseHandle(hm);
data = ViewOfFile;
#else
/* djgpp doesn't support memory mapped files */
data = malloc(buf_nbuffers * buf_bufferSize);
@ -406,6 +411,13 @@ long buf_Init(cm_buf_ops_t *opsp)
return 0;
}
void
buf_Shutdown(void)
{
UnmapViewOfFile(ViewOfFile);
CloseHandle(CacheHandle);
}
/* add nbuffers to the buffer pool, if possible.
* Called with no locks held.
*/

View File

@ -142,6 +142,8 @@ extern cm_buf_t **buf_fileHashTablepp;
extern long buf_Init(cm_buf_ops_t *);
extern void buf_Shutdown(void);
extern long buf_CountFreeList(void);
extern void buf_Release(cm_buf_t *);

View File

@ -982,7 +982,7 @@ void cm_AFSFidFromFid(AFSFid *afsFidp, cm_fid_t *fidp)
void cm_HoldSCacheNoLock(cm_scache_t *scp)
{
#ifdef NOLOCK_ASSERT
osi_assert(scp->refCount > 0);
osi_assert(scp->refCount >= 0);
#endif
scp->refCount++;
}
@ -990,7 +990,7 @@ void cm_HoldSCacheNoLock(cm_scache_t *scp)
void cm_HoldSCache(cm_scache_t *scp)
{
lock_ObtainWrite(&cm_scacheLock);
osi_assert(scp->refCount > 0);
osi_assert(scp->refCount >= 0);
scp->refCount++;
lock_ReleaseWrite(&cm_scacheLock);
}

View File

@ -101,7 +101,7 @@
<?error AFSDEV_BUILDTYPE is not set in the environment.?>
<?endif?>
<!-- We are including debug symbols anyway. Undefine this for a leaner installer witout debug syms. -->
<!-- We are including debug symbols anyway. Undefine this for a leaner installer without debug syms. -->
<?define DebugSyms?>
<!-- Parameters for the features containing debug symbols -->

View File

@ -80,7 +80,7 @@ LIB = $(AFSDEV_LIB)
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=3
AFSPRODUCT_VER_PATCH=7700
AFSPRODUCT_VER_PATCH=7701
AFSPRODUCT_VER_BUILD=0
# For MSI installer, each major release should have a different GUID