Prefix global defines
[openafs.git] / src / WINNT / afsd / fs.c
index 6cf53e5..3fbbe96 100644 (file)
@@ -43,7 +43,7 @@
 #define CELL_MAXNAMELEN                256
 #define MAXHOSTCHARS           64
 
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
 static char tspace[1024];
 
 static struct ubik_client *uclient;
@@ -271,7 +271,7 @@ IsFreelanceRoot(char *apath)
     afs_int32 code;
 
     blob.in_size = 0;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.out = space;
 
     code = pioctl_utf8(apath, VIOC_FILE_CELL_NAME, &blob, 1);
@@ -712,8 +712,8 @@ QuickPrintSpace(VolumeStatus *status, char *name)
 static char *
 AclToString(struct Acl *acl)
 {
-    static char mydata[MAXSIZE];
-    char tstring[MAXSIZE];
+    static char mydata[AFS_PIOCTL_MAXSIZE];
+    char tstring[AFS_PIOCTL_MAXSIZE];
     char dfsstring[30];
     struct AclEntry *tp;
     
@@ -931,7 +931,7 @@ SetACLCmd(struct cmd_syndesc *as, void *arock)
         clear = 0;
     plusp = !(as->parms[3].items);
     for(ti=as->parms[0].items; ti;ti=ti->next) {
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = idf;
        blob.in = blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETAL, &blob, 1);
@@ -1071,7 +1071,7 @@ CopyACLCmd(struct cmd_syndesc *as, void *arock)
         clear=1;
     else 
         clear=0;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.in_size = idf;
     blob.in = blob.out = space;
     code = pioctl_utf8(as->parms[0].items->data, VIOCGETAL, &blob, 1);
@@ -1088,7 +1088,7 @@ CopyACLCmd(struct cmd_syndesc *as, void *arock)
     }
     CleanAcl(fa, as->parms[0].items->data);
     for (ti=as->parms[1].items; ti;ti=ti->next) {
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = idf;
        blob.in = blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETAL, &blob, 1);
@@ -1262,7 +1262,7 @@ CleanACLCmd(struct cmd_syndesc *as, void *arock)
 
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = 0;
        blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETAL, &blob, 1);
@@ -1356,7 +1356,7 @@ ListACLCmd(struct cmd_syndesc *as, void *arock)
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        char separator;
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = idf;
        blob.in = blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETAL, &blob, 1);
@@ -1532,7 +1532,7 @@ SetVolCmd(struct cmd_syndesc *as, void *arock) {
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        /* once per file */
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = sizeof(*status) + 3;     /* for the three terminating nulls */
        blob.out = space;
        blob.in = space;
@@ -1694,7 +1694,7 @@ ExamineCmd(struct cmd_syndesc *as, void *arock)
         }
 
        blob.out = space;
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        code = pioctl_utf8(ti->data, VIOCGETVOLSTAT, &blob, 1);
        if (code == 0) {
             space[blob.out_size - 1] = '\0';
@@ -1747,7 +1747,7 @@ ListQuotaCmd(struct cmd_syndesc *as, void *arock)
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        /* once per file */
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = 0;
        blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETVOLSTAT, &blob, 1);
@@ -1816,7 +1816,7 @@ WhereIsCmd(struct cmd_syndesc *as, void *arock)
             error = 1;
            continue;
         }
-        blob.out_size = MAXSIZE;
+        blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.out = space;
        memset(space, 0, sizeof(space));
        code = pioctl_utf8(ti->data, VIOCWHEREIS, &blob, 1);
@@ -1830,7 +1830,7 @@ WhereIsCmd(struct cmd_syndesc *as, void *arock)
                 filetypestr(filetype),
                 ti->data,
                 (hosts[0] && !hosts[1]) ? "": "s");
-       for(j=0; j<MAXHOSTS; j++) {
+       for(j=0; j<AFS_MAXHOSTS; j++) {
            if (hosts[j] == 0) 
                 break;
            tp = hostutil_GetNameByINet(hosts[j]);
@@ -1857,7 +1857,7 @@ DiskFreeCmd(struct cmd_syndesc *as, void *arock)
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        /* once per file */
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = 0;
        blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETVOLSTAT, &blob, 1);
@@ -1887,7 +1887,7 @@ QuotaCmd(struct cmd_syndesc *as, void *arock)
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        /* once per file */
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = 0;
        blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETVOLSTAT, &blob, 1);
@@ -2034,9 +2034,9 @@ ListMountCmd(struct cmd_syndesc *as, void *arock)
 
        blob.in = last_component;
        blob.in_size = (long)strlen(last_component)+1;
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.out = space;
-       memset(space, 0, MAXSIZE);
+       memset(space, 0, AFS_PIOCTL_MAXSIZE);
 
        code = pioctl_utf8(parent_dir, VIOC_AFS_STAT_MT_PT, &blob, 1);
 
@@ -2304,7 +2304,7 @@ CheckServersCmd(struct cmd_syndesc *as, void *arock)
     blob.in_size=sizeof(struct chservinfo);
     blob.in=(caddr_t)&checkserv;
 
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.out = space;
     memset(space, 0, sizeof(afs_int32));       /* so we assure zero when nothing is copied back */
 
@@ -2384,7 +2384,7 @@ CheckServersCmd(struct cmd_syndesc *as, void *arock)
        printf("All servers are running.\n");
     } else {
        printf("These servers unavailable due to network or server problems: ");
-       for(j=0; j < MAXHOSTS; j++) {
+       for(j=0; j < AFS_MAXHOSTS; j++) {
            memcpy(&temp, space + j*sizeof(afs_int32), sizeof(afs_int32));
            if (temp == 0) 
                 break;
@@ -2408,7 +2408,7 @@ MessagesCmd(struct cmd_syndesc *as, void *arock)
     memset(&gagflags, 0, sizeof(struct gaginfo));
     blob.in_size = sizeof(struct gaginfo);
     blob.in = (caddr_t ) &gagflags;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.out = space;
     memset(space, 0, sizeof(afs_int32));       /* so we assure zero when nothing is copied back */
 
@@ -2533,7 +2533,7 @@ ListCellsCmd(struct cmd_syndesc *as, void *arock)
     afs_int32 code;
     afs_int32 i, j, *lp, magic, size;
     char *tp;
-    afs_int32 addr, maxa = OMAXHOSTS;
+    afs_int32 addr, maxa = AFS_OMAXHOSTS;
     struct ViceIoctl blob;
     int resolve;
 
@@ -2546,7 +2546,7 @@ ListCellsCmd(struct cmd_syndesc *as, void *arock)
        lp = (afs_int32 *)tp;
        *lp++ = 0x12345678;
        size = sizeof(afs_int32) + sizeof(afs_int32);
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = sizeof(afs_int32);
        blob.in = space;
        blob.out = space;
@@ -2560,11 +2560,11 @@ ListCellsCmd(struct cmd_syndesc *as, void *arock)
        tp = space;
        memcpy(&magic, tp, sizeof(afs_int32));  
        if (magic == 0x12345678) {
-           maxa = MAXHOSTS;
+           maxa = AFS_MAXHOSTS;
            tp += sizeof(afs_int32);
        }
        printf("Cell %s on hosts", tp+maxa*sizeof(afs_int32));
-       for(j=0; j < maxa && j*sizeof(afs_int32) < MAXSIZE; j++) {
+       for(j=0; j < maxa && j*sizeof(afs_int32) < AFS_PIOCTL_MAXSIZE; j++) {
             char *name, tbuffer[20];
 
            memcpy(&addr, tp + j*sizeof(afs_int32), sizeof(afs_int32));
@@ -2597,7 +2597,7 @@ ListAliasesCmd(struct cmd_syndesc *as, void *arock)
     for (i = 0;; i++) {
        tp = space;
        memcpy(tp, &i, sizeof(afs_int32));
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = sizeof(afs_int32);
        blob.in = space;
        blob.out = space;
@@ -2669,7 +2669,7 @@ NewCellCmd(struct cmd_syndesc *as, void *arock)
     struct hostent *thp;
     afs_int32 fsport = 0, vlport = 0;
 
-    memset(space, 0, MAXHOSTS * sizeof(afs_int32));
+    memset(space, 0, AFS_MAXHOSTS * sizeof(afs_int32));
     tp = space;
     lp = (afs_int32 *)tp;
     *lp++ = 0x12345678;
@@ -2709,13 +2709,13 @@ NewCellCmd(struct cmd_syndesc *as, void *arock)
        }
     }
 #endif
-    tp = (char *)(space + (MAXHOSTS+1) *sizeof(afs_int32));
+    tp = (char *)(space + (AFS_MAXHOSTS+1) *sizeof(afs_int32));
     lp = (afs_int32 *)tp;    
     *lp++ = fsport;
     *lp++ = vlport;
     *lp = linkedstate;
-    strcpy(space +  ((MAXHOSTS+4) * sizeof(afs_int32)), as->parms[0].items->data);
-    size = ((MAXHOSTS+4) * sizeof(afs_int32)) + strlen(as->parms[0].items->data) + 1 /* for null */;
+    strcpy(space +  ((AFS_MAXHOSTS+4) * sizeof(afs_int32)), as->parms[0].items->data);
+    size = ((AFS_MAXHOSTS+4) * sizeof(afs_int32)) + strlen(as->parms[0].items->data) + 1 /* for null */;
     tp = (char *)(space + size);
     if (linkedstate) {
        strcpy(tp, cellname);
@@ -2739,7 +2739,7 @@ NewCellCmd(struct cmd_syndesc *as, void *arock)
 
     blob.in_size = 0;
     blob.in = (char *) 0;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.out = space;
 
     code = pioctl_utf8((char *) 0, VIOCNEWCELL, &blob, 1);
@@ -2869,7 +2869,7 @@ WSCellCmd(struct cmd_syndesc *as, void *arock)
     
     blob.in_size = 0;
     blob.in = NULL;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.out = space;
 
     code = pioctl_utf8(NULL, VIOC_GET_WS_CELL, &blob, 1);
@@ -2878,7 +2878,7 @@ WSCellCmd(struct cmd_syndesc *as, void *arock)
        Die(errno, NULL);
         return 1;
     }
-    space[MAXSIZE - 1] = '\0';
+    space[AFS_PIOCTL_MAXSIZE - 1] = '\0';
     printf("This workstation belongs to cell '%s'\n", space);
     return 0;
 }
@@ -2980,14 +2980,14 @@ SysNameCmd(struct cmd_syndesc *as, void *arock)
 
     blob.in = space;
     blob.out = space;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
     blob.in_size = sizeof(afs_int32);
     memcpy(input, &setp, sizeof(afs_int32));
     input += sizeof(afs_int32);
     for (; ti; ti = ti->next) {
         setp++;
         blob.in_size += (long)strlen(ti->data) + 1;
-        if (blob.in_size > MAXSIZE) {
+        if (blob.in_size > AFS_PIOCTL_MAXSIZE) {
             fprintf(stderr, "%s: sysname%s too long.\n", pn,
                      setp > 1 ? "s" : "");
             return 1;
@@ -3464,7 +3464,7 @@ SetPrefCmd(struct cmd_syndesc *as, void * arock)
     gblob.in_size = (long)(((char*)&(ssp->servers[0])) - (char *)ssp);
     gblob.in = space;
     gblob.out = space;
-    gblob.out_size = MAXSIZE;
+    gblob.out_size = AFS_PIOCTL_MAXSIZE;
 
     if ( !IsAdmin() ) {
         fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
@@ -3556,7 +3556,7 @@ SetPrefCmd(struct cmd_syndesc *as, void *arock)
     gblob.in_size = ((char *)&(ssp->servers[0])) - (char *)ssp;
     gblob.in = space;
     gblob.out = space;
-    gblob.out_size = MAXSIZE;
+    gblob.out_size = AFS_PIOCTL_MAXSIZE;
 
 
     if (geteuid()) {
@@ -3682,9 +3682,9 @@ GetPrefCmd(struct cmd_syndesc *as, void *arock)
         blob.in_size=sizeof(struct cm_SPrefRequest);
         blob.in = (char *)in;
         blob.out = space;
-        blob.out_size = MAXSIZE;
+        blob.out_size = AFS_PIOCTL_MAXSIZE;
 
-        in->num_servers = (MAXSIZE - 2*sizeof(short))/sizeof(struct cm_SPref);
+        in->num_servers = (AFS_PIOCTL_MAXSIZE - 2*sizeof(short))/sizeof(struct cm_SPref);
         in->flags = vlservers; 
 
         code = pioctl_utf8(0, VIOC_GETSPREFS, &blob, 1);
@@ -3753,10 +3753,10 @@ GetPrefCmd(struct cmd_syndesc *as, void *arock)
        blob.in_size = sizeof(struct sprefrequest);
        blob.in = (char *)in;
        blob.out = space;
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
 
        in->num_servers =
-           (MAXSIZE - 2 * sizeof(short)) / sizeof(struct spref);
+           (AFS_PIOCTL_MAXSIZE - 2 * sizeof(short)) / sizeof(struct spref);
        in->flags = vlservers;
 
        code = pioctl_utf8(0, VIOC_GETSPREFS, &blob, 1);
@@ -4396,10 +4396,10 @@ GetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
        blob.in_size = sizeof(struct sprefrequest);
        blob.in = (char *)in;
        blob.out = space;
-       blob.out_size = MAXSIZE;
+       blob.out_size = AFS_PIOCTL_MAXSIZE;
 
        in->num_servers =
-           (MAXSIZE - 2 * sizeof(short)) / sizeof(struct spref);
+           (AFS_PIOCTL_MAXSIZE - 2 * sizeof(short)) / sizeof(struct spref);
        /* returns addr in network byte order */
        code = pioctl_utf8(0, VIOC_GETCPREFS, &blob, 1);
        if (code) {
@@ -4442,7 +4442,7 @@ SetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
     ssp->num_servers = 0;
     blob.in = space;
     blob.out = space;
-    blob.out_size = MAXSIZE;
+    blob.out_size = AFS_PIOCTL_MAXSIZE;
 
     if (geteuid()) {
        fprintf(stderr, "Permission denied: requires root access.\n");
@@ -4599,7 +4599,7 @@ FlushMountCmd(struct cmd_syndesc *as, void *arock)
        blob.in = last_component;
        blob.in_size = strlen(last_component) + 1;
        blob.out_size = 0;
-       memset(space, 0, MAXSIZE);
+       memset(space, 0, AFS_PIOCTL_MAXSIZE);
 
        code = pioctl_utf8(parent_dir, VIOC_AFS_FLUSHMOUNT, &blob, 1);