int foundCell;
long code;
int tracking = 1, partial = 0;
- long ip_addr;
#if defined(DJGPP) || defined(AFS_WIN95_ENV)
+ long ip_addr;
int c1, c2, c3, c4;
char aname[256];
#endif
struct rx_securityClass *tclass;
afs_int32 kvno;
afs_int32 ticketLen;
- struct timeval tv;
- Key_schedule schedule;
- register afs_int32 i, code;
+ register afs_int32 code;
/* first, find the right key and kvno to use */
code = afsconf_GetLatestKey(adir, &kvno, &key);
static afsconf_Touch(adir)
register struct afsconf_dir *adir; {
char tbuffer[256];
+#ifndef AFS_NT40_ENV
struct timeval tvp[2];
+#endif
+
+ adir->timeRead = 0; /* just in case */
#ifdef AFS_NT40_ENV
/* NT client CellServDB has different file name than NT server or Unix */
+
if (IsClientConfigDirectory(adir->name)) {
strcompose(tbuffer, 256,
adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
strcompose(tbuffer, 256,
adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
}
-#else
- strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
-#endif /* AFS_NT40_ENV */
- adir->timeRead = 0; /* just in case */
-#ifdef AFS_NT40_ENV
return _utime(tbuffer, NULL);
+
#else
+ strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
gettimeofday(&tvp[0], NULL);
tvp[1] = tvp[0];
return utimes(tbuffer, tvp);
/* The "AFSCONF" environment (or contents of "/.AFSCONF") will be typically set to something like "/afs/<cell>/common/etc" where, by convention, the default files for "ThisCell" and "CellServDB" will reside; note that a major drawback is that a given afs client on that cell may NOT contain the same contents... */
char *home_dir;
FILE *fp;
- int len;
+ size_t len;
if (!(home_dir = getenv("HOME"))) {
/* Our last chance is the "/.AFSCONF" file */
struct afsconf_cell *acellInfo;
{
afs_int32 code;
- int tservice, len, i;
+ int tservice, i;
+ size_t len;
unsigned char answer[1024];
unsigned char *p;
char host[256];
register afs_int32 i;
int tservice;
char *tcell;
- int cnLen, ambig;
+ size_t cnLen;
+ int ambig;
char tbuffer[64];
LOCK_GLOBAL_MUTEX
char tbuffer[256];
register bufio_p bp;
char tname[64];
- register char *tp;
register int flag;
register afs_int32 code;
int rc;
printf("\n");
}
}
+ return 0;
}
static UnInstall(as)
struct rx_call *acall;
char *aname;
afs_int32 *atime, *abakTime, *aoldTime; {
- register afs_int32 code;
struct stat tstat;
char *strp;
char tbuffer[AFSDIR_PATH_MAX];
bozo_bosEntryStats[7].path = AFSDIR_SERVER_KEY_FILEPATH;
bozo_bosEntryStats[8].path = AFSDIR_SERVER_ULIST_FILEPATH;
+ return 0;
}
/* StatEachEntry - If it's not there, it is okay. If anything else goes wrong
* complain. Otherwise check permissions: shouldn't allow write or (usually)
extern int RXSTATS_ExecuteRequest();
extern int afsconf_GetKey();
extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops;
+
+void bozo_Log();
+
struct afsconf_dir *bozo_confdir = 0; /* bozo configuration dir */
static char *bozo_pid;
struct rx_securityClass *bozo_rxsc[3];
int noAuth = 0;
struct ktc_encryptionKey tkey;
int i;
- pid_t newSessionID;
char namebuf[AFSDIR_PATH_MAX];
#ifdef AFS_AIX32_ENV
rx_StartServer(1); /* donate this process */
}
+void
bozo_Log(a,b,c,d,e,f)
char *a, *b, *c, *d, *e, *f; {
char tdate[26];
if (temp < 1) temp = 1; /* temp is when to start dude */
bnode_SetTimeout(abnode, temp);
}
+ return 0;
}
static int cron_restartp (abnode)
}
}
SetNeedsClock(abnode);
+ return 0;
}
static int fs_getstat(abnode, astatus)
register struct cmd_syndesc *as;
register char *aname; {
register int i;
- int cmdlen;
+ size_t cmdlen;
int ambig;
int best;
char *aname; {
register struct cmd_syndesc *ts;
struct cmd_syndesc *best;
- int cmdLen;
+ size_t cmdLen;
int ambig;
cmdLen = strlen(aname);
register struct cmd_syndesc *as; {
register int i;
register struct cmd_parmdesc *tp;
- int flag_width;
+ size_t flag_width;
char *flag_prefix;
/* find flag name length */
{*abuffers = nbuffers;
*acalls = calls;
*aios = ios;
+ return 0;
}
int DInit (abuffers)
register struct buffer *lp; /* pointer to a fairly-old buffer */
{/* Find a usable buffer slot */
register afs_int32 i;
- afs_int32 lt,pt;
+ afs_int32 lt;
register struct buffer **tbp;
if (lp && (lp->lockers == 0)) {
return lp;
}
+void
DRelease (bp,flag)
register struct buffer *bp;
int flag;
afs_int32 dot[3], dotdot[3], lfid[3], code, usedPages;
char tname[256];
register int i;
- register char *tp, tc;
+ register char *tp;
struct DirHeader *dhp;
struct DirEntry *ep;
int entry;
char *arock)
{
afs_int32 code;
- struct ktc_principal server;
#ifdef notdef
+ struct ktc_principal server;
+
if (as->parms[0].items) {
char *name = as->parms[0].items->data;
code = ka_ParseLoginName
des_key_schedule schedule;
int version;
afs_int32 pwexpires;
- char bob[KA_TIMESTR_LEN];
LOCK_GLOBAL_MUTEX
aticket.SeqLen = auth_token->ticketLen;
unsigned int nfailures, myshare;
afs_uint32 lasttime;
struct ubik_debug beaconinfo;
- afs_uint32 now;
/* if attempts is 0, that means there's no limit, so the id
* can't ever be locked...
int code;
Date now;
int i;
- int reuse_p;
extern int MinHours;
afs_uint32 newsum;
afs_int32 caller;
afs_int32 tentry_offset; /* offset of entry */
struct kaentry tentry;
- unsigned char newvals[4], oldvals[4];
- int i;
+ unsigned char newvals[4];
COUNT_REQ (SetFields);
struct rx_call *call;
char *name;
EncryptionKey *password;
-{ int code = KANOAUTH;
+{
+ int code = KANOAUTH;
+ COUNT_REQ (GetPassword);
+
+#ifdef GETPASSWORD
+ {
afs_int32 to;
struct ubik_trans *tt;
struct kaentry tentry;
- COUNT_REQ (GetPassword);
-#ifdef GETPASSWORD
if (!name_instance_legal (name, "")) return KABADNAME;
/* only requests from this host work */
if (rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))) != htonl(INADDR_LOOPBACK))
/* this isn't likely to be used because of string to key problems, so since
this is a temporary thing anyway, we'll use it here. */
- { extern char udpAuthPrincipal[256];
+ {
+ extern char udpAuthPrincipal[256];
+
save_principal (udpAuthPrincipal, name, 0, 0);
}
+
get_time (0,0,0); /* update random value */
code = FindBlock(tt, name, "", &to, &tentry);
if (code) goto abort;
memcpy(password, &tentry.key, sizeof (*password));
code = ubik_EndTrans (tt);
+ }
#endif
return code;
}
static FiveMinuteCheckLWP()
{
- struct timeval time;
printf("start 5 min check lwp\n");
return code;
}
-static err_packet (ksoc, pkt, code, reason)
+static int err_packet (ksoc, pkt, code, reason)
int ksoc;
struct packet *pkt;
afs_int32 code;
3/* nulls */ + (2 * sizeof(afs_int32)) + strlen (buf) + 1;
if (ans.len > sizeof(ans.data)) {
printf ("Answer packet too long\n");
- return;
+ return -1;
}
*answer++ = (unsigned char) KRB_PROT_VERSION;
code, ans.len);
else perror ("err_packet: sendto");
}
+ return 0;
}
+int
process_udp_auth (ksoc, pkt)
int ksoc;
struct packet *pkt;
if ((strlen(realm) > 0) && (strcmp (realm, lrealm) != 0)) {
err_packet (ksoc, pkt, KERB_ERR_NONNULL_REALM,
"null realm name not allowed");
- return;
+ return -1;
}
memcpy(&startTime, packet, sizeof(startTime));
packet += sizeof(startTime);
if (code < 0) {
err_packet (ksoc, pkt, KERB_ERR_BAD_LIFETIME,
"requested ticket lifetime invalid");
- return;
+ return -1;
}
getstr (sname);
getstr (sinst);
if ((packet - pkt->data) != pkt->len) {
err_packet (ksoc, pkt, KERB_ERR_PKT_LENGTH, "packet length inconsistent");
- return;
+ return -1;
}
pkt->rest = packet;
code = UDP_Authenticate (ksoc, &pkt->from, name, inst,
} else
err_packet (ksoc, pkt, code, (char *)error_message (code));
}
- return;
+ return 0;
}
+int
process_udp_appl (ksoc, pkt)
int ksoc;
struct packet *pkt;
authLen = *(unsigned char *)packet++;
if (ticketLen > sizeof(ticket)) {
err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "ticket too long");
- return;
+ return -1;
}
memcpy(ticket, packet, ticketLen);
packet += ticketLen;
if (authLen > sizeof(auth)) {
err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "authenticator too long");
- return;
+ return -1;
}
memcpy(auth, packet, authLen);
pkt->rest = packet + authLen;
if (code) {
if (code == KANOENT) code = KERB_ERR_PRINCIPAL_UNKNOWN;
err_packet (ksoc, pkt, code, (char*)error_message (code));
- return;
+ return -1;
}
+ return 0;
}
+void
process_udp_request (ksoc, pkt)
int ksoc;
struct packet *pkt;
int fd;
FILE *out;
+void badEntry();
+
int listuheader, listkheader, listentries, verbose;
int readUbikHeader()
return(0);
}
+void
PrintHeader(header)
struct kaheader *header;
{
printf("stats.cpw commands = %d\n", header->stats.cpws);
}
+void
PrintEntry(index, entry)
afs_int32 index;
struct kaentry *entry;
return(principal);
}
+void
RebuildEntry(entryp)
struct kaentry *entryp;
{
char *arock;
{
afs_int32 code;
- int a;
char *dbFile;
char *outFile;
afs_int32 index;
exit (code != 0);
}
+void
badEntry(e, i)
afs_int32 e, i;
{
char *argv[];
{
struct cmd_syndesc *ts;
- struct cmd_item *ti;
setlinebuf(stdout);
afs_int32 now = time(0);
struct ktc_token token;
char cellname[MAXKTCREALMLEN];
- char realm[MAXKTCREALMLEN];
- struct ktc_principal client, server;
afs_int32 pwexpires;
LOCK_GLOBAL_MUTEX
register char *nextc;
register afs_int32 code;
int p,n;
- char tbuf[PR_MAXNAMELEN+1];
namelist lnames;
idlist lids;
#ifdef AFS_PTHREAD_ENV
assert(pthread_mutex_init(&acl_list_mutex, NULL) == 0);
#endif /* AFS_PTHREAD_ENV */
+ return 0;
}
int acl_IsAMember(aid,cps)
struct prentry *e;
int indent;
{
- int i;
pr_PrintEntry (stderr, /*net order*/0, ea, e, indent);
return 0;
char *recreateFile;
struct misc_data misc; /* info & statistics */
- int a;
- char arg[100];
-
initialize_pt_error_table();
initialize_u_error_table();
char *argv[];
{
struct cmd_syndesc *ts;
- struct cmd_item *ti;
setlinebuf(stdout);
{ struct tm *tm;
static char buffer[32];
static int this_year = 0;
- char year[6];
if (clock == 0) return "time-not-set ";
if (!this_year) {
afs_int32 code;
struct ubik_trans *tt;
afs_int32 cid;
- afs_int32 temp, i, eof, pos, maxentries, f;
+ afs_int32 i, eof, pos, maxentries, f;
struct prentry tentry;
afs_int32 pollcount=0;
#endif
struct afsconf_cell info;
int kerberosKeys; /* set if found some keys */
- afs_int32 i,j;
int lwps = 3;
char clones[MAXHOSTSPERCELL];
}
#endif
else if (*arg == '-') {
- usage:
-
/* hack in help flag support */
#ifndef AFS_NT40_ENV
#include "pterror.h"
int verbose = 0;
+void skip();
+void
report_error (code, name, gname)
afs_int32 code;
char *name;
char buf[3000];
FILE *fp;
char *ptr;
- char *aptr;
char *tmp;
char *cellname;
namelist lnames;
}
}
+void
skip(s)
char **s;
{
char aname[PR_MAXNAMELEN];
afs_int32 *aid;
{
- register afs_int32 code;
afs_int32 temp;
struct prentry tentry;
u_long host;
u_short port;
register struct rx_packet *p = (struct rx_packet *)0;
- unsigned long rfds;
- register unsigned long rrfds;
- struct clock cv;
- long nextPollTime; /* time to next poll FD before sleeping */
- int lastPollWorked, doingPoll; /* true iff last poll was useful */
- struct timeval tv, *tvp;
assert(pthread_mutex_lock(&listener_mutex)==0);
while (!listeners_started) {
exit(1);
}
AFS_SIGSET_RESTORE();
+ return 0;
}
printf("rxi_sendmsg failed, error %d\n", errno);
fflush(stdout);
}
+ return 0;
}
char *infile;
char *define;
{
- char *exec_args[MAXCPPARGS+10];
int nargs = 0;
- char **args;
char cpp_cmdline[MAXCMDLINE];
int i;
definition *defp;
int *somefrees;
{
- proc1_list *plist, *plist1;
- list *listp;
- definition *defp1;
- int preserve_flag = 0;
-
f_print(fout, "#ifndef KERNEL\n");
f_print(fout, "\tafs_int32 %s%s%s%s();\n", prefix, ServerPrefix,
PackagePrefix[PackageIndex], defp->pc.proc_name);
IN struct rx_packet *apacket;
IN struct rx_connection *aconn;
{ struct rxkad_sconn *sconn;
- afs_int32 temp;
char *challenge;
int challengeSize;
struct rxkad_v2Challenge c_v2; /* version 2 */
HKEY parmKey;
DWORD dummyLen;
long code;
- int hostsize;
if (fileNamep) {
drivep = strchr(fileNamep, ':');
#ifndef AFS_WIN95_ENV
gethostname(hostName, sizeof(hostName));
#else
+ {
+ int hostsize;
/* DJGPP version of gethostname gets the NetBIOS
name of the machine, so that is what we are using for
the AFS server name instead of the DNS name. */
hostsize = sizeof(hostName);
GetComputerName(hostName, &hostsize);
+ }
#endif /* AFS_WIN95_ENV */
havehost:
afs_uint32 aservers[]; /* list of all possible server addresses */
{
afs_uint32 myAddr[UBIK_MAX_INTERFACE_ADDR], *servList, tmpAddr;
- int count, index, found, i, j, totalServers, start, end;
+ int count, found, i, j, totalServers, start, end;
if (info)
totalServers = info->numServers;
updateUbikNetworkAddress(ubik_host)
afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR];
{
- int j, count, found, index, code = 0;
+ int j, count, code = 0;
UbikInterfaceAddr inAddr, outAddr;
struct rx_connection *conns[MAXSERVERS];
struct ubik_server *ts, *server[MAXSERVERS];
}
/* Take a buffer and mark it as the least recently used buffer */
-static int Dlru(abuf)
+static void Dlru(abuf)
struct buffer *abuf;
{
if (LruBuffer == abuf)
- return 0;
+ return;
/* Unthread from where it is in the list */
abuf->lru_next->lru_prev = abuf->lru_prev;
}
/* Take a buffer and mark it as the most recently used buffer */
-static int Dmru(abuf)
+static void Dmru(abuf)
struct buffer *abuf;
{
if (LruBuffer == abuf) {
LruBuffer = LruBuffer->lru_next;
- return 0;
+ return;
}
/* Unthread from where it is in the list */
abuf->lru_prev = LruBuffer->lru_prev;
LruBuffer->lru_prev->lru_next = abuf;
LruBuffer->lru_prev = abuf;
-
}
/* get a pointer to a particular buffer */
int page; {
/* Read a page from the disk. */
struct buffer *tb, *lastbuffer;
- afs_int32 trys, code;
+ afs_int32 code;
calls++;
lastbuffer = LruBuffer->lru_prev;
}
/* Release a buffer, specifying whether or not the buffer has been modified by the locker. */
-static DRelease (ap,flag)
+static void DRelease (ap,flag)
char *ap;
int flag; {
int index;
bp = &(Buffers[index]);
bp->lockers--;
if (flag) bp->dirty=1;
- return 0;
+ return;
}
/* flush all modified buffers, leaves dirty bits set (they're cleared
struct ubik_trans *atrans;
int atype, await;
{
- struct ubik_trans *tt;
struct ubik_dbase *dbase=atrans->dbase;
/* On first pass, initialize the lock */
}
/* Release the transaction lock */
+int
ulock_relLock(atrans)
struct ubik_trans *atrans;
{
#include "ubik_int.h"
int (*ubik_CheckRXSecurityProc)();
char *ubik_CheckRXSecurityRock;
+void printServerInfo();
/* routines for handling requests remotely-submitted by the sync site. These are
only write transactions (we don't propagate read trans), and there is at most one
register afs_int32 code;
register struct ubik_dbase *dbase;
char tbuffer[256];
- afs_int32 offset, t;
+ afs_int32 offset;
struct ubik_version tversion;
register int tlen;
struct rx_peer *tpeer;
return 0;
}
+void
printServerInfo()
{
struct ubik_server *ts;
afs_int32 awhich;
register struct ubik_sdebug_old *aparm; {
register struct ubik_server *ts;
- register int i;
+
for(ts=ubik_servers; ts; ts=ts->next) {
if (awhich-- == 0) {
/* we're done */
SVOTE_DebugOld(rxcall, aparm)
struct rx_call *rxcall;
register struct ubik_debug_old *aparm; {
- int i;
+
/* fill in the basic debug structure. Note the the RPC protocol transfers,
* integers in host order. */
#include "vlserver.h"
#include "vlclient.h"
+void fill_listattributes_entry();
+void display_listattributes_entry();
+void display_entry();
+void display_entryN();
+void display_update_entry();
+void dump_stats();
+void GetArgs();
+void print_usage();
+void fill_entry();
+void fill_update_entry();
extern int VL_GetAddrsU(), VL_RegisterAddrs();
#define VL_NUMBER_OPCODESX 34
{
register struct cmd_item *ti;
register afs_int32 code, server = 0, sawserver=0;
- afs_int32 i, id, voltype;
+ afs_int32 id, voltype;
struct vldbentry entry;
char *cmd = 0, *cellp=0;
struct VldbUpdateEntry updateentry;
} else if (!strcmp(oper,"checkhash")) {
int index, count, num=0, num1=0, num2 = 0, num3=0, num31=0, num4=0, num41=0, next_index;
struct vldbentry tentry;
- struct Vlent *vl1;
VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent));
if (VL == NULL) {
} else if (!strcmp(oper,"fixhash")) {
int index, count, num=0, num1=0, num2 = 0, next_index, x=0;
struct vldbentry tentry;
- struct Vlent *vl1;
VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent));
if (VL == NULL) {
int nentries, i;
afs_uint32 *addrp;
bulkaddrs addrs;
- struct vldbentry *entry;
struct VLCallBack vlcb;
addrs.bulkaddrs_val = 0;
int nentries1, nentries2, i, j, x, y, unique, found;
afs_uint32 *addrp1, *addrp2;
bulkaddrs addrs1, addrs2;
- struct vldbentry *entry;
struct VLCallBack vlcb;
ListAddrByAttributes attrs;
afsUUID uuid;
int i;
afs_uint32 *addrp, tad;
bulkaddrs addrs;
- struct vldbentry *entry;
afsUUID uuid;
memset(&uuid, 0, sizeof(uuid));
extern struct hostent *hostutil_GetHostByName();
struct hostent *h1, *h2;
afs_uint32 a1, a2;
- unsigned char n1[80], n2[80];
printf("changing %s", *argp);
h1 = hostutil_GetHostByName(&(*argp)[0]);
}
} else if (!strcmp(oper,"caid")) {
afs_uint32 a1, a2;
- unsigned char n1[80], n2[80];
sscanf(&(*argp)[0], "%d", &a1);
printf("changing %d (0x%x)", a1, a1);
}
+void
fill_entry(entry, argp, nargs)
struct vldbentry *entry;
char **argp;
sscanf(&(*argp)[0], "%d", &entry->cloneId);
}
-
+void
fill_update_entry(entry, argp, nargs)
struct VldbUpdateEntry *entry;
char **argp;
}
}
-
+void
fill_listattributes_entry(entry, argp, nargs)
struct VldbListByAttributes *entry;
char **argp;
entry->Mask |= VLLIST_FLAG;
}
+void
display_listattributes_entry(entry, error)
struct VldbListByAttributes *entry;
int error;
#define volumetype_string(type) (type == RWVOL? "read/write":type == ROVOL? "readonly":type == BACKVOL? "backup":"unknown")
+void
display_entry(entry, error)
struct vldbentry *entry;
int error;
printf("%12u\t%10d\t%10x\n", entry->serverNumber[i], entry->serverPartition[i], entry->serverFlags[i]);
}
+void
display_entryN(entry, error)
struct nvldbentry *entry;
int error;
}
}
-
+void
display_update_entry(entry, error)
struct VldbUpdateEntry *entry;
int error;
}
}
+void
dump_stats(stats, vital_header)
vldstats *stats;
vital_vlheader *vital_header;
printf("total %s entries=%d\n", volumetype_string(i), ntohl(vital_header->totalEntries[i]));
}
+void
GetArgs(line,args, nargs)
register char *line;
register char **args;
}
}
+void
print_usage()
{
printf("Valid Commands:\n");
char *volname;
{
unsigned int hash;
- int i;
char *vchar;
hash = 0;
char *volname;
{
char *map;
- int slen;
+ size_t slen;
map = LEGALCHARS;
slen = strlen(volname);
}
}
+void
readSIT(base, addr)
int base;
int addr;
* Record what type of entry it is and its address in the record array.
* Remember what the maximum volume id we found is and check against the header.
*/
+void
ReadAllEntries(header)
struct vlheader *header;
{
FollowFreeChain(header)
struct vlheader *header;
{
- int count=0;
+ afs_int32 count=0;
struct nvlentry vlentry;
afs_uint32 addr;
- afs_int32 i, type, rindex;
+ afs_int32 type, rindex;
/* Now follow the Free Chain */
if (verbose)
readentry(addr, &vlentry, &type);
if (type != FR) {
printf("Free Chain %d: Bad entry at %u: Not a valid free vlentry (0x%x)\n",
- i, addr, type);
+ count, addr, type);
continue;
}
struct vlheader *header;
{
int mhblocks=0;
- struct nvlentry vlentry;
- afs_uint32 addr;
afs_int32 i, j, m, rindex;
afs_int32 mhentries, regentries;
afs_int32 caddrs[VL_MAX_ADDREXTBLKS];
record[rindex].addr, caddrs[i], rindex);
}
if (record[rindex].type & FRC) {
- printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, addr);
+ printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, record[rindex].addr);
break;
}
record[rindex].type |= MHC;
}
+int
WorkerBee(as, arock)
struct cmd_syndesc *as;
char *arock;
char **argv;
{
struct cmd_syndesc *ts;
- struct cmd_item *ti;
setlinebuf(stdout);
struct rx_call *rxcall;
afs_int32 ip1, ip2;
{ struct ubik_trans *trans;
- afs_int32 errorcode, blockindex;
- struct nvlentry tentry;
+ afs_int32 errorcode;
COUNT_REQ (VLCHANGEADDR);
if (!afsconf_SuperUser(vldb_confdir, rxcall, (char *)0)) {
VldbentryLast = VldbentryFirst + allocCount;
/* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
if (attributes->Mask & VLLIST_VOLUMEID) {
- afs_int32 blockindex, chain;
- struct nvlentry tempentry;
+ afs_int32 blockindex;
blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
if (blockindex == 0) {
VldbentryLast = VldbentryFirst + allocCount;
/* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
if (attributes->Mask & VLLIST_VOLUMEID) {
- afs_int32 blockindex, chain;
- struct nvlentry tempentry;
+ afs_int32 blockindex;
blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
if (blockindex == 0) {
int errorcode=0, maxCount=VLDBALLOCCOUNT;
struct ubik_trans *trans;
struct nvlentry tentry;
- struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0, tVldbentry;
+ struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0;
afs_int32 blockindex=0, count=0, k, match, matchindex;
int serverindex=-1; /* no server found */
int findserver=0, findpartition=0, findflag=0, findname=0;
{
afs_int32 code;
struct ubik_trans *trans;
- int cnt, h, i, j, k, m, hostslot, base, index;
+ int cnt, h, i, j, k, m, base, index;
struct extentaddr *exp = 0, *tex;
afsUUID tuuid;
afs_uint32 addrs[VL_MAXIPADDRS_PERMH];
- afs_int32 fbase, findex;
+ afs_int32 fbase;
int count, willChangeEntry, foundUuidEntry, willReplaceCnt;
int WillReplaceEntry, WillChange[MAXSERVERID+1], FoundUuid, ReplaceEntry;
int srvidx, mhidx;
afsUUID *uuidpo;
afs_int32 *uniquifier, *nentries;
bulkaddrs *addrsp;
-{ register afs_int32 errorcode, index=-1, op, offset;
+{ register afs_int32 errorcode, index=-1, offset;
struct ubik_trans *trans;
- int nservers, i, j, k, base=0;
+ int nservers, i, j, base=0;
struct extentaddr *exp=0;
afsUUID tuuid;
afs_uint32 *taddrp, taddr;
int base, index, mhidx;
afsUUID tuuid;
afs_int32 blockindex, count;
- int pollcount;
+ int pollcount = 0;
struct nvlentry tentry;
if (!atrans)
afs_int32 offset;
char *buffer;
afs_int32 length; {
- struct vlentry oentry, *oep;
+ struct vlentry oentry;
struct nvlentry nentry, *nep;
char *bufp;
register afs_int32 i;
afs_int32 offset;
char *buffer;
afs_int32 length; {
- struct vlentry *oep, *obufp, tentry;
+ struct vlentry *oep, tentry;
struct nvlentry *nep, *nbufp;
char *bufp = (char *)&tentry;
register afs_int32 i;
*expp = exp;
*basep = base;
if (vldbversion != VLDBVERSION_4) {
- vldbversion != VLDBVERSION_4;
cheader.vital_header.vldbversion = htonl(VLDBVERSION_4);
code = write_vital_vlheader(trans);
if (code) ERROR_EXIT(VL_IO);
VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0],
tentry.nextIdHash[0], tentry.nextNameHash, tentry.name));
}
+ return 0;
}
VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0],
tentry.nextIdHash[0], tentry.nextNameHash, tentry.name));
}
+ return 0;
}
struct clone_items *last;
};
+void CloneVolume();
+void CloneVolume_r();
+
static ci_AddItem(ah, aino)
Inode aino;
struct clone_head *ah; {
return error;
}
+void
CloneVolume(error, original, new, old)
Error *error;
Volume *original, *new, *old;
VOL_UNLOCK
}
+void
CloneVolume_r(rerror, original, new, old)
Error *rerror;
Volume *original, *new, *old;
void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBlocks)
{
- afs_int32 rem, minavail;
*ec = 0;
/* why blocks instead of checkBlocks in the check below? Otherwise, any check
for less than BlocksSpare would skip the error-checking path, and we
blocks. */
if (blocks > 0) {
#ifdef AFS_AIX32_ENV
+ afs_int32 rem, minavail;
+
if ((rem = vp->partition->free - checkBlocks) <
(minavail = (vp->partition->totalUsable * aixlow_water) / 100))
#else
int VDiskUsage_r(Volume *vp, afs_int32 blocks)
{
- afs_int32 rem, minavail;
if (blocks > 0) {
#ifdef AFS_AIX32_ENV
+ afs_int32 rem, minavail;
+
if ((rem = vp->partition->free - blocks) <
(minavail = (vp->partition->totalUsable * aixlow_water) / 100))
#else
struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES];
private int moveHash();
+void StickOnLruChain_r();
+void VPutVnode_r();
#define BAD_IGET -1000
}
if (nVnodes == 0)
- return;
+ return 0;
va = (byte *) calloc(nVnodes,vcp->residentSize);
assert (va != NULL);
}
va += vcp->residentSize;
}
+ return 0;
}
LWP_CurrentProcess(&vnp->writer);
#endif /* AFS_PTHREAD_ENV */
/* Sanity check: is this vnode really not in use? */
- { int n;
+ {
int size;
IHandle_t *ihP = vp->vnodeIndex[class].handle;
FdHandle_t *fdP;
int TrustVnodeCacheEntry = 1;
/* This variable is bogus--when it's set to 0, the hash chains fill
up with multiple versions of the same vnode. Should fix this!! */
-
+void
VPutVnode(ec,vnp)
Error *ec;
register Vnode *vnp;
VOL_UNLOCK
}
+void
VPutVnode_r(ec,vnp)
Error *ec;
register Vnode *vnp;
vnp->hashNext = VnodeHashTable[newHash];
VnodeHashTable[newHash] = vnp;
vnp->hashIndex = newHash;
+ return 0;
}
+void
StickOnLruChain_r(vnp,vcp)
register Vnode *vnp;
register struct VnodeClassInfo *vcp;
int GetInodeSummary(char *path, VolumeId singleVolumeNumber)
{
struct stat status;
- int summaryFd, forceSal, err;
+ int forceSal, err;
struct ViceInodeInfo *ip;
struct InodeSummary summary;
char summaryFileName[50];
struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
- int code;
int size;
StreamHandle_t *file;
int vnodeIndex;
char buf[4096];
IHandle_t *srcH, *destH;
FdHandle_t *srcFdP, *destFdP;
- register int n;
+ register int n = 0;
IH_INIT(srcH, device, rwvolume, inode1);
srcFdP = IH_OPEN(srcH);
#include <strings.h>
#endif
+void AssignVolumeName();
+void AssignVolumeName_r();
+void ClearVolumeStats();
+void ClearVolumeStats_r();
+
#define nFILES (sizeof (stuff)/sizeof(struct stuff))
no parent */
{
VolumeDiskData vol;
- int fd, fd1, i;
+ int fd, i;
char headerName[32], volumePath[64];
- struct stat status;
Device device;
struct DiskPartition *partition;
struct VolumeDiskHeader diskHeader;
- int code;
IHandle_t *handle;
FdHandle_t *fdP;
Inode nearInode=0;
-
-
*ec = 0;
memset(&vol, 0, sizeof (vol));
vol.id = volumeId;
}
+void
AssignVolumeName(vol, name, ext)
register VolumeDiskData *vol;
char *name,*ext;
VOL_UNLOCK
}
+void
AssignVolumeName_r(vol, name, ext)
register VolumeDiskData *vol;
char *name,*ext;
return(code);
}
+void
ClearVolumeStats(vol)
register VolumeDiskData *vol;
{
VOL_UNLOCK
}
+void
ClearVolumeStats_r(vol)
register VolumeDiskData *vol;
{
abort();
}
+void
InitErrTabs()
{
initialize_ka_error_table();
{
int code = 0, lcode = 0, error = 0;
afs_int32 pad = 0, offset;
- int n, nbytes, howMany;
+ int n, nbytes, howMany, howBig;
byte *p;
struct stat status;
int size;
#endif
#ifdef AFS_NT40_ENV
- howMany = 4096; /* Page size */
+ howBig = _filelength(handleP->fd_fd);
+ howMany = 4096;
+
#else
fstat(handleP->fd_fd, &status);
+ howBig = status.st_size;
+
#ifdef AFS_AIX_ENV
/* Unfortunately in AIX valuable fields such as st_blksize are
* gone from the stat structure.
howMany = tstatfs.f_bsize;
#else
howMany = status.st_blksize;
-#endif
+#endif /* AFS_AIX_ENV */
#endif /* AFS_NT40_ENV */
+
size = FDH_SIZE(handleP);
code = DumpInt32(iodp, tag, size);
if (code) {
*/
memset(p+n, 0, howMany-n);
if (!pad)
- offset = (status.st_size - nbytes) + n;
+ offset = (howBig - nbytes) + n;
pad += (howMany-n);
/* Now seek over the data we could not get. An error here means we
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
StreamHandle_t *file;
- IHandle_t *handle;
FdHandle_t *fdP;
int size;
int flag;
}
/* Changes the rw site only */
+void
SetAValue (entry, oserver, opart, nserver, npart, type)
struct nvldbentry *entry;
afs_int32 oserver, opart, nserver, npart, type;
struct rx_call *acid;
struct pIDs *partIds;
{
- struct stat rbuf, pbuf;
char namehead[9];
+ struct stat rbuf, pbuf;
int code;
char i;
+
+ strcpy(namehead, "/vicep"); /*7 including null terminator*/
+
#ifdef AFS_NT40_ENV
/* Just return attached partitions. */
- strcpy(namehead, "/vicep");
namehead[7] = '\0';
for (i=0; i<26; i++) {
namehead[6] = i + 'a';
partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1;
}
#else
- strcpy(namehead, "/vicep"); /*7 including null terminator*/
- code = stat("/",&rbuf); /*interested in buf->st_dev*/
+ (void) stat("/",&rbuf); /*interested in buf->st_dev*/
for(i = 0 ; i < 26 ; i++){
else partIds->partIds[i ] = -1;
}
else partIds->partIds[i ] = -1;
-
-
}
#endif
return 0;
if (vcode == RXGEN_OPCODE) {
/* Vlserver not running with ListAttributesN2. Fall back */
vcode = VLDB_ListAttributes(&attributes, ¢ries, &arrayEntries);
- nextindex == -1;
+ nextindex = -1;
}
if (vcode) {
fprintf(STDERR,"Could not access the VLDB for attributes\n");
extern int VL_ReleaseLock();
extern int VL_DeleteEntry();
+void MapNetworkToHost();
+void MapHostToNetwork();
+
struct release {
afs_int32 time;
afs_int32 vldbEntryIndex;
};
/*map the partition <partId> into partition name <partName>*/
+void
MapPartIdIntoName(partId, partName)
afs_int32 partId;
char *partName;
strcpy(partName,"/vicep");
partName[6] = partId + 'a';
partName[7] = '\0';
- return 0;
+ return;
} else if (partId < VOLMAXPARTS) {
strcpy(partName,"/vicep");
partId -= 26;
partName[6] = 'a' + (partId/26);
partName[7] = 'a' + (partId%26);
partName[8] = '\0';
- return 0;
+ return;
}
}
void EnumerateEntry(entry)
struct nvldbentry *entry;
{
- int i;
- char pname[10];
- int isMixed = 0;
fprintf(STDOUT,"\n");
fprintf(STDOUT,"%s \n",entry->name);
afs_int32 aid;
{
register struct rx_connection *aconn;
- register afs_int32 code;
afs_int32 error;
- afs_int32 rcode,vcode;
+ afs_int32 vcode;
struct nvldbentry entry,storeEntry;/*the new vldb entry */
aconn = (struct rx_connection *)0;
struct rx_connection *conn;
afs_int32 vid, part, flags;
{
- afs_int32 acode, bcode, ccode, rcode, tid;
+ afs_int32 acode, ccode, rcode, tid;
ccode = rcode = tid = 0;
acode = AFSVolTransCreate(conn, vid, part, flags, &tid);
afs_int32 cloneVolId, roVolId;
struct replica *replicas=0;
struct nvldbentry entry,storeEntry;
- int i, volcount, k, m, n, fullrelease, vldbindex;
+ int i, volcount, m, fullrelease, vldbindex;
int failure;
struct restoreCookie cookie;
struct rx_connection **toconns=0;
afs_int32 clonetid=0, onlinetid;
afs_int32 fromtid=0;
afs_uint32 fromdate, thisdate;
- int ix, si, s;
+ int s;
manyDests tr;
manyResults results;
int rwindex, roindex, roclone, roexists;
int idx, j;
afs_int32 code, error = 0;
struct nvldbentry entry, storeEntry;
- int sameserver;
char pname[10];
int pass=0, islocked=0, createentry, addvolume, modified, mod;
afs_int32 rwvolid;
afs_int32 *modified;
{
afs_int32 code, error=0;
- int idx;
struct nvldbentry storeEntry;
int islocked=0, mod, modentry, delentry=0;
- int foundro, pass=0;
+ int pass=0;
if (modified) *modified = 0;
if (verbose) {
/*maps the host addresses in <old > (present in network byte order) to
that in< new> (present in host byte order )*/
+void
MapNetworkToHost(old, new)
struct nvldbentry *old, *new;
{
new->volumeId[BACKVOL] = old->volumeId[BACKVOL];
new->cloneId = old->cloneId;
new->flags = old->flags;
-
}
/*maps the host entries in <entry> which are present in host byte order to network byte order */
+void
MapHostToNetwork(entry)
struct nvldbentry *entry;
{
struct nvldbentry *entryp;
{
struct vldbentry oentry;
- register int code, (*nproc)();
+ register int code;
if (newvlserver == 1) {
tryold:
struct nvldbentry *entryp;
{
struct vldbentry oentry;
- register int code, (*nproc)();
+ register int code;
if (newvlserver == 1) {
tryold:
struct nvldbentry *entryp;
{
struct vldbentry oentry;
- register int code, (*nproc)();
+ register int code;
if (newvlserver == 1) {
tryold:
struct nvldbentry *entryp;
{
struct vldbentry oentry;
- register int code, (*nproc)();
+ register int code;
if (newvlserver == 1) {
tryold:
VLDB_IsSameAddrs(serv1, serv2, errorp)
afs_int32 serv1, serv2, *errorp;
{
- struct vldbentry oentry;
- register int code, (*nproc)();
+ register int code;
ListAddrByAttributes attrs;
bulkaddrs addrs;
afs_uint32 *addrp, nentries, unique, i, j, f1, f2;
char *str,*ptr, volname[VOLSER_OLDMAXVOLNAME+1];
int tryname, curval;
struct nvldbentry entry;
- afs_int32 vcode;
+ afs_int32 vcode = 0;
int total;
*errp = 0;