#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
#ifdef DMALLOC
#include "dmalloc.h"
#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;
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);
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;
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);
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);
}
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);
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);
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);
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;
}
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';
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);
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);
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]);
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);
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);
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);
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 */
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;
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 */
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;
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;
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));
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;
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;
}
}
#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);
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);
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);
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;
}
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;
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");
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()) {
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);
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);
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) {
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");
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);
#define MAXNAME 100
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static char tspace[1024];
#ifndef WIN32
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);
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);
}
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_LISTSYMLINK, &blob, 1);
#define MAXHOSTCHARS 64
#define MAXHOSTSPERCELL 8
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static char tspace[1024];
static struct ubik_client *uclient;
for (int i = 0; i < files.GetSize(); i++) {
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl_T(files[i], VIOC_FILE_CELL_NAME, &blob, 1);
} else
results.Add(GetAfsError(errno));
} else {
- space[MAXSIZE - 1] = '\0';
+ space[AFS_PIOCTL_MAXSIZE - 1] = '\0';
results.Add(Utf8ToCString(space));
}
}
blob.in_size = 0;
blob.in = (char *) 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl((char *) 0, VIOC_GET_WS_CELL, &blob, 1);
HOURGLASS hourglass;
for (int i = 0; i < files.GetSize(); i++) {
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
memset(space, 0, sizeof(space));
BOOL bFirst = TRUE;
str = "";
- for (int j = 0; j < MAXHOSTS; j++) {
+ for (int j = 0; j < AFS_MAXHOSTS; j++) {
if (hosts[j] == 0)
break;
char *hostName = hostutil_GetNameByINet(hosts[j]);
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;
HOURGLASS hourglass;
for (int i = 0; i < names.GetSize(); i++) {
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
HOURGLASS hourglass;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = idf;
blob.in = blob.out = space;
HOURGLASS hourglass;
// Get ACL to copy to
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = idf;
blob.in = blob.out = space;
afs_int32 code;
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl_T(apath, VIOC_FILE_CELL_NAME, &blob, 1);
blob.in_size = last_component.GetLength() + 1;
blob.in = last_component.GetBuffer();
- 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_T(parent_dir, VIOC_AFS_STAT_MT_PT, &blob, 1);
if (code == 0) {
int nPos;
- space[MAXSIZE - 1] = '\0';
+ space[AFS_PIOCTL_MAXSIZE - 1] = '\0';
nPos = strlen(space) - 1;
if (space[nPos] == '.')
space[nPos] = 0;
blob.in_size = ustrLast.GetLength() + 1;
blob.in = ustrLast.GetBuffer();
- 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_T(strParent, VIOC_LISTSYMLINK, &blob, 1);
return TRUE;
*/
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
HOURGLASS hourglass;
- 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;
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 */
}
CStringArray servers;
- for (j = 0; j < MAXHOSTS; j++) {
+ for (j = 0; j < AFS_MAXHOSTS; j++) {
memcpy(&temp, space + j * sizeof(LONG), sizeof(LONG));
if (temp == 0)
break;
}
blob.in = last_component;
blob.in_size = 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);
if ((code = pioctl(parent_dir, VIOC_LISTSYMLINK, &blob, 1)))
strcpy(space,"???");
ASSERT(strlen(space)<MAX_PATH);
blob.in_size = ustrLast.GetLength() + 1;
blob.in = ustrLast.GetBuffer();
- 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_T(strParent, VIOC_LISTSYMLINK, &blob, 1);
CString syml;
int len;
- space[MAXSIZE - 1] = '\0';
+ space[AFS_PIOCTL_MAXSIZE - 1] = '\0';
syml = Utf8ToCString(space);
len = syml.GetLength();
ULONG nXPRefCount=0;
#define PCCHAR(str) ((char *)(const char *)str)
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static BOOL IsADir(const CString& strName)
{
seq_printf(m, ">%s #(%d/%d)\n", tc->cellName,
tc->cellNum, tc->cellIndex);
- for (j = 0; j < MAXCELLHOSTS; j++) {
+ for (j = 0; j < AFS_MAXCELLHOSTS; j++) {
afs_uint32 addr;
if (!tc->cellHosts[j]) break;
}
}
- for (cnt = 0; cnt < MAXCELLHOSTS; cnt++) {
+ for (cnt = 0; cnt < AFS_MAXCELLHOSTS; cnt++) {
if (!tc->cellHosts[cnt]) break;
pos += 90;
if (pos <= offset) {
seq_printf(m, ">%s #(%d/%d)\n", tc->cellName,
tc->cellNum, tc->cellIndex);
- for (j = 0; j < MAXCELLHOSTS; j++) {
+ for (j = 0; j < AFS_MAXCELLHOSTS; j++) {
afs_uint32 addr;
if (!tc->cellHosts[j]) break;
}
}
- for (cnt = 0; cnt < MAXCELLHOSTS; cnt++) {
+ for (cnt = 0; cnt < AFS_MAXCELLHOSTS; cnt++) {
if (!tc->cellHosts[cnt]) break;
pos += 90;
if (pos <= offset) {
char permWriteError; /* fileserver returns permenent error. */
char tokenError; /* a token error other than expired. */
char idleError; /* the server idled too long */
- char skipserver[MAXHOSTS];
+ char skipserver[AFS_MAXHOSTS];
};
#define VOLMISSING 1
#define VOLBUSY 2
char *cellName; /* char string name of cell */
afs_int32 cellIndex; /* sequence number */
afs_int32 cellNum; /* semi-permanent cell number */
- struct server *cellHosts[MAXCELLHOSTS]; /* volume *location* hosts */
+ struct server *cellHosts[AFS_MAXCELLHOSTS]; /* volume *location* hosts */
struct cell *lcellp; /* Associated linked cell */
u_short fsport; /* file server port */
u_short vlport; /* volume server port */
afs_rwlock_t lock; /* the lock for this structure */
afs_int32 volume; /* This volume's ID number. */
char *name; /* This volume's name, or 0 if unknown */
- struct server *serverHost[MAXHOSTS]; /* servers serving this volume */
- enum repstate status[MAXHOSTS]; /* busy, offline, etc */
+ struct server *serverHost[AFS_MAXHOSTS]; /* servers serving this volume */
+ enum repstate status[AFS_MAXHOSTS]; /* busy, offline, etc */
struct VenusFid dotdot; /* dir to access as .. */
struct VenusFid mtpoint; /* The mount point for this volume. */
afs_int32 rootVnode, rootUnique; /* Volume's root fid */
if (afid) {
tvp = afs_FindVolume(afid, READ_LOCK);
if (tvp) {
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
if (tvp->serverHost[i] == tsp) {
areq->skipserver[i] = 1;
}
}
}
afs_PutVolume(tvp, READ_LOCK);
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
if (tvp->serverHost[i] && areq->skipserver[i] == 0) {
serversleft = 1;
break;
&& tvp->serverHost[0]->cell) ? tvp->serverHost[0]->
cell->cellName : ""));
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
if (tvp->status[i] != not_busy && tvp->status[i] != offline) {
tvp->status[i] = not_busy;
}
if (areq->volumeError) {
tvp = afs_FindVolume(afid, READ_LOCK);
if (tvp) {
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
if (tvp->serverHost[i] == tsp) {
tvp->status[i] = not_busy;
}
tvp = afs_FindVolume(afid, READ_LOCK);
if (tvp) {
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
if (tvp->serverHost[i] == tsp) {
tvp->status[i] = rdwr_busy; /* can't tell which yet */
/* to tell which, have to look at the op code. */
same = VLDB_Same(afid, areq);
tvp = afs_FindVolume(afid, READ_LOCK);
if (tvp) {
- for (i = 0; i < MAXHOSTS && tvp->serverHost[i]; i++) {
+ for (i = 0; i < AFS_MAXHOSTS && tvp->serverHost[i]; i++) {
if (tvp->serverHost[i] == tsp) {
if (tvp->status[i] == end_not_busy)
tvp->status[i] = offline;
#endif
struct afsop_cell {
- afs_int32 hosts[MAXCELLHOSTS];
+ afs_int32 hosts[AFS_MAXCELLHOSTS];
char cellName[100];
};
for (i = 0; i < NVOLS; i++)
for (tv = afs_volumes[i]; tv; tv = tv->next) {
- for (j = 0; j < MAXHOSTS; j++)
+ for (j = 0; j < AFS_MAXHOSTS; j++)
if (tv->serverHost[j] == ts)
afs_ResetVolumeInfo(tv);
}
tvc->cbExpires = tvp->expireTime; /* XXX race here */
} else {
int i;
- for (i = 0; i < MAXHOSTS && tvp->serverHost[i]; i++) {
+ for (i = 0; i < AFS_MAXHOSTS && tvp->serverHost[i]; i++) {
if (!(tvp->serverHost[i]->flags & SRVR_ISDOWN)) {
/* What about locking xvcache or vrefcount++ or
* write locking tvc? */
afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 * kernelMsg)
{
afs_int32 timeout, code;
- afs_int32 cellHosts[MAXCELLHOSTS];
+ afs_int32 cellHosts[AFS_MAXCELLHOSTS];
if (afsdb_handler_shutdown)
return -2;
if (timeout)
timeout += osi_Time();
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (i >= hostCount)
cellHosts[i] = 0;
else
/* we don't want to keep pinging old vlservers which were down,
* since they don't matter any more. It's easier to do this than
* to remove the server from its various hash tables. */
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (!tc->cellHosts[i])
break;
tc->cellHosts[i]->flags &= ~SRVR_ISDOWN;
tc->timeout = timeout;
memset(tc->cellHosts, 0, sizeof(tc->cellHosts));
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
/* Get server for each host and link this cell in.*/
struct server *ts;
afs_uint32 temp = acellHosts[i];
tc->cellHosts[i] = ts;
afs_PutServer(ts, WRITE_LOCK);
}
- afs_SortServers(tc->cellHosts, MAXCELLHOSTS); /* randomize servers */
+ afs_SortServers(tc->cellHosts, AFS_MAXCELLHOSTS); /* randomize servers */
/* New cell: Build and add to LRU cell queue. */
if (newc) {
/* Remove the server structure from the cell list - if there */
ObtainWriteLock(&tc->lock, 200);
- for (j = k = 0; j < MAXCELLHOSTS; j++) {
+ for (j = k = 0; j < AFS_MAXCELLHOSTS; j++) {
if (!tc->cellHosts[j])
break;
if (tc->cellHosts[j] != srvp) {
if (k == 0) {
/* What do we do if we remove the last one? */
}
- for (; k < MAXCELLHOSTS; k++) {
+ for (; k < AFS_MAXCELLHOSTS; k++) {
tc->cellHosts[k] = 0;
}
ReleaseWriteLock(&tc->lock);
* in this time).
*/
for (notbusy = not_busy; (!lowp && (notbusy <= end_not_busy)); notbusy++) {
- for (i = 0; i < MAXHOSTS && tv->serverHost[i]; i++) {
+ for (i = 0; i < AFS_MAXHOSTS && tv->serverHost[i]; i++) {
if (((areq->tokenError > 0)||(areq->idleError > 0))
&& (areq->skipserver[i] == 1))
continue;
/* try to find any connection from the set */
AFS_STATCNT(afs_ConnByMHosts);
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if ((ts = ahosts[i]) == NULL)
break;
tconn = afs_ConnByHost(ts, aport, acell, areq, 0, locktype);
#ifndef _AFS_CONSTS_H_
#define _AFS_CONSTS_H_
-#define MAXHOSTS 13 /* max hosts per single volume */
-#define OMAXHOSTS 8 /* backwards compatibility */
-#define MAXCELLHOSTS 8 /* max vldb servers per cell */
+#define AFS_MAXHOSTS 13 /* max hosts per single volume */
+#define AFS_OMAXHOSTS 8 /* backwards compatibility */
+#define AFS_MAXCELLHOSTS 8 /* max vldb servers per cell */
-#define MAXSIZE 2048 /* max returned from PIOCTL */
+#define AFS_PIOCTL_MAXSIZE 2048 /* max returned from PIOCTL */
#endif /* _AFS_CONSTS_H_ */
afs_dynrootCellInit(void)
{
if (!afs_dynrootCell) {
- afs_int32 cellHosts[MAXCELLHOSTS];
+ afs_int32 cellHosts[AFS_MAXCELLHOSTS];
struct cell *tc;
int code;
if (!afrom->initd)
return;
afs_FinalizeReq(ato);
- while (i < MAXHOSTS) {
+ while (i < AFS_MAXHOSTS) {
ato->skipserver[i] = afrom->skipserver[i];
i++;
}
AFS_STATCNT(afs_FinalizeReq);
if (areq->initd)
return;
- while (i < MAXHOSTS) {
+ while (i < AFS_MAXHOSTS) {
areq->skipserver[i] = 0;
i++;
}
tvp = afs_GetVolume(&avc->f.fid, areq, READ_LOCK);
if (tvp) {
cp = aout;
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
ts = tvp->serverHost[i];
if (!ts)
break;
memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
- if (i < MAXHOSTS) {
+ if (i < AFS_MAXHOSTS) {
/* still room for terminating NULL, add it on */
ainSize = 0; /* reuse vbl */
memcpy(cp, (char *)&ainSize, sizeof(afs_int32));
DECL_PIOCTL(PNewCell)
{
/* create a new cell */
- afs_int32 cellHosts[MAXCELLHOSTS], *lp, magic = 0;
+ afs_int32 cellHosts[AFS_MAXCELLHOSTS], *lp, magic = 0;
char *newcell = 0, *linkedcell = 0, *tp = ain;
register afs_int32 code, linkedstate = 0, ls;
u_short fsport = 0, vlport = 0;
if (magic != 0x12345678)
return EINVAL;
- /* A 3.4 fs newcell command will pass an array of MAXCELLHOSTS
+ /* A 3.4 fs newcell command will pass an array of AFS_MAXCELLHOSTS
* server addresses while the 3.5 fs newcell command passes
- * MAXHOSTS. To figure out which is which, check if the cellname
+ * AFS_MAXHOSTS. To figure out which is which, check if the cellname
* is good.
*/
- newcell = tp + (MAXCELLHOSTS + 3) * sizeof(afs_int32);
- scount = ((newcell[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
+ newcell = tp + (AFS_MAXCELLHOSTS + 3) * sizeof(afs_int32);
+ scount = ((newcell[0] != '\0') ? AFS_MAXCELLHOSTS : AFS_MAXHOSTS);
- /* MAXCELLHOSTS (=8) is less than MAXHOSTS (=13) */
- memcpy((char *)cellHosts, tp, MAXCELLHOSTS * sizeof(afs_int32));
+ /* AFS_MAXCELLHOSTS (=8) is less than AFS_MAXHOSTS (=13) */
+ memcpy((char *)cellHosts, tp, AFS_MAXCELLHOSTS * sizeof(afs_int32));
tp += (scount * sizeof(afs_int32));
lp = (afs_int32 *) tp;
tcell = afs_GetCellByIndex(whichCell, READ_LOCK);
if (tcell) {
cp = aout;
- memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ memset(cp, 0, AFS_MAXCELLHOSTS * sizeof(afs_int32));
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (tcell->cellHosts[i] == 0)
break;
memcpy(cp, (char *)&tcell->cellHosts[i]->addr->sa_ip,
sizeof(afs_int32));
cp += sizeof(afs_int32);
}
- cp = aout + MAXCELLHOSTS * sizeof(afs_int32);
+ cp = aout + AFS_MAXCELLHOSTS * sizeof(afs_int32);
strcpy(cp, tcell->cellName);
cp += strlen(tcell->cellName) + 1;
*aoutSize = cp - aout;
for (i = 0; i < s; i++) {
if (l[i] == cell->cellNum) {
ObtainWriteLock(&cell->lock, 690);
- afs_SortServers(cell->cellHosts, MAXCELLHOSTS);
+ afs_SortServers(cell->cellHosts, AFS_MAXCELLHOSTS);
ReleaseWriteLock(&cell->lock);
}
}
for (k = 0; k < s; k++)
if (j->cell == l[k]) {
ObtainWriteLock(&j->lock, 233);
- afs_SortServers(j->serverHost, MAXHOSTS);
+ afs_SortServers(j->serverHost, AFS_MAXHOSTS);
ReleaseWriteLock(&j->lock);
break;
}
cbArray.AFSCBs_val = callBacks;
memset(&callBacks[0], 0, sizeof(callBacks[0]));
callBacks[0].CallBackType = CB_EXCLUSIVE;
- for (safety3 = 0; safety3 < MAXHOSTS * 2; safety3++) {
+ for (safety3 = 0; safety3 < AFS_MAXHOSTS * 2; safety3++) {
tc = afs_ConnByHost(tsp, tsp->cell->fsport,
tsp->cell->cellNum, &treq, 0,
SHARED_LOCK);
/* Find any volumes residing on this server and flush their state */
for (j = 0; j < NVOLS; j++) {
for (vp = afs_volumes[j]; vp; vp = vp->next) {
- for (k = 0; k < MAXHOSTS; k++) {
+ for (k = 0; k < AFS_MAXHOSTS; k++) {
if (!srvp || (vp->serverHost[k] == srvp)) {
vp->serverHost[k] = 0;
afs_ResetVolumeInfo(vp);
}
/* ??? */
if (flags & (AFS_VOLCHECK_BUSY | AFS_VOLCHECK_FORCE)) {
- for (j = 0; j < MAXHOSTS; j++)
+ for (j = 0; j < AFS_MAXHOSTS; j++)
tv->status[j] = not_busy;
}
int i;
struct server *sp;
struct srvAddr *sap;
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if ((sp = tcell->cellHosts[i]) == NULL)
break;
for (sap = sp->addr; sap; sap = sap->next_sa)
* struct, we don't deadlock trying to afs_ResetVolumeInfo()
* this volume.
*/
- for (j = 0; j < MAXHOSTS; j++) {
+ for (j = 0; j < AFS_MAXHOSTS; j++) {
av->serverHost[j] = 0;
}
afs_PutServer(ts, WRITE_LOCK);
j++;
}
- if (j < MAXHOSTS) {
+ if (j < AFS_MAXHOSTS) {
av->serverHost[j++] = 0;
}
- afs_SortServers(av->serverHost, MAXHOSTS);
+ afs_SortServers(av->serverHost, AFS_MAXHOSTS);
} /*InstallVolumeEntry */
* struct, we don't deadlock trying to afs_ResetVolumeInfo()
* this volume.
*/
- for (j = 0; j < MAXHOSTS; j++) {
+ for (j = 0; j < AFS_MAXHOSTS; j++) {
av->serverHost[j] = 0;
}
afs_PutServer(ts, WRITE_LOCK);
j++;
}
- if (j < MAXHOSTS) {
+ if (j < AFS_MAXHOSTS) {
av->serverHost[j++] = 0;
}
- afs_SortServers(av->serverHost, MAXHOSTS);
+ afs_SortServers(av->serverHost, AFS_MAXHOSTS);
} /*InstallNVolumeEntry */
* struct, we don't deadlock trying to afs_ResetVolumeInfo()
* this volume.
*/
- for (j = 0; j < MAXHOSTS; j++) {
+ for (j = 0; j < AFS_MAXHOSTS; j++) {
av->serverHost[j] = 0;
}
j++;
}
- afs_SortServers(av->serverHost, MAXHOSTS);
+ afs_SortServers(av->serverHost, AFS_MAXHOSTS);
} /*InstallVolumeEntry */
AFS_STATCNT(afs_ResetVolumeInfo);
ObtainWriteLock(&tv->lock, 117);
tv->states |= VRecheck;
- for (i = 0; i < MAXHOSTS; i++)
+ for (i = 0; i < AFS_MAXHOSTS; i++)
tv->status[i] = not_busy;
if (tv->name) {
afs_osi_Free(tv->name, strlen(tv->name) + 1);
{
struct ViceIoctl blob;
register afs_int32 code;
- char space[MAXSIZE];
+ char space[AFS_PIOCTL_MAXSIZE];
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl(apath, VIOC_FILE_CELL_NAME, &blob, 1);
if (!InAFS(dir))
continue;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
code = pioctl(dir, VIOCGETAL, &blob, 1);
long i, j;
char *tcp;
long clear;
- char space[MAXSIZE];
+ char space[AFS_PIOCTL_MAXSIZE];
struct ViceIoctl blob;
for (i = 0; i < 1000; i++) {
char *cellname;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = sizeof(long);
blob.in = space;
blob.out = space;
AclToString(acl)
struct Acl *acl;
{
- static char mydata[MAXSIZE];
- char tstring[MAXSIZE];
+ static char mydata[AFS_PIOCTL_MAXSIZE];
+ char tstring[AFS_PIOCTL_MAXSIZE];
struct AclEntry *tp;
sprintf(mydata, "%d\n%d\n", acl->nplus, acl->nminus);
for (tp = acl->pluslist; tp; tp = tp->next) {
register long code;
struct ViceIoctl blob;
struct Acl *al;
- char space[MAXSIZE];
+ char space[AFS_PIOCTL_MAXSIZE];
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
code = pioctl(pathname, VIOCGETAL, &blob, 1);
void
RAclToString(struct Acl *acl, char *mydata, int ntoh_conv)
{
- char tstring[MAXSIZE];
+ char tstring[AFS_PIOCTL_MAXSIZE];
struct AclEntry *tp;
/* No conversion needed since they're in network order in the first place */
struct ViceIoctl v;
struct VenusFid vf;
- afs_int32 srvbuf[MAXHOSTS];
+ afs_int32 srvbuf[AFS_MAXHOSTS];
int code;
if (!strncmp(path, "@afs:", 5)) {
AclToString(struct Acl *a_acl)
{ /*AclToString */
- static char mydata[MAXSIZE];
- char tstring[MAXSIZE];
+ static char mydata[AFS_PIOCTL_MAXSIZE];
+ char tstring[AFS_PIOCTL_MAXSIZE];
struct AclEntry *tp;
/*
char *externalizedACL;
int plusp;
afs_int32 rights;
- char tmp_str[MAXSIZE];
- char path_field[MAXSIZE], user_field[64], rights_field[64], *tp;
+ char tmp_str[AFS_PIOCTL_MAXSIZE];
+ char path_field[AFS_PIOCTL_MAXSIZE], user_field[64], rights_field[64], *tp;
int overflow;
plusp = !a_negative;
* Ask the Cache Manager to give us the externalized ACL for the
* given directory.
*/
- code = uss_fs_GetACL(path_field, tmp_str, MAXSIZE);
+ code = uss_fs_GetACL(path_field, tmp_str, AFS_PIOCTL_MAXSIZE);
if (code) {
afs_com_err(uss_whoami, code, "while getting access list for %s",
path_field);
uss_VolumeStatus_t *status;
char *name, *motd, *offmsg;
char *input;
- char tmp_str[MAXSIZE];
+ char tmp_str[AFS_PIOCTL_MAXSIZE];
if (uss_verbose)
fprintf(stderr,
i++;
}
}
- for (; i<MAXHOSTS; i++) *h++ = 0;
+ for (; i<AFS_MAXHOSTS; i++) *h++ = 0;
return 0;
}
* offer it, and the FID.
*/
afs_int32
-get_file_cell(char *fn, char **cellp, afs_int32 hosts[MAXHOSTS], AFSFid *Fid,
+get_file_cell(char *fn, char **cellp, afs_int32 hosts[AFS_MAXHOSTS], AFSFid *Fid,
struct AFSFetchStatus *Status, afs_int32 create)
{
afs_int32 code;
afs_com_err(pnp, code, (char *) 0);
} else {
Tmpafs_int32 = (afs_int32 *)buf;
- for (j=0;j<MAXHOSTS;++j) {
+ for (j=0;j<AFS_MAXHOSTS;++j) {
hosts[j] = Tmpafs_int32[j];
if (!Tmpafs_int32[j])
break;
char *fname;
char *cell = 0;
afs_int32 code;
- afs_int32 hosts[MAXHOSTS];
+ afs_int32 hosts[AFS_MAXHOSTS];
AFSFid Fid;
int i, j;
struct rx_connection *RXConn;
return ENOENT;
}
cl = FindCell(cell);
- for (j=0;j<MAXHOSTS;++j) {
+ for (j=0;j<AFS_MAXHOSTS;++j) {
int useHost;
if (first && as->parms[6].items) {
char *fname = NULL;
char *cell = 0;
afs_int32 code, localcode = 0;
- afs_int32 hosts[MAXHOSTS];
+ afs_int32 hosts[AFS_MAXHOSTS];
afs_uint32 useHost;
AFSFid Fid;
int i;
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static char tspace[1024];
static struct ubik_client *uclient;
afs_int32 code;
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl(apath, VIOC_FILE_CELL_NAME, &blob, 1);
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;
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(ti->data, VIOCGETAL, &blob, 1);
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(as->parms[0].items->data, VIOCGETAL, &blob, 1);
fa = ParseAcl(space);
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(ti->data, VIOCGETAL, &blob, 1);
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(ti->data, VIOCGETAL, &blob, 1);
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 = idf;
blob.in = blob.out = space;
code = pioctl(ti->data, VIOCGETAL, &blob, 1);
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;
struct VenusFid vfid;
/* once per file */
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = 0;
blob.out = space;
code = pioctl(ti->data, VIOCGETVOLSTAT, &blob, 1);
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(ti->data, VIOCGETVOLSTAT, &blob, 1);
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;
memset(space, 0, sizeof(space));
hosts = (afs_int32 *) space;
printf("File %s is on host%s ", 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]);
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(ti->data, VIOCGETVOLSTAT, &blob, 1);
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(ti->data, VIOCGETVOLSTAT, &blob, 1);
blob.in = last_component;
blob.in_size = 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(parent_dir, VIOC_AFS_STAT_MT_PT, &blob, 1);
if (!cellName) {
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code =
pioctl(Parent(as->parms[0].items->data), VIOC_FILE_CELL_NAME,
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 */
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 */
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;
return 1;
}
tp = space;
- printf("Cell %s on hosts", tp + MAXCELLHOSTS * sizeof(afs_int32));
- for (j = 0; j < MAXCELLHOSTS; j++) {
+ printf("Cell %s on hosts", tp + AFS_MAXCELLHOSTS * sizeof(afs_int32));
+ for (j = 0; j < AFS_MAXCELLHOSTS; j++) {
afs_int32 addr;
char *name, tbuffer[20];
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;
/* Yuck!
* With the NEWCELL pioctl call, 3.4 clients take an array of
- * MAXHOSTS (13) servers while 3.5 clients take an array of
- * MAXCELLHOSTS (8) servers. To determine which we are talking to,
+ * AFS_MAXHOSTS (13) servers while 3.5 clients take an array of
+ * AFS_MAXCELLHOSTS (8) servers. To determine which we are talking to,
* do a GETCELL pioctl and pass it a magic number. If an array of
* 8 comes back, its a 3.5 client. If not, its a 3.4 client.
* If we get back EDOM, there are no cells in the kernel yet,
lp = (afs_int32 *) tp;
*lp++ = 0; /* first cell entry */
*lp = 0x12345678; /* magic */
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = sizeof(afs_int32) + sizeof(afs_int32);
blob.in = space;
blob.out = space;
return 1;
}
if (code < 1 && errno == EDOM) {
- scount = MAXHOSTS;
+ scount = AFS_MAXHOSTS;
} else {
tp = space;
- cellname = tp + MAXCELLHOSTS * sizeof(afs_int32);
- scount = ((cellname[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
+ cellname = tp + AFS_MAXCELLHOSTS * sizeof(afs_int32);
+ scount = ((cellname[0] != '\0') ? AFS_MAXCELLHOSTS : AFS_MAXHOSTS);
}
/* Now setup and do the NEWCELL pioctl call */
blob.in_size = 0;
blob.in = NULL;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl(NULL, VIOC_GET_WS_CELL, &blob, 1);
ti = as->parms[0].items;
blob.in = space;
blob.out = space;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = sizeof(afs_int32);
input += sizeof(afs_int32);
for (; ti; ti = ti->next) {
setp++;
blob.in_size += 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;
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()) {
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(0, VIOC_GETSPREFS, &blob, 1);
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(0, VIOC_GETCPREFS, &blob, 1);
if (code) {
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");
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(parent_dir, VIOC_AFS_FLUSHMOUNT, &blob, 1);
printf("\tlinked cellp %lx\n", clep->lcellp);
#endif
printf("\tCell's servers: ");
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (pretty && (clep->cellHosts[i] == 0))
break;
printf("[%lx] ", clep->cellHosts[i]);
vep->states);
#endif
printf("\tVolume's statuses: ");
- for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+ for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
printf("[%d] ", vep->status[i]);
printf("\n");
printf("\tVolume's servers: ");
- for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+ for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
printf("[%lx] ", vep->serverHost[i]);
printf("\n");
#include <signal.h>
#endif
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
int
main(int argc, char **argv)
blob.in = space;
blob.out = space;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.in_size = sizeof(afs_int32);
memcpy(space, &setp, sizeof(afs_int32));
code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static char tspace[1024];
static struct ubik_client *uclient;
short oldAcl = 0;
char file1[MAXPATHLEN], file2[MAXPATHLEN];
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
struct OldAcl {
int nplus;
blob->in = last_component;
blob->in_size = 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(parent_dir, VIOC_AFS_STAT_MT_PT, blob, 0);
static char pn[] = "cnvldb";
static char tempname[] = "XXnewvldb";
-static char space[MAXSIZE];
+static char space[AFS_PIOCTL_MAXSIZE];
static int MaxServers[2] = { 30, 254 }; /* max server # permitted in this version */
#ifdef notdef /* postpone this... */
register afs_int32 code;
blob.in_size = 0;
- blob.out_size = MAXSIZE;
+ blob.out_size = AFS_PIOCTL_MAXSIZE;
blob.out = space;
code = pioctl(apath, VIOC_FILE_CELL_NAME, &blob, 1);
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(ti->data, VIOCGETVOLSTAT, &blob, 1);