]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-fs-getcacheparms-20070515
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 15 May 2007 21:19:37 +0000 (21:19 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 15 May 2007 21:19:37 +0000 (21:19 +0000)
fix output of cache parms now that they are 64-bit

src/WINNT/afsd/cm_ioctl.h
src/WINNT/afsd/fs.c
src/WINNT/afsd/smb_iocons.h

index 01c7b7de2ab4c13ee829da91af264da7231ad20b..bfc98ef4c11652d0cf06a9bc72074ac0e7d84eae 100644 (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 */
index 3286dfd98847f86781e3ae80b962a96d5323c59a..6c012f5baaa25485be382e9f29a7e36ad3e572ac 100644 (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;
 }
index 8676029a9ccfd004702d40a4b9410e6ca6e2a1e3..b40f0b46cdafec0b76f611aee63f50c3af0927d1 100644 (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