windows-fs-getcacheparms-20070515

fix output of cache parms now that they are 64-bit
This commit is contained in:
Jeffrey Altman 2007-05-15 21:19:37 +00:00
parent c78b4c61f7
commit 11cec9e764
3 changed files with 11 additions and 12 deletions

View File

@ -40,6 +40,11 @@ typedef struct cm_SSetPref {
struct cm_SPref servers[1];/* we overrun this array intentionally...*/
} cm_SSetPref_t;
#define CM_IOCTLCACHEPARMS 16
typedef struct cm_cacheParms {
afs_uint64 parms[CM_IOCTLCACHEPARMS];
} cm_cacheParms_t;
#define MAXNUMSYSNAMES 16 /* max that current constants allow */
#define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */

View File

@ -2277,28 +2277,27 @@ SetCacheSizeCmd(struct cmd_syndesc *as, char *arock)
return 0;
}
#define MAXGCSIZE 16
static int
GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
afs_uint64 parms[MAXGCSIZE];
cm_cacheParms_t parms;
memset(parms, 0, sizeof(parms));
memset(&parms, 0, sizeof(parms));
blob.in = NULL;
blob.in_size = 0;
blob.out_size = sizeof(parms);
blob.out = (char *) parms;
blob.out = (char *) &parms;
code = pioctl(0, VIOCGETCACHEPARMS, &blob, 1);
if (code) {
Die(errno, NULL);
return 1;
}
printf("AFS using %d of the cache's available %d 1K byte blocks.\n",
parms[1], parms[0]);
if (parms[1] > parms[0])
printf("AFS using %I64u of the cache's available %I64u 1K byte blocks.\n",
parms.parms[1], parms.parms[0]);
if (parms.parms[1] > parms.parms[0])
printf("[Cache guideline temporarily deliberately exceeded; it will be adjusted down but you may wish to increase the cache size.]\n");
return 0;
}

View File

@ -41,11 +41,6 @@ struct sbstruct {
int sb_default;
};
#define CM_IOCTLCACHEPARMS 16
typedef struct cm_cacheParms {
afs_uint64 parms[CM_IOCTLCACHEPARMS];
} cm_cacheParms_t;
/* set cell flags */
#define CM_SETCELLFLAG_SUID 2