afs_int32 shouldRetry = 0;
afs_int32 serversleft = 1;
struct afs_stats_RPCErrors *aerrP;
- afs_int32 markeddown;
afs_uint32 address;
if (AFS_IS_DISCONNECTED && !AFS_IN_SYNC) {
*/
goto out;
}
- markeddown = afs_ServerDown(sa, acode);
+ afs_ServerDown(sa, acode);
ForceNewConnections(sa); /**multi homed clients lock:afs_xsrvAddr? */
if (aerrP)
(aerrP->err_Server)++;
#endif
struct afs_conn *tc;
- afs_int32 i;
struct rx_call *tcall;
struct tlocal1 {
struct AFSVolSync tsync;
tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */, &rxconn);
if (tc) {
avc->callback = tc->srvr->server;
- i = osi_Time();
tcall = rx_NewCall(rxconn);
#ifdef AFS_64BIT_CLIENT
if (!afs_serverHasNo64Bit(tc)) {
while (1) {
afs_int32 cellnum, clen, magic;
- struct cell_name *cn;
char *cellname;
cc = afs_osi_Read(tfile, off, &magic, sizeof(magic));
break;
}
- cn = afs_cellname_new(cellname, cellnum);
+ afs_cellname_new(cellname, cellnum);
afs_osi_Free(cellname, clen + 1);
}
void
shutdown_vnodeops(void)
{
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV)
- struct buf *afs_bread_freebp = 0;
-#endif
-
-
AFS_STATCNT(shutdown_vnodeops);
if (afs_cold_shutdown) {
#ifndef AFS_SUN5_ENV /* XXX */
#endif
#ifndef AFS_LINUX20_ENV
afs_rd_stash_i = 0;
-#endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV)
- afs_bread_freebp = 0;
#endif
shutdown_mariner();
}
osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype)
{
struct vcache *tvc;
- int LRUme;
unsigned int key, skey;
char *ts = aname;
- struct nc *tnc, *tnc1 = 0;
+ struct nc *tnc;
int safety;
#ifdef AFS_DARWIN80_ENV
vnode_t tvp;
if ( /* (tnc->key == key) && */ (tnc->dirp == adp)
&& (!strcmp((char *)tnc->name, aname))) {
tvc = tnc->vp;
- tnc1 = tnc;
break;
} else if (tnc->next == nameHash[skey]) { /* end of list */
break;
}
}
- LRUme = 0; /* (tnc != nameHash[skey]); */
ReleaseReadLock(&afs_xdnlc);
if (!tvc) {
DECL_PIOCTL(PPrefetchFromTape)
{
- afs_int32 code, code1;
- afs_int32 bytes, outval;
+ afs_int32 code;
+ afs_int32 outval;
struct afs_conn *tc;
struct rx_call *tcall;
struct AFSVolSync tsync;
StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->f.fid.Fid, 0,
0);
if (!code) {
- bytes = rx_Read(tcall, (char *)&outval, sizeof(afs_int32));
+ rx_Read(tcall, (char *)&outval, sizeof(afs_int32));
code =
EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync);
}
- code1 = rx_EndCall(tcall, code);
+ code = rx_EndCall(tcall, code);
RX_AFS_GLOCK();
} else
code = -1;
afs_hyper_t newDV, oldDV; /* DV when we start, and finish, respectively */
struct dcache **dcList;
unsigned int i, j, minj, moredata, high, off;
- afs_size_t tlen;
afs_size_t maxStoredLength; /* highest offset we've written to server. */
int safety, marineronce = 0;
origCBs = afs_allCBs;
maxStoredLength = 0;
- tlen = avc->f.m.Length;
minj = 0;
do {
{
struct server *oldts = 0, *ts, *newts, *orphts = 0;
struct srvAddr *oldsa, *newsa, *nextsa, *orphsa;
- u_short fsport;
afs_int32 iphash, k, srvcount = 0;
unsigned int srvhash;
if (acell)
newts->cell = afs_GetCell(acell, 0);
- fsport = (newts->cell ? newts->cell->fsport : AFS_FSPORT);
-
/* For each IP address we are registering */
for (k = 0; k < nservers; k++) {
iphash = SHash(aserverp[k]);
struct AFSVolSync *tsyncp)
{
afs_int32 code;
- afs_uint32 start;
struct afs_conn *tc;
struct rx_connection *rxconn;
struct AFSFetchStatus OutDirStatus;
if (tc) {
if (serverp)
*serverp = tc->srvr->server;
- start = osi_Time();
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_XLOOKUP);
RX_AFS_GUNLOCK();
code =
int hostLines; /* number of lines of host names to display */
struct onode **ovw_fsNames_o_Ptr; /* index to list of fs names onodes */
struct onode **ovw_cmNames_o_Ptr; /* index to list of cm names onodes */
- int code;
int i;
if (afsmon_debug) {
sprintf(errMsg, "[ %s ] Failed to create initMsg_o onode\n", rn);
afsmon_Exit(250);
}
- code = gtxframe_AddToList(ovwFrame, initMsg_o);
- code = gator_light_set(initMsg_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, initMsg_o);
+ gator_light_set(initMsg_o, HIGHLIGHT);
initMsg_on = 1;
sprintf(errMsg, "[ %s ] Failed to create command onode\n", rn);
afsmon_Exit(265);
}
- code = gtxframe_AddToList(ovwFrame, ovw_cmd_o);
- code = gator_light_set(ovw_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_cmd_o);
+ gator_light_set(ovw_cmd_o, HIGHLIGHT);
/* create the program name object */
sprintf(errMsg, "[ %s ] Failed to create programName onode\n", rn);
afsmon_Exit(255);
}
- code = gtxframe_AddToList(ovwFrame, ovw_progName_o);
- code = gator_light_set(ovw_progName_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_progName_o);
+ gator_light_set(ovw_progName_o, HIGHLIGHT);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(260);
}
- code = gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
- code = gator_light_set(ovw_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
+ gator_light_set(ovw_pageNum_o, HIGHLIGHT);
/* create the probe number object */
ovw_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create probe number onode\n", rn);
afsmon_Exit(270);
}
- code = gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
- code = gator_light_set(ovw_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
+ gator_light_set(ovw_probeNum_o, HIGHLIGHT);
/* create the numFS monitored object */
ovw_numFS_o = initLightObject("", 0, 2, FC_NUMHOSTS_O_WIDTH, afsmon_win);
sprintf(errMsg, "[ %s ] Failed to create numFS onode\n", rn);
afsmon_Exit(275);
}
- code = gtxframe_AddToList(ovwFrame, ovw_numFS_o);
+ gtxframe_AddToList(ovwFrame, ovw_numFS_o);
/* create the numCM monitored object */
ovw_numCM_o =
sprintf(errMsg, "[ %s ] Failed to create numCM_o onode\n", rn);
afsmon_Exit(280);
}
- code = gtxframe_AddToList(ovwFrame, ovw_numCM_o);
+ gtxframe_AddToList(ovwFrame, ovw_numCM_o);
/* create the number-of-FS-alerts object */
ovw_FSalerts_o =
sprintf(errMsg, "[ %s ] Failed to create FSalerts_o onode\n", rn);
afsmon_Exit(285);
}
- code = gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
+ gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
/* create the number-of-CM-alerts object */
ovw_CMalerts_o =
sprintf(errMsg, "[ %s ] Failed to create CMalerts_o onode\n", rn);
afsmon_Exit(290);
}
- code = gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
+ gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
/* create file-server-name and cache-manager-names objects */
ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES;
* fflush(debugFD);
* }
*/
- code = gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
+ gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
ovw_fsNames_o_Ptr++;
}
sprintf(errMsg, "[ %s ] Failed to create a CM name onode\n", rn);
afsmon_Exit(310);
}
- code = gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
+ gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
ovw_cmNames_o_Ptr++;
}
struct onode **fsLabels_o_Ptr;
int x_pos;
int y_pos;
- int code;
int i;
int j;
int numBytes;
sprintf(errMsg, "[ %s ] Failed to create fs command onode\n", rn);
afsmon_Exit(340);
}
- code = gtxframe_AddToList(fsFrame, fs_cmd_o);
- code = gator_light_set(fs_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_cmd_o);
+ gator_light_set(fs_cmd_o, HIGHLIGHT);
/* we already have the dimensions for the frame - same as the ovw frame */
/* use the ovw program name object for the fs screen too */
- code = gtxframe_AddToList(fsFrame, ovw_progName_o);
+ gtxframe_AddToList(fsFrame, ovw_progName_o);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(335);
}
- code = gtxframe_AddToList(fsFrame, fs_pageNum_o);
- code = gator_light_set(fs_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_pageNum_o);
+ gator_light_set(fs_pageNum_o, HIGHLIGHT);
/* create the probe number object */
fs_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create fs probeNum onode\n", rn);
afsmon_Exit(345);
}
- code = gtxframe_AddToList(fsFrame, fs_probeNum_o);
- code = gator_light_set(fs_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_probeNum_o);
+ gator_light_set(fs_probeNum_o, HIGHLIGHT);
/* create the numFS monitored object */
"[ %s ] Failed to create numFS onode for the fs frame\n", rn);
afsmon_Exit(350);
}
- code = gtxframe_AddToList(fsFrame, fs_numFS_o);
+ gtxframe_AddToList(fsFrame, fs_numFS_o);
/* create the "more columns to left" indicator */
fs_leftArrows_o =
rn);
afsmon_Exit(355);
}
- code = gtxframe_AddToList(fsFrame, fs_leftArrows_o);
+ gtxframe_AddToList(fsFrame, fs_leftArrows_o);
/* create the "more columns to right" indicator */
fs_rightArrows_o =
rn);
afsmon_Exit(360);
}
- code = gtxframe_AddToList(fsFrame, fs_rightArrows_o);
+ gtxframe_AddToList(fsFrame, fs_rightArrows_o);
sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn);
afsmon_Exit(375);
}
- code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
+ gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
/* if (afsmon_debug) {
* fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
"[ %s ] Failed to create an FS data onode\n", rn);
afsmon_Exit(380);
}
- code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
+ gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
fs_data_o_Ptr++;
} /* for each column */
rn);
afsmon_Exit(390);
}
- code = gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
+ gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
fsLabels_o_Ptr++;
}
struct onode **cmLabels_o_Ptr;
int x_pos;
int y_pos;
- int code;
int i;
int j;
int numBytes;
sprintf(errMsg, "[ %s ] Failed to create cm command onode\n", rn);
afsmon_Exit(420);
}
- code = gtxframe_AddToList(cmFrame, cm_cmd_o);
- code = gator_light_set(cm_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_cmd_o);
+ gator_light_set(cm_cmd_o, HIGHLIGHT);
/* we already have the dimensions for the frame - same as the ovw frame */
/* use the ovw program name object for the cm screen too */
- code = gtxframe_AddToList(cmFrame, ovw_progName_o);
+ gtxframe_AddToList(cmFrame, ovw_progName_o);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(415);
}
- code = gtxframe_AddToList(cmFrame, cm_pageNum_o);
- code = gator_light_set(cm_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_pageNum_o);
+ gator_light_set(cm_pageNum_o, HIGHLIGHT);
/* create the probe number object */
cm_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create cm probeNum onode\n", rn);
afsmon_Exit(425);
}
- code = gtxframe_AddToList(cmFrame, cm_probeNum_o);
- code = gator_light_set(cm_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_probeNum_o);
+ gator_light_set(cm_probeNum_o, HIGHLIGHT);
/* create the numCM monitored object */
"[ %s ] Failed to create numCM onode for the cm frame\n", rn);
afsmon_Exit(430);
}
- code = gtxframe_AddToList(cmFrame, cm_numCM_o);
+ gtxframe_AddToList(cmFrame, cm_numCM_o);
/* create the "more columns to left" indicator */
cm_leftArrows_o =
rn);
afsmon_Exit(435);
}
- code = gtxframe_AddToList(cmFrame, cm_leftArrows_o);
+ gtxframe_AddToList(cmFrame, cm_leftArrows_o);
/* create the "more columns to right" indicator */
cm_rightArrows_o =
rn);
afsmon_Exit(440);
}
- code = gtxframe_AddToList(cmFrame, cm_rightArrows_o);
+ gtxframe_AddToList(cmFrame, cm_rightArrows_o);
sprintf(errMsg, "[ %s ] Failed to create an CM name onode\n", rn);
afsmon_Exit(455);
}
- code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
+ gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
/* if (afsmon_debug) {
* fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
"[ %s ] Failed to create an CM data onode\n", rn);
afsmon_Exit(460);
}
- code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
+ gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
cm_data_o_Ptr++;
} /* for each column */
rn);
afsmon_Exit(470);
}
- code = gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
+ gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
cmLabels_o_Ptr++;
}
char *handlerPtr; /* ptr to pass theresh handler string */
int code = 0; /* error code */
int linenum = 0; /* config file line number */
- int threshCount; /* count of thresholds for each server */
int error_in_config; /* syntax errors in config file ?? */
int i;
int numBytes;
numFS = 0;
numCM = 0;
- threshCount = 0;
error_in_config = 0; /* flag to note if config file has syntax errors */
while ((fgets(line, CFG_STR_LEN, configFD)) != NULL) {
char fileName[256]; /* file name to execute */
int i;
char *ch;
- int code;
int argNum;
int anotherArg; /* boolean used to flag if another arg is available */
if (fork() == 0) {
exec_fsThreshHandler = 1;
- code = afsmon_Exit(60);
+ afsmon_Exit(60);
}
return (0);
hdl_notifier(struct bnode_proc *tp)
{
#ifndef AFS_NT40_ENV /* NT notifier callout not yet implemented */
- int code, pid;
+ int pid;
struct stat tstat;
if (stat(tp->bnode->notifier, &tstat)) {
if ((pid = fork()) == 0) {
FILE *fout;
struct bnode *tb = tp->bnode;
- int ec;
#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI51_ENV)
- ec = setsid();
+ setsid();
#elif defined(AFS_DARWIN90_ENV)
- ec = setpgid(0, 0);
+ setpgid(0, 0);
#elif defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV)
- ec = setpgrp();
+ setpgrp();
#else
- ec = setpgrp(0, 0);
+ setpgrp(0, 0);
#endif
fout = popen(tb->notifier, "w");
if (fout == NULL) {
perror(tb->notifier);
exit(1);
}
- code = SendNotifierData(fileno(fout), tp);
+ SendNotifierData(fileno(fout), tp);
pclose(fout);
exit(0);
} else if (pid < 0) {
udbClientTextP ctPtr;
FILE *stream;
- struct bc_config *configPtr;
extern struct bc_config *bc_globalConfig;
ctPtr = &bc_globalConfig->configText[TB_VOLUMESET];
stream = ctPtr->textStream;
- configPtr = bc_globalConfig;
/*
* Open up the volume set configuration file, fail if it can't be done.
udbClientTextP ctPtr;
FILE *stream;
- struct bc_config *configPtr;
extern struct bc_config *bc_globalConfig;
ctPtr = &bc_globalConfig->configText[TB_VOLUMESET];
stream = ctPtr->textStream;
- configPtr = bc_globalConfig;
/* must be locked */
if (ctPtr->lockHandle == 0)
#include <lock.h>
#include "budb.h"
+#if !defined(offsetof)
+#include <stddef.h> /* for definition of offsetof() */
+#endif
+
typedef afs_uint32 dbadr;
struct hashTable {
extern struct memoryDB db;
#define set_header_word(ut,field,value) \
- dbwrite ((ut), ((char *)&(db.h.field) - (char *)&db.h), \
+ dbwrite ((ut), (offsetof(struct dbHeader, field)), \
((db.h.field = (value)), (char *)&(db.h.field)), \
sizeof(afs_int32))
{
/* better pass 8 bytes, length not checked here */
- int i, j, n; /* i = r10, j = r9, n = r8 */
+ int i, j;
unsigned int temp; /* r7 */
char *p_char; /* r6 */
key k_char;
i = 8;
- n = 0;
p_char = k_char;
-#ifdef lint
- n = n; /* fool it in case of VAXASM */
-#endif
#ifdef DEBUG
if (des_debug)
fprintf(stderr, "\n\ninput key, left to right = ");
afs_int32 * pwexpires)
{
struct ka_ticketAnswer *answer;
- afs_uint32 cksum;
unsigned char tempc;
answer = (struct ka_ticketAnswer *)oanswer->SeqBody;
- cksum = ntohl(answer->cksum);
if (challenge != ntohl(answer->challenge))
return KABADPROTOCOL;
memcpy(&token->sessionKey, &answer->sessionKey,
#include "kautils.h"
#include "kaserver.h"
+#if !defined(offsetof)
+#include <stddef.h> /* for definition of offsetof() */
+#endif
+
extern Date cheaderReadTime; /* time cheader last read in */
-#define set_header_word(tt,field,value) kawrite ((tt), ((char *)&(cheader.field) - (char *)&cheader), ((cheader.field = (value)), (char *)&(cheader.field)), sizeof(afs_int32))
+#define set_header_word(tt,field,value) kawrite ((tt), (offsetof(struct kaheader, field)), ((cheader.field = (value)), (char *)&(cheader.field)), sizeof(afs_int32))
-#define inc_header_word(tt,field) kawrite ((tt), ((char *)&(cheader.field) - (char *)&cheader), ((cheader.field = (htonl(ntohl(cheader.field)+1))), (char *)&(cheader.field)), sizeof(afs_int32))
+#define inc_header_word(tt,field) kawrite ((tt), (offsetof(struct kaheader, field)), ((cheader.field = (htonl(ntohl(cheader.field)+1))), (char *)&(cheader.field)), sizeof(afs_int32))
static int index_OK(afs_int32);
Date now = time(0);
afs_int32 newkeyver; /* new key version number */
afs_int32 newtotalkeyentries = 0, oldtotalkeyentries = 0, keyentries;
- int foundcurrentkey = 0, addednewkey = 0, modified;
+ int addednewkey = 0, modified;
+#ifdef AUTH_DBM_LOG
+ int foundcurrentkey = 0;
+#endif
+
es_Report("Newkey for %s.%s\n", tentry->userID.name,
tentry->userID.instance);
("Warning: Entry %s.%s contains more than one valid key: fixing\n",
tentry->userID.name, tentry->userID.instance));
}
-#endif
foundcurrentkey = 1;
+#endif
}
/* If we find an oldkey of the same version or
static int
simplify_name(char *orig_name, char *true_name)
{
- int thru_symlink;
struct stat statbuff;
- thru_symlink = 0;
-
#ifdef AFS_NT40_ENV
if (stat(orig_name, &statbuff) < 0) {
*true_name = '\0';
* the contents of the link for the file name.
*/
if ((statbuff.st_mode & S_IFMT) == S_IFLNK) {
- thru_symlink = 1;
link_chars_read = readlink(orig_name, true_name, 1024);
if (link_chars_read <= 0) {
*true_name = '\0';
struct passwd pwent;
struct passwd *pw = &pwent;
- int insist; /* insist on good password quality */
int lexplicit = 0; /* servers specified explicitly */
int local; /* explicit cell is same a local cell */
int foundPassword = 0; /*Not yet, anyway */
give_to_child(passwd);
/* Get new password if it wasn't provided. */
- insist = 0;
if (!foundNewPassword) {
if (Pipe)
getpipepass(npasswd, sizeof(npasswd));
afs_status_t st = 0;
const char *user = as->parms[USER].items->data;
pts_UserUpdateEntry_t entry;
- int have_quota = 0;
int have_list_status_perm = 0;
int have_list_groups_owned_perm = 0;
int have_list_membership_perm = 0;
entry.groupCreationQuota =
GetIntFromString(as->parms[GROUPQUOTA].items->data, "bad quota");
entry.flag = PTS_USER_UPDATE_GROUP_CREATE_QUOTA;
- have_quota = 1;
}
if (as->parms[LISTSTATUS].items) {
struct destServer destination;
struct nvldbentry entry;
- int islocked, pntg;
- afs_int32 error;
+ int islocked;
int same;
afs_int32 store_flags;
fromtid = 0;
totid = 0;
clonetid = 0;
- error = 0;
volid = 0;
- pntg = 0;
backupId = 0;
newVol = 0;
*/
fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT);
fromtid = 0;
- pntg = 1;
tst =
AFSVolTransCreate(fromconn, afromvol, afrompart, ITOffline,
}
fromtid = 0;
- error = 0;
goto fail_UV_MoveVolume;
}
}
}
- pntg = 1;
toconn = UV_Bind(cellHandle, atoserver, AFSCONF_VOLUMEPORT); /* get connections to the servers */
fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT);
fromtid = totid = 0; /* initialize to uncreated */
afs_int32 rcode;
struct nvldbentry entry;
- afs_int32 error;
int islocked;
islocked = 0;
- error = 0;
rxError = 0;
fromcall = (struct rx_call *)0;
fromconn = (struct rx_connection *)0;
afs_int32 temptid;
int success;
struct nvldbentry entry;
- afs_int32 error;
int islocked;
struct restoreCookie cookie;
int reuseID;
memset(&cookie, 0, sizeof(cookie));
islocked = 0;
success = 0;
- error = 0;
reuseID = 1;
tocall = (struct rx_call *)0;
toconn = (struct rx_connection *)0;
int islocked = 0;
int pass = 0;
afs_int32 modentry = 0;
- afs_int32 delentry = 0;
if (modified) {
*modified = 0;
if (tst) {
goto fail_CheckVldb;
}
- delentry = 1;
} else {
/* Replace old entry with our new one */
if (!VLDB_ReplaceEntry
{
int rc = 0;
afs_status_t tst = 0;
- afs_int32 code, vcode;
int noError;
afs_int32 nentries, tentries = 0;
struct VldbListByAttributes attributes;
afs_int32 si, nsi;
afs_int32 modified = 0;
- code = 0;
- vcode = 0;
noError = 1;
arrayEntries.nbulkentries_val = 0;
int rc = 0;
afs_status_t tst = 0;
afs_status_t etst = 0;
- afs_int32 rcode, error;
+ afs_int32 rcode;
int i, index;
char nameBuffer[256];
afs_int32 tid;
struct rx_connection *aconn;
int islocked;
- error = 0;
aconn = (struct rx_connection *)0;
tid = 0;
islocked = 0;
UV_VolumeZap(afs_cell_handle_p cellHandle, struct rx_connection *server,
unsigned int partition, afs_uint32 volumeId, afs_status_p st)
{
- afs_int32 rcode, ttid, error, code;
+ afs_int32 rcode, ttid;
int rc = 0;
afs_status_t tst = 0;
- code = 0;
- error = 0;
ttid = 0;
tst = AFSVolTransCreate(server, volumeId, partition, ITOffline, &ttid);
if (id == PRBADID)
continue;
else if (id) {
- int eid_s, id_s;
+ int id_s;
sgcount++;
/* in case the ids are large, convert to pure sign. */
if (id > 0)
id_s = 1;
else
id_s = -1;
- if (eid > 0)
- eid_s = 1;
- else
- eid_s = -1;
if (id_s > 0) {
fprintf(stderr,
"User can't be member of supergroup list\n");
for (plist = defp->pc.plists; plist; plist = plist->next) {
if (plist->component_kind == DEF_PARAM
&& (plist->pl.param_flag & FREETHIS_PARAM)) {
- char *dot = "", *extens = "";
- if (plist->pl.string_name) {
- dot = ".";
- extens = plist->pl.string_name;
- }
f_print(fout, "\tif (!%s) goto fail1;\n", plist->scode);
}
}
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
e = der_put_integer(p, len, data, &l);
if (e)
return e;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* enc-part */
{
size_t Top_tag_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* ad-data */
{
size_t Top_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* cipher */
{
size_t Top_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* address */
{
size_t Top_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* authorization-data */
if ((data)->authorization_data) {
size_t Top_tag_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
e = der_put_generalized_time(p, len, data, &l);
if (e)
return e;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* contents */
{
size_t Top_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
/* keyvalue */
{
size_t Top_tag_oldret = ret;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
{
unsigned char c = 0;
if (len < 1)
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
e = der_put_general_string(p, len, data, &l);
if (e)
return e;
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
{
int enumint = (int) *data;
e = der_put_integer(p, len, &enumint, &l);
{
size_t ret = 0;
size_t l;
- int i, e;
+ int e;
- i = 0;
{
int enumint = (int) *data;
e = der_put_integer(p, len, &enumint, &l);
{ /*mini_PrintDiskStats */
static char rn[] = "mini_PrintDiskStats"; /*Routine name */
- int code; /*Return code */
char s[128]; /*String buffer */
struct onode *curr_disklight; /*Ptr to current disk light */
struct onode *srvname_light; /*Ptr to server name light */
used_disk_idx, diskdata->label);
fflush(scout_debugfd);
}
- code = mini_justify(" ", /*Src buffer */
+ mini_justify(" ", /*Src buffer */
diskdata->label, /*Dest buffer */
scout_col_width[COL_DISK], /*Dest's width */
SCOUT_RIGHT_JUSTIFY, /*Right-justify */
SCOUT_LEFT_TRUNC, /*Left-truncate */
SCOUT_ISNT_LDISK); /*Not a labeled disk */
- code = gator_light_set(curr_disklight, 0);
+ gator_light_set(curr_disklight, 0);
if (a_fix_line_num) {
curr_disklight->o_y += a_delta_line_num;
disk_strparams = (struct gwin_strparams *)(diskdata->llrock);
rn, s, found_idx, diskdata->label);
fflush(scout_debugfd);
}
- code = mini_justify(s, /*Src buffer */
+ mini_justify(s, /*Src buffer */
diskdata->label, /*Dest buffer */
scout_col_width[COL_DISK], /*Dest's width */
SCOUT_LEFT_JUSTIFY, /*Left-justify */
SCOUT_LEFT_TRUNC, /*Left-truncate */
SCOUT_IS_LDISK); /*Labeled disk */
- code = gator_light_set(sc_disk->disk_lp, pastthreshold);
+ gator_light_set(sc_disk->disk_lp, pastthreshold);
} /*Found disk record */
}
struct ubik_server *bestServer = NULL;
struct ubik_server *ts;
int dbok, doingRPC, now;
- afs_int32 lastProbeTime, lastDBVCheck;
+ afs_int32 lastProbeTime;
/* if we're the sync site, the best db version we've found yet */
static struct ubik_version bestDBVersion;
struct ubik_version tversion;
char hoststr[16];
#ifndef OLD_URECOVERY
char pbuffer[1028];
- int flen, fd = -1;
+ int fd = -1;
afs_int32 pass;
#endif
/* otherwise, begin interaction */
urecovery_state = 0;
lastProbeTime = 0;
- lastDBVCheck = 0;
while (1) {
/* Run through this loop every 4 seconds */
tv.tv_sec = 4;
*/
urecovery_state &= ~UBIK_RECHAVEDB;
}
- lastDBVCheck = FT_ApproxTime();
urecovery_state |= UBIK_RECFOUNDDB;
urecovery_state &= ~UBIK_RECSENTDB;
}
goto FetchEndCall;
}
#ifndef OLD_URECOVERY
- flen = length;
afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
if (fd < 0) {
char hoststr[16];
#ifndef OLD_URECOVERY
char pbuffer[1028];
- int flen, fd = -1;
+ int fd = -1;
afs_int32 epoch = 0;
afs_int32 pass;
#endif
tversion.epoch = 0; /* start off by labelling in-transit db as invalid */
(*dbase->setlabel) (dbase, file, &tversion); /* setlabel does sync */
#ifndef OLD_URECOVERY
- flen = length;
afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
if (fd < 0) {
usage:
Quit("Usage: upserver [<directory>+] [-crypt <directory>+] [-clear <directory>+] [-auth <directory>+] [-rxbind] [-help]\n");
} else {
- int dirlen;
if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
Quit("Too many dirs");
- dirlen = strlen(argv[a]);
if (AddObject(&dirName[nDirs], argv[a])) {
printf("%s: Unable to export dir %s. Skipping\n", whoami,
argv[a]);
{ /*Main routine */
struct cmd_syndesc *cs; /*Command line syntax descriptor */
- afs_int32 code; /*Return code */
#ifdef AFS_AIX32_ENV
/*
/*
* Execute the parsed command.
*/
- code = cmd_Dispatch(argc, argv);
+ cmd_Dispatch(argc, argv);
#if 0
if (code) {
fprintf(stderr, "%s: Call to cmd_Dispatch() failed; code is %d\n",
}
#endif /* 0 */
if (doUnlog) {
- code = uss_fs_UnlogToken(uss_Cell);
+ uss_fs_UnlogToken(uss_Cell);
}
return 0;
} /*Main routine */
static char rn[] = "uss_acl_SetDiskQuota";
#endif
uss_VolumeStatus_t *status;
- char *name, *motd, *offmsg;
char *input;
char tmp_str[AFS_PIOCTL_MAXSIZE];
status = (uss_VolumeStatus_t *) tmp_str;
status->MinQuota = status->MaxQuota = -1;
- name = motd = offmsg = NULL;
status->MaxQuota = a_q;
input = (char *)status + sizeof(*status);
struct cmd_item *ti;
afs_int32 hostAddr;
struct hostent *thp;
- int setp;
ti = as->parms[0].items;
- setp = 1;
if (ti) {
thp = hostutil_GetHostByName(ti->data);
if (!thp) {
else memcpy(&hostAddr, thp->h_addr, sizeof(afs_int32));
} else {
hostAddr = 0; /* means don't set host */
- setp = 0; /* aren't setting host */
}
/* now do operation */
afs_int32 code;
struct ViceIoctl blob;
struct cmd_item *ti;
- int export = 0, type = 0, mode = 0, exp = 0, exportcall, pwsync =
+ int export = 0, type = 0, mode = 0, exportcall, pwsync =
0, smounts = 0, clipags = 0, pagcb = 0;
ti = as->parms[0].items;
fprintf(stderr, "Illegal argument %s\n", ti->data);
return 1;
}
- exp = 1;
}
if ((ti = as->parms[2].items)) { /* -noconvert */
if (strcmp(ti->data, "on") == 0)
char *last_component; /*Last component of true name */
struct stat statbuff; /*Buffer for status info */
int link_chars_read; /*Num chars read in readlink() */
- int thru_symlink; /*Did we get to a mount point via a symlink? */
int error = 0;
for (ti = as->parms[0].items; ti; ti = ti->next) {
/* once per file */
- thru_symlink = 0;
sprintf(orig_name, "%s%s", (ti->data[0] == '/') ? "" : "./",
ti->data);
* the file name with the link name.
*/
if ((statbuff.st_mode & S_IFMT) == S_IFLNK) {
- thru_symlink = 1;
/*
* Read name of resolved file.
*/
static int
CopyOnWrite(Vnode * targetptr, Volume * volptr, afs_foff_t off, afs_fsize_t len)
{
- Inode ino, nearInode;
+ Inode ino, nearInode AFS_UNUSED;
ssize_t rdlen;
ssize_t wrlen;
afs_fsize_t size;
Error errorCode = 0; /* Error code returned back */
Error temp;
Inode inode = 0;
- Inode nearInode; /* hint for inode allocation in solaris */
+ Inode nearInode AFS_UNUSED; /* hint for inode allocation in solaris */
afs_ino_str_t stmp;
if ((errorCode =
static void
FillPerfValues(struct afs_PerfStats *a_perfP)
{ /*FillPerfValues */
- afs_uint32 hi, lo;
+ afs_uint32 hi AFS_UNUSED, lo;
int dir_Buffers; /*# buffers in use by dir package */
int dir_Calls; /*# read calls in dir package */
int dir_IOs; /*# I/O ops in dir package */
CallHandler(FSYNC_readfds, nfds, POLLIN|POLLPRI);
#else
int maxfd;
+#ifdef AFS_PTHREAD_ENV
struct timeval s_timeout;
+#endif
GetHandler(&FSYNC_readfds, &maxfd);
- s_timeout.tv_sec = SYNC_SELECT_TIMEOUT;
- s_timeout.tv_usec = 0;
/* Note: check for >= 1 below is essential since IOMGR_select
* doesn't have exactly same semantics as select.
*/
#ifdef AFS_PTHREAD_ENV
+ s_timeout.tv_sec = SYNC_SELECT_TIMEOUT;
+ s_timeout.tv_usec = 0;
if (select(maxfd + 1, &FSYNC_readfds, NULL, NULL, &s_timeout) >= 1)
#else /* AFS_PTHREAD_ENV */
if (IOMGR_Select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1)
struct ViceInodeInfo *ip, int nInodes,
struct VolumeSummary *volSummary, int check)
{
- VolumeId volumeNumber;
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
int err = 0;
IHandle_t *handle;
FdHandle_t *fdP;
- volumeNumber = volSummary->header.id;
IH_INIT(handle, salvinfo->fileSysDevice, volSummary->header.parent, ino);
fdP = IH_OPEN(handle);
osi_Assert(fdP != NULL);
Inode *ip;
afs_sfsize_t bytes;
struct VnodeEssence *vep;
- Inode readmeinode;
+ Inode readmeinode = 0;
time_t now = time(NULL);
if (!salvinfo->vnodeInfo[vLarge].vnodes && !salvinfo->vnodeInfo[vSmall].vnodes) {
/* have we read in the header successfully? */
int read_header = 0;
+#ifdef AFS_DEMAND_ATTACH_FS
/* should we FreeVolume(vp) instead of VCheckFree(vp) in the error
* cleanup? */
int forcefree = 0;
-#ifdef AFS_DEMAND_ATTACH_FS
/* in the case of an error, to what state should the volume be
* transitioned? */
VolState error_state = VOL_STATE_ERROR;
VRequestSalvage_r(ec, vp, SALVSYNC_ERROR, VOL_SALVAGE_NO_OFFLINE);
VChangeState_r(vp, VOL_STATE_ERROR);
vp->nUsers = 0;
+ forcefree = 1;
#endif /* AFS_DEMAND_ATTACH_FS */
Log("VAttachVolume: volume %s is junk; it should be destroyed at next salvage\n", path);
*ec = VNOVOL;
- forcefree = 1;
goto locked_error;
}
void
VDetachVolume_r(Error * ec, Volume * vp)
{
+#ifdef FSSYNC_BUILD_CLIENT
VolumeId volume;
struct DiskPartition64 *tpartp;
int notifyServer = 0;
int useDone = FSYNC_VOL_ON;
- *ec = 0; /* always "succeeds" */
if (VCanUseFSSYNC()) {
notifyServer = vp->needsPutBack;
if (V_destroyMe(vp) == DESTROY_ME)
# endif
tpartp = vp->partition;
volume = V_id(vp);
+#endif /* FSSYNC_BUILD_CLIENT */
+ *ec = 0; /* always "succeeds" */
DeleteVolumeFromHashTable(vp);
vp->shuttingDown = 1;
#ifdef AFS_DEMAND_ATTACH_FS
void
VPrintCacheStats_r(void)
{
- afs_uint32 get_hi, get_lo, load_hi, load_lo;
+ afs_uint32 get_hi AFS_UNUSED, get_lo, load_hi AFS_UNUSED, load_lo;
struct VnodeClassInfo *vcp;
vcp = &VnodeClassInfo[vLarge];
Log("Large vnode cache, %d entries, %d allocs, %d gets (%d reads), %d writes\n", vcp->cacheSize, vcp->allocs, vcp->gets, vcp->reads, vcp->writes);
struct VolumeDiskHeader diskHeader;
IHandle_t *handle;
FdHandle_t *fdP;
- Inode nearInode = 0;
+ Inode nearInode AFS_UNUSED = 0;
char *part, *name;
struct stat st;
afs_ino_str_t stmp;
struct VnodeClassInfo *vcp;
IHandle_t *tmpH;
FdHandle_t *fdP;
- Inode nearInode;
+ Inode nearInode AFS_UNUSED;
afs_int32 critical = 0;
tag = iod_getc(iodp);
{
int i, done;
char tag, c;
- afs_int32 magic;
+ afs_int32 magic AFS_UNUSED;
/* memset(&dh, 0, sizeof(dh)); */
ino = VNDISK_GET_INO(vnode);
if (ino) {
IHandle_t *h, *newh;
- Inode nearInode;
+ Inode nearInode AFS_UNUSED;
#if defined(NEARINODE_HINT) && !defined(AFS_NAMEI_ENV)
V_pref(vol,nearInode)
#endif
DirHandle dir;
struct acl_accessList *ACL;
AFSFid did;
- Inode inodeNumber, nearInode;
+ Inode inodeNumber, nearInode AFS_UNUSED;
struct VnodeDiskObject *vnode;
struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
IHandle_t *h;
void
PrintOpTiming(int a_opIdx, struct fs_stats_opTimingData *a_opTimeP)
{
- double fSumTime, avg;
-
- fSumTime =
- ((double)(a_opTimeP->sumTime.tv_sec)) +
- (((double)(a_opTimeP->sumTime.tv_usec)) / ((double)(1000000)));
-/* printf("Double sum time is %f\n", fSumTime);*/
- avg = fSumTime / ((double)(a_opTimeP->numSuccesses));
-
printf
("%15s: %u ops (%u OK); sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n",
opNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses,
void
PrintXferTiming(int a_opIdx, struct fs_stats_xferData *a_xferP)
{
- double fSumTime, avg;
-
- fSumTime =
- ((double)(a_xferP->sumTime.tv_sec)) +
- ((double)(a_xferP->sumTime.tv_usec)) / ((double)(1000000));
-
- avg = fSumTime / ((double)(a_xferP->numSuccesses));
-
printf
("%s: %u xfers (%u OK), time sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n",
xferOpNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses,