mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 23:40:13 +00:00
windows-fs-getcacheparms-20070515
fix output of cache parms now that they are 64-bit
This commit is contained in:
parent
c78b4c61f7
commit
11cec9e764
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user