From 7d0a0b66cca5dfd7f9c42032393632abadb1aa76 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 25 Apr 2012 18:05:01 -0400 Subject: [PATCH] Windows: fs getcacheparms The get cache params output is supposed to include two values: . the size of the cache . the size of the cache in use Windows no longer has a concept of an unused cache buffer. All buffers are inserted onto the freelist and are available for recycling when the AFSCache file is created. Instead of reporting the used cache space as 0K, report it as the full cache in use. It is likely to disturb users less. Change-Id: I6c1475f26e561d245bfa2b658c77ba683f735bb5 Reviewed-on: http://gerrit.openafs.org/7284 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_ioctl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index ead5cc1..495e973 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -1426,13 +1426,16 @@ cm_IoctlGetCacheParms(struct cm_ioctl *ioctlp, struct cm_user *userp) memset(&parms, 0, sizeof(parms)); - /* first we get, in 1K units, the cache size */ + /* the cache size */ parms.parms[0] = cm_data.buf_nbuffers * (cm_data.buf_blockSize / 1024); - /* and then the actual # of buffers in use (not in the free list, I guess, - * will be what we do). + /* + * the used cache space. this number is not available on windows. + * the cm_data.buf_freeCount represents all buffers eligible for recycling. + * so we report the entire cache in use since reporting 0 in use disturbs + * many users. */ - parms.parms[1] = (cm_data.buf_nbuffers - cm_data.buf_freeCount) * (cm_data.buf_blockSize / 1024); + parms.parms[1] = cm_data.buf_nbuffers * (cm_data.buf_blockSize / 1024); memcpy(ioctlp->outDatap, &parms, sizeof(parms)); ioctlp->outDatap += sizeof(parms); -- 1.9.4