dest: ${DEST}/root.server/usr/afs/bin/fileserver ${DEST}/include/afs/fs_stats.h
+splint::
+ splint $(CFLAGS) \
+ viced.c \
+ afsfileprocs.c \
+ host.c \
+ physio.c \
+ callback.c
Bad_FetchData:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
ViceLog(2, ("SRXAFS_FetchData returns %d\n", errorCode));
errorCode = CallPostamble(tcon, errorCode);
Bad_FetchACL:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
ViceLog(2, ("SAFS_FetchACL returns %d (ACL=%s)\n",
errorCode, AccessList->AFSOpaque_val));
errorCode = CallPostamble(tcon, errorCode);
Bad_FetchStatus:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
ViceLog(2, ("SAFS_FetchStatus returns %d\n", errorCode));
return errorCode;
}
/* put back the file ID and volume */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
+ volptr);
parentwhentargetnotdir = (Vnode *) 0;
targetptr = (Vnode *) 0;
volptr = (Volume *) 0;
Bad_BulkStatus:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
errorCode = CallPostamble(tcon, errorCode);
#if FS_STATS_DETAILED
CHK_FETCHSTATUS, 0))) {
tstatus = &OutStats->AFSBulkStats_val[i];
tstatus->errorCode = errorCode;
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
parentwhentargetnotdir = (Vnode *) 0;
targetptr = (Vnode *) 0;
volptr = (Volume *) 0;
}
/* put back the file ID and volume */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
parentwhentargetnotdir = (Vnode *) 0;
targetptr = (Vnode *) 0;
volptr = (Volume *) 0;
Bad_InlineBulkStatus:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
errorCode = CallPostamble(tcon, errorCode);
#if FS_STATS_DETAILED
Bad_StoreData:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
ViceLog(2, ("SAFS_StoreData returns %d\n", errorCode));
errorCode = CallPostamble(tcon, errorCode);
Bad_CreateFile:
/* Update and store volume/vnode and parent vnodes back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr,
+ volptr);
FidZap(&dir);
ViceLog(2, ("SAFS_CreateFile returns %d\n", errorCode));
return errorCode;
VPutVnode(&fileCode, newfileptr);
assert(fileCode == 0);
}
- PutVolumePackage(fileptr, (newvptr && newvptr != oldvptr? newvptr : 0),
- oldvptr, volptr);
+ (void) PutVolumePackage(fileptr,
+ (newvptr && newvptr != oldvptr? newvptr : 0),
+ oldvptr, volptr);
FidZap(&olddir);
FidZap(&newdir);
FidZap(&filedir);
Bad_SymLink:
/* Write the all modified vnodes (parent, new files) and volume back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr,
+ volptr);
FidZap(&dir);
ViceLog(2, ("SAFS_Symlink returns %d\n", errorCode));
return errorCode;
Bad_Link:
/* Write the all modified vnodes (parent, new files) and volume back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr,
+ volptr);
FidZap(&dir);
ViceLog(2, ("SAFS_Link returns %d\n", errorCode));
return errorCode;
Bad_MakeDir:
/* Write the all modified vnodes (parent, new files) and volume back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr,
+ volptr);
FidZap(&dir);
FidZap(&parentdir);
ViceLog(2, ("SAFS_MakeDir returns %d\n", errorCode));
Bad_RemoveDir:
/* Write the all modified vnodes (parent, new files) and volume back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr,
+ volptr);
FidZap(&dir);
ViceLog(2, ("SAFS_RemoveDir returns %d\n", errorCode));
return errorCode;
Bad_SetLock:
/* Write the all modified vnodes (parent, new files) and volume back */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
if ((errorCode == VREADONLY) && (type == LockRead))
errorCode = 0; /* allow read locks on RO volumes without saving state */
Bad_ExtendLock:
/* Put back file's vnode and volume */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
if ((errorCode == VREADONLY)) /* presumably, we already granted this lock */
errorCode = 0; /* under our generous policy re RO vols */
Bad_ReleaseLock:
/* Put back file's vnode and volume */
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
if ((errorCode == VREADONLY)) /* presumably, we already granted this lock */
errorCode = 0; /* under our generous policy re RO vols */
errorCode = EACCES;
goto Bad_GetVolumeStatus;
}
- RXGetVolumeStatus(FetchVolStatus, Name, OfflineMsg, Motd, volptr);
+ (void) RXGetVolumeStatus(FetchVolStatus, Name, OfflineMsg, Motd,
+ volptr);
Bad_GetVolumeStatus:
- PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ (void) PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0,
+ volptr);
ViceLog(2,("SAFS_GetVolumeStatus returns %d\n",errorCode));
/* next is to guarantee out strings exist for stub */
if (*Name == 0) {*Name = (char *) malloc(1); **Name = 0;}
}
if (Pos + Len > tlen) Len = tlen - Pos; /* get length we should send */
- FDH_SEEK(fdP, Pos, 0);
+ (void) FDH_SEEK(fdP, Pos, 0);
tlen = htonl(Len);
if (Int64Mode) {
afs_int32 zero = 0;
ViceLog(0, ("Couldn't create callback dump file %s\n", AFSDIR_SERVER_CBKDUMP_FILEPATH));
return 0;
}
- write(fd, &magic, sizeof(magic));
- write(fd, &now, sizeof(now));
- write(fd, &cbstuff, sizeof(cbstuff));
- write(fd, TimeOuts, sizeof(TimeOuts));
- write(fd, timeout, sizeof(timeout));
- write(fd, &tfirst, sizeof(tfirst));
+ (void) write(fd, &magic, sizeof(magic));
+ (void) write(fd, &now, sizeof(now));
+ (void) write(fd, &cbstuff, sizeof(cbstuff));
+ (void) write(fd, TimeOuts, sizeof(TimeOuts));
+ (void) write(fd, timeout, sizeof(timeout));
+ (void) write(fd, &tfirst, sizeof(tfirst));
freelisthead = cbtoi((struct CallBack *) CBfree);
- write(fd, &freelisthead, sizeof(freelisthead)); /* This is a pointer */
+ (void) write(fd, &freelisthead, sizeof(freelisthead)); /* This is a pointer */
freelisthead = fetoi((struct FileEntry *) FEfree);
- write(fd, &freelisthead, sizeof(freelisthead)); /* This is a pointer */
- write(fd, HashTable, sizeof(HashTable));
- write(fd, &CB[1], sizeof(CB[1])*cbstuff.nblks); /* CB stuff */
- write(fd, &FE[1], sizeof(FE[1])*cbstuff.nblks); /* FE stuff */
+ (void) write(fd, &freelisthead, sizeof(freelisthead)); /* This is a pointer */
+ (void) write(fd, HashTable, sizeof(HashTable));
+ (void) write(fd, &CB[1], sizeof(CB[1])*cbstuff.nblks); /* CB stuff */
+ (void) write(fd, &FE[1], sizeof(FE[1])*cbstuff.nblks); /* FE stuff */
close(fd);
return 0;
if ( code )
{
char hoststr[16];
- afs_inet_ntoa_r(host->host, hoststr);
+ (void) afs_inet_ntoa_r(host->host, hoststr);
ViceLog(0,
("CB: RCallBackConnectBack (host.c) failed for host %s:%d\n",
hoststr, ntohs(host->port)));
if(code) {
if ( MultiProbeAlternateAddress_r(host) ) {
char hoststr[16];
- afs_inet_ntoa_r(host->host, hoststr);
+ (void) afs_inet_ntoa_r(host->host, hoststr);
ViceLog(0,
("ProbeUuid failed for host %s:%d\n",
hoststr, ntohs(host->port)));
H_LOCK
if (code) {
char hoststr[16];
- afs_inet_ntoa_r(host->host, hoststr);
+ (void) afs_inet_ntoa_r(host->host, hoststr);
ViceLog(0, ("Probe failed for host %s:%d\n",
hoststr, ntohs(host->port)));
host->hostFlags |= VENUSDOWN;
strcpy(adminName, "System:Administrators"); /* use the default name */
}
else {
- read(fd, adminName, status.st_size); /* use name from the file */
+ (void)read(fd, adminName, status.st_size); /* use name from the file */
}
if (fd)
close(fd); /* close fd if it was opened */
${DEST}/include/afs/ihandle.h \
${DEST}/include/afs/namei_ops.h
+splint::
+ for FILE in \
+ vnode.c volume.c vutil.c partition.c fssync.c purge.c \
+ clone.c nuke.c devname.c listinodes.c common.c ihandle.c \
+ namei_ops.c \
+ physio.c vol-salvage.c vol-info.c ; do \
+ splint $(CFLAGS) $$FILE ; \
+ done
*/
struct clone_rock {
IHandle_t *h;
- afs_int32 vol;
+ VolId vol;
};
#define CLONE_MAXITEMS 100
{
struct sockaddr_in addr;
/* I can't believe the following is needed for localhost connections!! */
- static backoff[] = {3,3,3,5,5,5,7,15,16,24,32,40,48,0};
- int *timeout = &backoff[0];
+ static time_t backoff[] = {3,3,3,5,5,5,7,15,16,24,32,40,48,0};
+ time_t *timeout = &backoff[0];
for (;;) {
FS_sd = getport(&addr);
}
#endif
if (response == 0) {
- printf("FSYNC_askfs: negative response from file server; volume %u, command %d\n", command.volume, command.command);
+ printf("FSYNC_askfs: negative response from file server; volume %u, command %d\n", command.volume, (int) command.command);
}
return response;
VOL_UNLOCK
VATTACH_UNLOCK
#ifdef AFS_NT40_ENV
- send(fd, &rc, 1, 0);
+ (void) send(fd, &rc, 1, 0);
#else
- write(fd, &rc, 1);
+ (void) write(fd, &rc, 1);
#endif
}
#include <afs/afsint.h>
#include <errno.h>
#include <afs/afssyscalls.h>
-#include "ihandle.h"
#include "nfs.h"
+#include "ihandle.h"
#include "viceinode.h"
#ifdef AFS_PTHREAD_ENV
#include <assert.h>
/* Avoid problems with "UFSOpen: igetinode failed" panics on HPUX 11.0 */
fdMaxCacheSize = 0;
#else
- fdMaxCacheSize = MAX(sysconf(_SC_OPEN_MAX)-FD_HANDLE_SETASIDE, 0);
- fdMaxCacheSize = MIN(fdMaxCacheSize, FD_MAX_CACHESIZE);
+ {
+ long fdMax = MAX(sysconf(_SC_OPEN_MAX)-FD_HANDLE_SETASIDE, 0);
+ fdMaxCacheSize = (int) MIN(fdMax, FD_MAX_CACHESIZE);
+ }
#endif
fdCacheSize = MIN(fdMaxCacheSize, FD_DEFAULT_CACHESIZE);
}
DLL_DELETE(fdP, fdLruHead, fdLruTail, fd_next, fd_prev);
ihP->ih_refcnt++;
IH_UNLOCK
- FDH_SEEK(fdP, 0, SEEK_SET);
+ (void) FDH_SEEK(fdP, 0, SEEK_SET);
return fdP;
}
}
sprintf(filename, "%s/%s/README", partition, INODEDIR);
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0444);
if (fd >= 0) {
- write(fd, VICE_README, strlen(VICE_README));
+ (void) write(fd, VICE_README, strlen(VICE_README));
close(fd);
}
return(errno);
return EIO;
}
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
/* struct ViceInodeInfo info; */
if (*dp->d_name == '.') continue;
#include <afs/afsint.h>
#include <errno.h>
#include <afs/afssyscalls.h>
-#include "ihandle.h"
#include "nfs.h"
+#include "ihandle.h"
#include "salvage.h"
#include "afs/assert.h"
#include "afs/dir.h"
vcp = &VnodeClassInfo[class];
if (!VolumeWriteable(vp)) {
- *ec = VREADONLY;
+ *ec = (bit32) VREADONLY;
return NULL;
}
char *buf = (char *)malloc(16*1024);
if (!buf) Abort("VAllocVnode: malloc failed\n");
memset(buf, 0, 16*1024);
- FDH_WRITE(fdP, buf, 16*1024);
+ (void) FDH_WRITE(fdP, buf, 16*1024);
free(buf);
}
FDH_CLOSE(fdP);
class = vnodeIdToClass(vnodeNumber);
vcp = &VnodeClassInfo[class];
if (locktype == WRITE_LOCK && !VolumeWriteable(vp)) {
- *ec = VREADONLY;
+ *ec = (bit32) VREADONLY;
mlkReason = 3;
return NULL;
}
}
else {
struct vnodeIndex *index = &vp->vnodeIndex[class];
- int bitNumber = vnodeIdToBitNumber(vnodeNumber);
- int offset = bitNumber >> 3;
+ unsigned int bitNumber = vnodeIdToBitNumber(vnodeNumber);
+ unsigned int offset = bitNumber >> 3;
/* Test to see if vnode number is valid. */
if ((offset >= index->bitmapSize) ||
Abort("VPutVnode: Vnode at 0x%x locked by another process!\n",vnp);
if (vnp->changed_oldTime || vnp->changed_newTime || vnp->delete) {
Volume *vp = vnp->volumePtr;
- afs_int32 now = FT_ApproxTime();
+ afs_uint32 now = FT_ApproxTime();
assert(vnp->cacheCheck == vp->cacheCheck);
if (vnp->delete) {
}
if (vnp->changed_oldTime || vnp->changed_newTime) {
Volume *vp = vnp->volumePtr;
- afs_int32 now = FT_ApproxTime();
+ afs_uint32 now = FT_ApproxTime();
assert(vnp->cacheCheck == vp->cacheCheck);
if (vnp->changed_newTime)
vnp->disk.serverModifyTime = now;
#define ROOTVNODE 1
/*typedef enum {vNull=0, vFile=1, vDirectory=2, vSymlink=3} VnodeType;*/
-typedef int VnodeType;
+typedef unsigned int VnodeType;
#define vNull 0
#define vFile 1
#define vDirectory 2
of the index. The header record is the same size as a vnode */
#define vnodeIndexOffset(vcp,vnodeNumber) \
((vnodeIdToBitNumber(vnodeNumber)+1)<<(vcp)->logSize)
-#define bitNumberToVnodeNumber(b,class) (((b)<<VNODECLASSWIDTH)+(class)+1)
+#define bitNumberToVnodeNumber(b,class) ((VnodeId)(((b)<<VNODECLASSWIDTH)+(class)+1))
#define vnodeIsDirectory(vnodeNumber) (vnodeIdToClass(vnodeNumber) == vLarge)
typedef struct VnodeDiskObject {
struct tm *tm = localtime(&date);
char buf[32];
- strftime (buf, 32, "%Y/%m/%d.%H:%M:%S", tm); /* NT does not have %T */
+ (void) strftime (buf, 32, "%Y/%m/%d.%H:%M:%S", tm); /* NT does not have %T */
sprintf(results[next = (next+1)&7], "%lu (%s)", (unsigned long) date, buf);
return results[next];
}
exit(1);
}
}
- sprintf(name1,VFORMAT,volumeId);
+ sprintf(name1,VFORMAT, (unsigned long) volumeId);
if (dsizeOnly && !saveinodes)
printf("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
HandleVolume(partP, name1);
}
if (dsizeOnly && !saveinodes)
printf("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
p = (char *)strrchr(dp->d_name, '.');
if (p != NULL && strcmp(p, VHDREXT) == 0) {
HandleVolume(partP, dp->d_name);
Exit(0);
}
#endif /* FAST_RESTART */
- if (ti = as->parms[0].items) { /* -partition */
+ if ((ti = as->parms[0].items)) { /* -partition */
seenpart = 1;
strncpy(pname, ti->data, 100);
}
- if (ti = as->parms[1].items) { /* -volumeid */
+ if ((ti = as->parms[1].items)) { /* -volumeid */
if (!seenpart) {
printf("You must also specify '-partition' option with the '-volumeid' option\n");
exit(-1);
RebuildDirs = 1;
if (as->parms[9].items) /* -ForceReads */
forceR = 1;
- if (ti = as->parms[10].items) {/* -Parallel # */
+ if ((ti = as->parms[10].items)) {/* -Parallel # */
temp = ti->data;
if (strncmp(temp,"all",3) == 0) {
PartsPerDisk = 1;
}
}
}
- if (ti = as->parms[11].items) {/* -tmpdir */
+ if ((ti = as->parms[11].items)) {/* -tmpdir */
DIR *dirp;
tmpdir = ti->data;
} else
closedir(dirp);
}
- if (ti = as->parms[12].items) /* -showlog */
+ if ((ti = as->parms[12].items)) /* -showlog */
ShowLog = 1;
- if (ti = as->parms[13].items) { /* -log */
+ if ((ti = as->parms[13].items)) { /* -log */
Testing = 1;
ShowSuid = 1;
Showmode = 1;
}
- if (ti = as->parms[14].items) { /* -showmounts */
+ if ((ti = as->parms[14].items)) { /* -showmounts */
Testing = 1;
Showmode = 1;
ShowMounts = 1;
}
- if (ti = as->parms[15].items) { /* -orphans */
+ if ((ti = as->parms[15].items)) { /* -orphans */
if (Testing)
orphans = ORPH_IGNORE;
else if (strcmp(ti->data, "remove")==0 || strcmp(ti->data, "r")==0)
}
#ifndef AFS_NT40_ENV /* ignore options on NT */
- if ( ti = as->parms[16].items) { /* -syslog */
+ if ((ti = as->parms[16].items)) { /* -syslog */
useSyslog = 1;
ShowLog = 0;
}
- if ( ti = as->parms[17].items) { /* -syslogfacility */
+ if ((ti = as->parms[17].items)) { /* -syslogfacility */
useSyslogFacility = atoi(ti->data);
}
- if (ti = as->parms[18].items) { /* -datelogs */
+ if ((ti = as->parms[18].items)) { /* -datelogs */
TimeStampLogFile();
}
#endif
if (!partP) {
for (i=0; i<jobcount; i++) {
sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, i);
- if (passLog = fopen(logFileName, "r")) {
+ if ((passLog = fopen(logFileName, "r"))) {
while(fgets(buf, sizeof(buf), passLog)) {
fputs(buf, logFile);
}
struct dirent *dp;
assert((dirp = opendir(fileSysPath)) != NULL);
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
if (!strncmp(dp->d_name, "salvage.inodes.", 15) ||
!strncmp(dp->d_name, "salvage.temp.", 13)) {
char npath[1024];
if (chdir(fileSysPath) == -1 || (dirp = opendir(".")) == NULL)
Abort("Can't read directory %s; not salvaged\n", fileSysPath);
if (!singleVolumeNumber) {
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
char *p = dp->d_name;
p = strrchr(dp->d_name, '.');
if (p != NULL && strcmp(p, VHDREXT) == 0) {
nVolumes = 0;
vsp = volumeSummaryp;
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
char *p = dp->d_name;
p = strrchr(dp->d_name, '.');
if (p != NULL && strcmp(p, VHDREXT) == 0) {
static char timestamp[20];
lt = localtime(&clock);
if (precision)
- strftime (timestamp, 20, "%m/%d/%Y %T", lt);
+ (void) strftime (timestamp, 20, "%m/%d/%Y %T", lt);
else
- strftime (timestamp, 20, "%m/%d/%Y %H:%M", lt);
+ (void) strftime (timestamp, 20, "%m/%d/%Y %H:%M", lt);
return timestamp;
}
VConnectFS() has completed. */
-int VolumeCacheCheck; /* Incremented everytime a volume goes on line--
+bit32 VolumeCacheCheck; /* Incremented everytime a volume goes on line--
* used to stamp volume headers and in-core
* vnodes. When the volume goes on-line the
* vnode will be invalidated */
static void ReadHeader(Error *ec, IHandle_t *h, char *to, int size,
- int magic, int version)
+ bit32 magic, bit32 version)
{
struct versionStamp *vsn;
FdHandle_t *fdP;
h->parent = dh->parent;
#ifdef AFS_64BIT_IOPS_ENV
- h->volumeInfo = dh->volumeInfo_lo | ((Inode)dh->volumeInfo_hi << 32);
+ h->volumeInfo = (Inode)dh->volumeInfo_lo |
+ ((Inode)dh->volumeInfo_hi << 32);
- h->smallVnodeIndex = dh->smallVnodeIndex_lo |
+ h->smallVnodeIndex = (Inode)dh->smallVnodeIndex_lo |
((Inode)dh->smallVnodeIndex_hi << 32);
- h->largeVnodeIndex = dh->largeVnodeIndex_lo |
+ h->largeVnodeIndex = (Inode)dh->largeVnodeIndex_lo |
((Inode)dh->largeVnodeIndex_hi << 32);
- h->linkTable = dh->linkTable_lo |
+ h->linkTable = (Inode)dh->linkTable_lo |
((Inode)dh->linkTable_hi << 32);
#else
h->volumeInfo = dh->volumeInfo_lo;
VOL_UNLOCK
vp = (Volume *) calloc(1, sizeof(Volume));
assert(vp != NULL);
- vp->specialStatus = (isbusy ? VBUSY : 0);
+ vp->specialStatus = (byte) (isbusy ? VBUSY : 0);
vp->device = partp->device;
vp->partition = partp;
IH_INIT(vp->vnodeIndex[vLarge].handle, partp->device, header->parent,
}
-int VAllocBitmapEntry_r(Error *ec, Volume *vp, register struct vnodeIndex
+VnodeId VAllocBitmapEntry_r(Error *ec, Volume *vp, register struct vnodeIndex
*index)
{
register byte *bp,*ep;
*ec = 0;
/* This test is probably redundant */
if (!VolumeWriteable(vp)) {
- *ec = VREADONLY;
+ *ec = (bit32) VREADONLY;
return 0;
}
#ifdef BITMAP_LATER
bp = index->bitmap + index->bitmapOffset;
ep = index->bitmap + index->bitmapSize;
while (bp < ep) {
- if ((*(bit32 *)bp) != 0xffffffff) {
+ if ((*(bit32 *)bp) != (bit32)0xffffffff) {
int o;
- index->bitmapOffset = bp - index->bitmap;
+ index->bitmapOffset = (afs_uint32) (bp - index->bitmap);
while (*bp == 0xff)
bp++;
o = ffs(~*bp)-1; /* ffs is documented in BSTRING(3) */
*bp |= (1 << o);
- return (bp - index->bitmap)*8 + o;
+ return (VnodeId) ((bp - index->bitmap)*8 + o);
}
bp += sizeof(bit32) /* i.e. 4 */;
}
return index->bitmapOffset*8;
}
-int VAllocBitmapEntry(Error *ec, Volume *vp, register struct vnodeIndex *index)
+VnodeId VAllocBitmapEntry(Error *ec, Volume *vp, register struct vnodeIndex *index)
{
- int retVal;
+ VnodeId retVal;
VOL_LOCK
retVal = VAllocBitmapEntry_r(ec,vp,index);
VOL_UNLOCK
}
void VFreeBitMapEntry_r(Error *ec, register struct vnodeIndex *index,
- int bitNumber)
+ unsigned bitNumber)
{
unsigned int offset;
*ec = 0;
}
void VFreeBitMapEntry(Error *ec, register struct vnodeIndex *index,
- int bitNumber)
+ unsigned bitNumber)
{
VOL_LOCK
VFreeBitMapEntry_r(ec, index, bitNumber);
StreamHandle_t *file;
int nVnodes;
int size;
- int counter = 0;
struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
struct vnodeIndex *vip = &vp->vnodeIndex[class];
struct VnodeDiskObject *vnode;
register int i, gap;
register Volume *vp;
Error error;
- afs_int32 now = FT_ApproxTime();
+ afs_uint32 now = FT_ApproxTime();
/* Be careful with this code, since it works with interleaved calls to AddToVolumeUpdateList */
for (i = gap = 0; i<nUpdatedVolumes; i++) {
vp = VGetVolume_r(&error, UpdateList[i-gap] = UpdateList[i]);
};
/* Magic numbers and version stamps for each type of file */
-#define VOLUMEHEADERMAGIC 0x88a1bb3c
-#define VOLUMEINFOMAGIC 0x78a1b2c5
+#define VOLUMEHEADERMAGIC ((bit32)0x88a1bb3c)
+#define VOLUMEINFOMAGIC ((bit32)0x78a1b2c5)
#define SMALLINDEXMAGIC 0x99776655
#define LARGEINDEXMAGIC 0x88664433
#define MOUNTMAGIC 0x9a8b7c6d
byte specialStatus; /* An error code to return on VGetVolume: the
volume is unavailable for the reason quoted,
currently VBUSY or VMOVED */
- afs_int32 updateTime; /* Time that this volume was put on the updated
+ afs_uint32 updateTime; /* Time that this volume was put on the updated
volume list--the list of volumes that will be
salvaged should the file server crash */
} Volume;
extern Volume * VAttachVolume_r();
extern Volume * VCreateVolume();
extern Volume * VCreateVolume_r();
-extern VnodeId VallocBitMapEntry();
-extern VnodeId VallocBitMapEntry_r();
+extern VnodeId VAllocBitmapEntry(Error *ec, Volume *vp,
+ struct vnodeIndex *index);
+extern VnodeId VAllocBitmapEntry_r(Error *ec, Volume *vp,
+ struct vnodeIndex *index);
extern void VFreeBitMapEntry(Error *ec, register struct vnodeIndex *index,
- int bitNumber);
+ unsigned bitNumber);
extern void VFreeBitMapEntry_r(Error *ec, register struct vnodeIndex *index,
- int bitNumber);
+ unsigned bitNumber);
extern int VolumeNumber();
extern int VolumeNumber_r();
extern char * VolumeExternalName();
extern void VDetachVolume(Error *ec, Volume *vp);
extern void VDetachVolume_r(Error *ec, Volume *vp);
extern void VForceOffline(Volume *vp);
+extern void VForceOffline_r(Volume *vp);
extern void VBumpVolumeUsage(register Volume *vp);
+extern void VBumpVolumeUsage_r(register Volume *vp);
extern void VSetDiskUsage(void);
extern void VPrintCacheStats(void);
extern void VReleaseVnodeFiles_r(Volume *vp);
volume header ON: this means that the volumes will not be attached by the
file server and WILL BE DESTROYED the next time a system salvage is performed */
-static void RemoveInodes(Device dev, int vid)
+static void RemoveInodes(Device dev, VolumeId vid)
{
register int i;
IHandle_t *handle;
${DEST}/root.server/usr/afs/bin/volserver \
${DEST}/lib/afs/libvolser.a
+
+splint::
+ splint $(CFLAGS) \
+ vos.c \
+ vsprocs.c vsutils.c lockprocs.c volerr.c \
+ volmain.c volprocs.c physio.c common.c voltrans.c volerr.c \
+ dumpstuff.c
printf("traversing the internal queue, which groups all the related volumes on a per partition basis\n");
while(count > 0) {
printf("---------------------------\n");
- printf("%s RW-Id %u",old->name,old->ids[RWVOL]);
+ printf("%s RW-Id %lu",old->name,(unsigned long) old->ids[RWVOL]);
if(old->isValid[RWVOL])
printf(" valid ");
else printf(" invalid ");
- printf("RO-Id %u",old->ids[ROVOL]);
+ printf("RO-Id %lu",(unsigned long) old->ids[ROVOL]);
if(old->isValid[ROVOL])
printf(" valid ");
else printf(" invalid ");
- printf("BACKUP-Id %u",old->ids[BACKVOL]);
+ printf("BACKUP-Id %lu",(unsigned long) old->ids[BACKVOL]);
if(old->isValid[BACKVOL])
printf(" valid ");
else printf(" invalid ");
#include <afs/fssync.h>
#include <afs/acl.h>
#include "afs/audit.h"
+#include <afs/dir.h>
#include "volser.h"
#include "volint.h"
afs_int32 asize; {
if (asize < 18) return -1;
/* It's better using the Generic VFORMAT since otherwise we have to make changes to too many places... The 14 char limitation in names hits us again in AIX; print in field of 9 digits (still 10 for the rest), right justified with 0 padding */
- sprintf(aname, VFORMAT, avol);
+ sprintf(aname, VFORMAT, (unsigned long) avol);
return 0;
}
fail:
if (tcon) {
- rx_EndCall(tcall,0);
+ (void) rx_EndCall(tcall,0);
rx_DestroyConnection(tcon);
}
if (tt){
codes[i] = StartAFSVolRestore(tcalls[i], dest->trans,
is_incremental,cookie);
if (codes[i]) {
- rx_EndCall (tcalls[i],0); tcalls[i] = 0;
+ (void) rx_EndCall (tcalls[i],0); tcalls[i] = 0;
rx_DestroyConnection(tcons[i]); tcons[i] = 0;
}
}
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
+#include "volser_prototypes.h"
struct tqElem {
afs_int32 volid;
extern int vsu_ExtractName();
extern PrintError();
-extern int MapPartIdIntoName();
-extern int MapHostToNetwork();
-extern int MapNetworkToHost();
extern void EnumerateEntry();
extern void SubEnumerateEntry();
char pname[10];
if(fast){
- fprintf(STDOUT,"%-10u\n",pntr->volid);
+ fprintf(STDOUT,"%-10lu\n", (unsigned long) pntr->volid);
}
else if(longlist){
if(pntr->status == VOK){
fprintf(STDOUT,"%-32s ",pntr->name);
- fprintf(STDOUT,"%10u ",pntr->volid);
+ fprintf(STDOUT,"%10lu ", (unsigned long) pntr->volid);
if(pntr->type == 0) fprintf(STDOUT,"RW ");
if(pntr->type == 1) fprintf(STDOUT,"RO ");
if(pntr->type == 2) fprintf(STDOUT,"BK ");
fprintf(STDOUT,"\n");
MapPartIdIntoName(part,pname);
fprintf(STDOUT," %s %s \n",hostutil_GetNameByINet(server),pname);
- fprintf(STDOUT," RWrite %10u ROnly %10u Backup %10u \n", pntr->parentID,pntr->cloneID, pntr->backupID);
+ fprintf(STDOUT," RWrite %10lu ROnly %10lu Backup %10lu \n",
+ (unsigned long) pntr->parentID,
+ (unsigned long) pntr->cloneID,
+ (unsigned long) pntr->backupID);
fprintf(STDOUT," MaxQuota %10d K \n",pntr->maxquota);
fprintf(STDOUT," Creation %s",
ctime((time_t *)&pntr->creationDate));
else if (pntr->status == VBUSY) {
*totalBusy += 1;
qPut(&busyHead,pntr->volid);
- if (disp) fprintf(STDOUT,"**** Volume %u is busy ****\n",pntr->volid);
+ if (disp) fprintf(STDOUT,"**** Volume %lu is busy ****\n",
+ (unsigned long) pntr->volid);
}
else {
*totalNotOK += 1;
qPut(¬okHead,pntr->volid);
- if (disp) fprintf(STDOUT,"**** Could not attach volume %u ****\n",pntr->volid);
+ if (disp) fprintf(STDOUT,"**** Could not attach volume %lu ****\n",
+ (unsigned long) pntr->volid);
}
fprintf(STDOUT,"\n");
}
else {/* default listing */
if(pntr->status == VOK){
fprintf(STDOUT,"%-32s ",pntr->name);
- fprintf(STDOUT,"%10u ",pntr->volid);
+ fprintf(STDOUT,"%10lu ",(unsigned long) pntr->volid);
if(pntr->type == 0) fprintf(STDOUT,"RW ");
if(pntr->type == 1) fprintf(STDOUT,"RO ");
if(pntr->type == 2) fprintf(STDOUT,"BK ");
else if (pntr->status == VBUSY) {
*totalBusy += 1;
qPut(&busyHead,pntr->volid);
- if (disp) fprintf(STDOUT,"**** Volume %u is busy ****\n",pntr->volid);
+ if (disp) fprintf(STDOUT,"**** Volume %lu is busy ****\n",
+ (unsigned long) pntr->volid);
}
else {
*totalNotOK += 1;
qPut(¬okHead,pntr->volid);
- if (disp) fprintf(STDOUT,"**** Could not attach volume %u ****\n",pntr->volid);
+ if (disp) fprintf(STDOUT,"**** Could not attach volume %lu ****\n",
+ (unsigned long) pntr->volid);
}
}
}
/*
* Short & sweet.
*/
- fprintf(STDOUT, "%-10u\n", a_xInfoP->volid);
+ fprintf(STDOUT, "%-10lu\n", (unsigned long) a_xInfoP->volid);
}
else
if (a_int32) {
* Volume's status is OK - all the fields are valid.
*/
fprintf(STDOUT, "%-32s ", a_xInfoP->name);
- fprintf(STDOUT, "%10u ", a_xInfoP->volid);
+ fprintf(STDOUT, "%10lu ", (unsigned long) a_xInfoP->volid);
if (a_xInfoP->type == 0) fprintf(STDOUT,"RW ");
if (a_xInfoP->type == 1) fprintf(STDOUT,"RO ");
if (a_xInfoP->type == 2) fprintf(STDOUT,"BK ");
fprintf(STDOUT, " %s %s \n",
hostutil_GetNameByINet(a_servID),
pname);
- fprintf(STDOUT, " RWrite %10u ROnly %10u Backup %10u \n",
- a_xInfoP->parentID, a_xInfoP->cloneID, a_xInfoP->backupID);
+ fprintf(STDOUT, " RWrite %10lu ROnly %10lu Backup %10lu \n",
+ (unsigned long) a_xInfoP->parentID,
+ (unsigned long) a_xInfoP->cloneID,
+ (unsigned long) a_xInfoP->backupID);
fprintf(STDOUT, " MaxQuota %10d K \n",
a_xInfoP->maxquota);
fprintf(STDOUT, " Creation %s",
(*a_totalBusyP)++;
qPut(&busyHead, a_xInfoP->volid);
if (a_showProblems)
- fprintf(STDOUT, "**** Volume %u is busy ****\n",
- a_xInfoP->volid);
+ fprintf(STDOUT, "**** Volume %lu is busy ****\n",
+ (unsigned long) a_xInfoP->volid);
} /*Busy volume*/
else {
(*a_totalNotOKP)++;
qPut(¬okHead, a_xInfoP->volid);
if (a_showProblems)
- fprintf(STDOUT, "**** Could not attach volume %u ****\n",
- a_xInfoP->volid);
+ fprintf(STDOUT, "**** Could not attach volume %lu ****\n",
+ (unsigned long) a_xInfoP->volid);
} /*Screwed volume*/
fprintf(STDOUT,"\n");
} /*Long listing*/
*/
if (a_xInfoP->status == VOK) {
fprintf(STDOUT, "%-32s ", a_xInfoP->name);
- fprintf(STDOUT, "%10u ", a_xInfoP->volid);
+ fprintf(STDOUT, "%10lu ", (unsigned long) a_xInfoP->volid);
if (a_xInfoP->type == 0) fprintf(STDOUT, "RW ");
if (a_xInfoP->type == 1) fprintf(STDOUT, "RO ");
if (a_xInfoP->type == 2) fprintf(STDOUT, "BK ");
(*a_totalBusyP)++;
qPut(&busyHead, a_xInfoP->volid);
if (a_showProblems)
- fprintf(STDOUT,"**** Volume %u is busy ****\n",
- a_xInfoP->volid);
+ fprintf(STDOUT,"**** Volume %lu is busy ****\n",
+ (unsigned long) a_xInfoP->volid);
} /*Busy volume*/
else {
(*a_totalNotOKP)++;
qPut(¬okHead, a_xInfoP->volid);
if (a_showProblems)
- fprintf(STDOUT,"**** Could not attach volume %u ****\n",
- a_xInfoP->volid);
+ fprintf(STDOUT,"**** Could not attach volume %lu ****\n",
+ (unsigned long) a_xInfoP->volid);
} /*Screwed volume*/
} /*Default listing*/
} /*XDisplayFormat*/
if(totalBusy){
while(busyHead.count){
qGet(&busyHead,&volid);
- fprintf(STDOUT,"**** Volume %u is busy ****\n",volid);
+ fprintf(STDOUT,"**** Volume %lu is busy ****\n",
+ (unsigned long) volid);
}
}
if(totalNotOK){
while(notokHead.count){
qGet(¬okHead,&volid);
- fprintf(STDOUT,"**** Could not attach volume %u ****\n",volid);
+ fprintf(STDOUT,"**** Could not attach volume %lu ****\n",
+ (unsigned long) volid);
}
}
if(!quiet){
if (totalBusy) {
while (busyHead.count) {
qGet(&busyHead, &volid);
- fprintf(STDOUT, "**** Volume %u is busy ****\n", volid);
+ fprintf(STDOUT, "**** Volume %lu is busy ****\n",
+ (unsigned long) volid);
}
}
if (totalNotOK) {
while (notokHead.count) {
qGet(¬okHead, &volid);
- fprintf(STDOUT, "**** Could not attach volume %u ****\n", volid);
+ fprintf(STDOUT, "**** Could not attach volume %lu ****\n",
+ (unsigned long) volid);
}
}
}
if (verbose) {
- fprintf(STDOUT, "Fetching VLDB entry for %u .. ", volid);
+ fprintf(STDOUT, "Fetching VLDB entry for %lu .. ",
+ (unsigned long) volid);
fflush(STDOUT);
}
vcode = VLDB_GetEntryByID (volid, -1, &entry);
if (vcode) {
- fprintf(STDERR, "Could not fetch the entry for volume number %u from VLDB \n",volid);
+ fprintf(STDERR, "Could not fetch the entry for volume number %lu from VLDB \n",
+ (unsigned long) volid);
return (vcode);
}
if (verbose)
code = VLDB_GetEntryByID (volid, RWVOL, &entry);
if (code) {
- fprintf(STDERR, "Could not fetch the entry for volume number %u from VLDB \n",volid);
+ fprintf(STDERR, "Could not fetch the entry for volume number %lu from VLDB \n",
+ (unsigned long) volid);
return (code);
}
MapHostToNetwork(&entry);
}
code = UV_SetVolumeInfo(aserver, apart, volid, &info);
if (code)
- fprintf(STDERR,"Could not update volume info fields for volume number %u\n",volid);
+ fprintf(STDERR,"Could not update volume info fields for volume number %lu\n",
+ (unsigned long) volid);
return (code);
}
return code;
}
MapPartIdIntoName(pname, part);
- fprintf(STDOUT,"Volume %u created on partition %s of %s\n", volid, part,as->parms[0].items->data );
+ fprintf(STDOUT,"Volume %lu created on partition %s of %s\n",
+ (unsigned long) volid, part,as->parms[0].items->data );
return 0;
}
code = VLDB_GetEntryByID(volid, -1, &entry);
if (code) {
- fprintf(STDERR,"Could not fetch the entry for volume %u from VLDB\n",
- volid);
+ fprintf(STDERR,"Could not fetch the entry for volume %lu from VLDB\n",
+ (unsigned long) volid);
PrintError("",code);
return (code);
}
}
MapPartIdIntoName(partition, pname);
- fprintf(STDOUT,"Volume %u on partition %s server %s deleted\n",
- volid, pname, hostutil_GetNameByINet(server));
+ fprintf(STDOUT,"Volume %lu on partition %s server %s deleted\n",
+ (unsigned long) volid, pname, hostutil_GetNameByINet(server));
return 0;
}
code=UV_ListOneVolume(fromserver,frompart,volid,&p);
if(code)
{
- fprintf(STDERR,"vos:cannot access volume %u\n",volid);
+ fprintf(STDERR,"vos:cannot access volume %lu\n",
+ (unsigned long) volid);
free(p);
exit(1);
}
if(TESTM)
- fprintf(STDOUT,"volume %u size %d\n",volid,p->size);
+ fprintf(STDOUT,"volume %lu size %d\n",
+ (unsigned long) volid,p->size);
if(partition.free<=p->size)
{
- fprintf(STDERR,"vos: no space on target partition %s to move volume %u\n",
- toPartName,volid);
+ fprintf(STDERR,"vos: no space on target partition %s to move volume %lu\n",
+ toPartName,(unsigned long) volid);
free(p);
exit(1);
}
}
MapPartIdIntoName(topart,toPartName);
MapPartIdIntoName(frompart, fromPartName);
- fprintf(STDOUT,"Volume %u moved from %s %s to %s %s \n",volid,as->parms[1].items->data,fromPartName,as->parms[3].items->data,toPartName);
+ fprintf(STDOUT,"Volume %lu moved from %s %s to %s %s \n",
+ (unsigned long) volid,
+ as->parms[1].items->data,fromPartName,
+ as->parms[3].items->data,toPartName);
return 0;
}
code=UV_ListOneVolume(fromserver,frompart,volid,&p);
if(code)
{
- fprintf(STDERR,"vos:cannot access volume %u\n",volid);
+ fprintf(STDERR,"vos:cannot access volume %lu\n",
+ (unsigned long) volid);
free(p);
exit(1);
}
if(partition.free<=p->size)
{
- fprintf(STDERR,"vos: no space on target partition %s to copy volume %u\n",
- toPartName,volid);
+ fprintf(STDERR,"vos: no space on target partition %s to copy volume %lu\n",
+ toPartName,(unsigned long) volid);
free(p);
exit(1);
}
}
MapPartIdIntoName(topart,toPartName);
MapPartIdIntoName(frompart, fromPartName);
- fprintf(STDOUT,"Volume %u copied from %s %s to %s on %s %s \n",volid,
+ fprintf(STDOUT,"Volume %lu copied from %s %s to %s on %s %s \n",
+ (unsigned long) volid,
as->parms[1].items->data,fromPartName,
tovolume, as->parms[4].items->data,toPartName);
}
if (!code)
{
- fprintf(STDERR,"FATAL ERROR: backup volume %u exists on server %u\n",
- buvolid,buserver);
+ fprintf(STDERR,"FATAL ERROR: backup volume %lu exists on server %lu\n",
+ (unsigned long) buvolid,
+ (unsigned long) buserver);
exit(1);
}
}
restoreflags = 0;
if (vol_elsewhere) {
fprintf(STDERR,
- "%s volume %u already exists on a different server/part; not allowed\n",
- readonly ? "RO" : "RW", avolid);
+ "%s volume %lu already exists on a different server/part; not allowed\n",
+ readonly ? "RO" : "RW", (unsigned long) avolid);
exit(1);
}
}
}
MapPartIdIntoName(dummyPartList.partId[i],pname);
if(!quiet)
- fprintf(STDOUT,"Total number of volumes on server %s partition %s: %u \n",as->parms[0].items->data,pname,count);
+ fprintf(STDOUT,"Total number of volumes on server %s partition %s: %lu \n",as->parms[0].items->data,pname, (unsigned long) count);
if (wantExtendedInfo) {
XDisplayVolumes(aserver,
dummyPartList.partId[i],
if (!code) {
if (volid == entry.volumeId[RWVOL])
backupid = entry.volumeId[BACKVOL];
- fprintf(STDERR,"Warning: Entry for volume number %u exists in VLDB (but we're zapping it anyway!)\n",
- volid);
+ fprintf(STDERR,"Warning: Entry for volume number %lu exists in VLDB (but we're zapping it anyway!)\n",
+ (unsigned long) volid);
}
if (zapbackupid) {
volintInfo *pntr = (volintInfo *)0;
PrintDiagnostics("zap", code);
exit(1);
}
- fprintf(STDOUT,"Backup Volume %u deleted\n", backupid);
+ fprintf(STDOUT,"Backup Volume %lu deleted\n",
+ (unsigned long) backupid);
}
}
code = UV_VolumeZap(server,part,volid);
PrintDiagnostics("zap", code);
exit(1);
}
- fprintf(STDOUT,"Volume %u deleted\n",volid);
+ fprintf(STDOUT,"Volume %lu deleted\n", (unsigned long) volid);
return 0;
}
for(i = 0; i < count ; i++){
/*print out the relevant info */
fprintf(STDOUT,"--------------------------------------\n");
- fprintf(STDOUT,"transaction: %u created: %s",pntr->tid,
+ fprintf(STDOUT,"transaction: %lu created: %s",
+ (unsigned long) pntr->tid,
ctime((time_t *)&pntr->time));
if(pntr->returnCode){
- fprintf(STDOUT,"returnCode: %u\n",pntr->returnCode);
+ fprintf(STDOUT,"returnCode: %lu\n",
+ (unsigned long) pntr->returnCode);
}
if(pntr->iflags){
fprintf(STDOUT,"attachFlags: ");
fprintf(STDOUT,"delete\n");
}
MapPartIdIntoName(pntr->partition ,pname);
- fprintf(STDOUT,"volume: %u partition: %s procedure: %s\n",pntr->volid,pname, pntr->lastProcName);
+ fprintf(STDOUT,"volume: %lu partition: %s procedure: %s\n",
+ (unsigned long) pntr->volid, pname,
+ pntr->lastProcName);
if(pntr->callValid){
- fprintf(STDOUT,"packetRead: %u lastReceiveTime: %d packetSend: %u lastSendTime: %d\n",pntr->readNext,pntr->lastReceiveTime,pntr->transmitNext, pntr->lastSendTime);
+ fprintf(STDOUT,"packetRead: %lu lastReceiveTime: %d packetSend: %lu lastSendTime: %d\n",
+ (unsigned long) pntr->readNext,pntr->lastReceiveTime,
+ (unsigned long) pntr->transmitNext, pntr->lastSendTime);
}
pntr++;
fprintf(STDOUT,"--------------------------------------\n");
vcode = VLDB_GetEntryByID(volid, -1, rentry);
if(vcode) {
- fprintf(STDERR,"Could not fetch the entry for volume %u from VLDB \n",volid);
+ fprintf(STDERR,"Could not fetch the entry for volume %lu from VLDB \n",
+ (unsigned long) volid);
PrintError("",vcode);
return (vcode);
}
index = i;
}
if(index == -1) {
- fprintf(STDERR,"RO volume is not found in VLDB entry for volume %u\n", volid);
+ fprintf(STDERR,"RO volume is not found in VLDB entry for volume %lu\n", (unsigned long) volid);
return -1;
}
index = Lp_GetRwIndex(rentry);
if(index == -1) {
- fprintf(STDERR,"RW Volume is not found in VLDB entry for volume %u\n", volid);
+ fprintf(STDERR,"RW Volume is not found in VLDB entry for volume %lu\n",
+ (unsigned long) volid);
return -1;
}
if(volid == rentry->volumeId[RWVOL]){
} /*for*/
fprintf(STDOUT,"----------------------\n");
- fprintf(STDOUT,"Total VLDB entries deleted: %u; failed to delete: %u\n",totalBack,totalFail);
+ fprintf(STDOUT,"Total VLDB entries deleted: %lu; failed to delete: %lu\n",
+ (unsigned long) totalBack, (unsigned long) totalFail);
if (arrayEntries.nbulkentries_val) free(arrayEntries.nbulkentries_val);
return 0;
}
}
bypass:
- if (!quiet) fprintf(STDOUT,"\nTotal entries: %u\n", nentries);
+ if (!quiet) fprintf(STDOUT,"\nTotal entries: %lu\n",
+ (unsigned long) nentries);
if (tarray) free(tarray);
return 0;
}
fflush(STDOUT);
} /* process each vldb entry */
fprintf(STDOUT,"done\n");
- fprintf(STDOUT,"Total volumes backed up: %u; failed to backup: %u\n",totalBack,totalFail);
+ fprintf(STDOUT,"Total volumes backed up: %lu; failed to backup: %lu\n",
+ (unsigned long) totalBack, (unsigned long) totalFail);
fflush(STDOUT);
if(arrayEntries.nbulkentries_val) free(arrayEntries.nbulkentries_val);
return 0;
}
MapPartIdIntoName(apart,pname);
- if(totalE) fprintf(STDOUT,"Could not lock %u VLDB entries of %u locked entries\n",totalE,nentries);
+ if(totalE) fprintf(STDOUT,"Could not lock %lu VLDB entries of %lu locked entries\n", (unsigned long) totalE, (unsigned long) nentries);
else {
if(as->parms[0].items) {
fprintf(STDOUT,"Unlocked all the VLDB entries for volumes on server %s ",as->parms[0].items->data);
vcode = VLDB_GetEntryByID (volid, -1, &entry);
if(vcode) {
- fprintf(STDERR,"Could not fetch the entry for volume %u from VLDB\n",
- volid);
+ fprintf(STDERR,"Could not fetch the entry for volume %lu from VLDB\n",
+ (unsigned long) volid);
PrintError("convertROtoRW", code);
return vcode;
}
aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
code = AFSVolConvertROtoRWvolume(aconn, partition, volid);
if (code) {
- fprintf(STDERR,"Converting RO volume %u to RW volume failed with code %d\n", volid, code);
+ fprintf(STDERR,"Converting RO volume %lu to RW volume failed with code %d\n", (unsigned long) volid, code);
PrintError("convertROtoRW ", code);
return -1;
}
sauth = 1;
if(as->parms[16].items) /* -crypt specified */
vsu_SetCrypt(1);
- if (code = vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth,
- &cstruct, UV_SetSecurity)) {
- fprintf(STDERR,"could not initialize VLDB library (code=%u) \n",code);
+ if ((code = vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth,
+ &cstruct, UV_SetSecurity))) {
+ fprintf(STDERR,"could not initialize VLDB library (code=%lu) \n",
+ (unsigned long) code);
exit(1);
}
rxInitDone = 1;
if (rxInitDone) {
/* Shut down the ubik_client and rx connections */
if (cstruct) {
- ubik_ClientDestroy (cstruct);
+ (void) ubik_ClientDestroy (cstruct);
cstruct = 0;
}
rx_Finalize();
if (entry->flags & BACK_EXISTS)
fprintf(STDOUT," Backup: %-10u",entry->volumeId[BACKVOL]);
if ((entry->cloneId != 0) && (entry->flags & RO_EXISTS))
- fprintf(STDOUT," RClone: %-10u",entry->cloneId);
+ fprintf(STDOUT," RClone: %-10lu", (unsigned long) entry->cloneId);
fprintf(STDOUT,"\n");
#endif
- fprintf(STDOUT," number of sites -> %u\n",entry->nServers);
+ fprintf(STDOUT," number of sites -> %lu\n",
+ (unsigned long) entry->nServers);
for(i = 0; i < entry->nServers; i++) {
if(entry->serverFlags[i] & NEW_REPSITE)
isMixed = 1;
/* create the vldb entry */
vcode = VLDB_CreateEntry(&storeEntry);
if(vcode) {
- fprintf(STDERR,"Could not create a VLDB entry for the volume %s %u\n", aname,*anewid);
+ fprintf(STDERR,"Could not create a VLDB entry for the volume %s %lu\n",
+ aname, (unsigned long) *anewid);
/*destroy the created volume*/
VPRINT1("Deleting the newly created volume %u\n",*anewid);
AFSVolDeleteVolume(aconn,tid);
vldb entry exists then the volume is guaranteed to exist too wrt create*/
tid = 0;
if(code){
- fprintf(STDERR,"Failed to end the transaction on the volume %s %u\n",aname,*anewid);
+ fprintf(STDERR,"Failed to end the transaction on the volume %s %lu\n",
+ aname, (unsigned long) *anewid);
error = code;
goto cfail;
}
/* create the vldb entry */
vcode = VLDB_CreateEntry(&storeEntry);
if(vcode) {
- fprintf(STDERR,"Could not create a VLDB entry for the volume %s %u\n", aname,aid);
+ fprintf(STDERR,"Could not create a VLDB entry for the volume %s %lu\n",
+ aname, (unsigned long) aid);
error = vcode;
goto cfail;
}
}
if (verbose)
- fprintf(STDOUT,"Marking the readonly volume %u deleted in the VLDB\n", avolid);
+ fprintf(STDOUT,"Marking the readonly volume %lu deleted in the VLDB\n",
+ (unsigned long) avolid);
Lp_SetROValue(&entry, aserver, apart, 0, 0); /* delete the site */
entry.nServers--;
}
if (verbose)
- fprintf(STDOUT,"Marking the readwrite volume %u%s deleted in the VLDB\n",
- avolid, ((entry.flags & BACK_EXISTS)?", and its backup volume,":""));
+ fprintf(STDOUT,"Marking the readwrite volume %lu%s deleted in the VLDB\n",
+ (unsigned long) avolid, ((entry.flags & BACK_EXISTS)?", and its backup volume,":""));
Lp_SetRWValue(&entry, aserver, apart, 0L, 0L);
entry.nServers--;
/* Either delete or replace the VLDB entry */
if ((entry.nServers <= 0) || !(entry.flags & (RO_EXISTS | RW_EXISTS))) {
if (verbose)
- fprintf(STDOUT,"Last reference to the VLDB entry for %u - deleting entry\n", avolid);
+ fprintf(STDOUT,"Last reference to the VLDB entry for %lu - deleting entry\n",
+ (unsigned long) avolid);
code = ubik_Call(VL_DeleteEntry, cstruct, 0, avolid, vtype);
EGOTO1(error_exit, code, "Could not delete the VLDB entry for the volume %u \n",avolid);
} else {
if (!error) error = VOLSERNOVOL;
}
else if (notondisk) {
- fprintf(STDERR,"WARNING: Volume %u did not exist on the partition\n", avolid);
+ fprintf(STDERR,"WARNING: Volume %lu did not exist on the partition\n",
+ (unsigned long) avolid);
}
else if (notinvldb) {
- fprintf(STDERR,"WARNING: Volume %u does not exist in VLDB %s\n",
- avolid, ((notinvldb == 2)?"on server and partition":""));
+ fprintf(STDERR,"WARNING: Volume %lu does not exist in VLDB %s\n",
+ (unsigned long) avolid,
+ ((notinvldb == 2)?"on server and partition":""));
}
if (ttid) {
code = AFSVolEndTrans(aconn, ttid, &rcode);
code = (code ? code : rcode);
if (code) {
- fprintf(STDERR,"Could not end transaction on the volume %u\n", avolid);
+ fprintf(STDERR,"Could not end transaction on the volume %lu\n",
+ (unsigned long) avolid);
PrintError("", code);
if (!error) error = code;
}
if ( !Lp_Match(atoserver, atopart, &entry) )
{
/* the to server and partition do not exist in the vldb entry corresponding to volid */
- fprintf(STDERR,"The volume %u is not on the specified site. \n", afromvol);
+ fprintf(STDERR,"The volume %lu is not on the specified site. \n",
+ (unsigned long) afromvol);
fprintf(STDERR,"The current site is :");
for (i=0; i<entry.nServers; i++)
{
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (vcode)
{
- fprintf(STDERR," Could not release the lock on the VLDB entry for the volume %s %u \n",
- storeEntry.name,afromvol);
+ fprintf(STDERR," Could not release the lock on the VLDB entry for the volume %s %lu \n",
+ storeEntry.name, (unsigned long) afromvol);
error = vcode;
goto mfail;
}
if (vcode)
{
VPRINT("\n");
- fprintf(STDERR," Could not release the lock on the VLDB entry for the volume %u \n",
- afromvol);
+ fprintf(STDERR," Could not release the lock on the VLDB entry for the volume %lu \n",
+ (unsigned long) afromvol);
if (!error) error = vcode;
}
VDONE;
if (code || rcode)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on the source's clone volume %u\n", newVol);
+ fprintf(STDERR,"Could not end transaction on the source's clone volume %lu\n",
+ (unsigned long) newVol);
if (!error) error = (code ? code : rcode);
}
VDONE;
if (code || rcode)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on the source's clone volume %u\n",newVol);
+ fprintf(STDERR,"Could not end transaction on the source's clone volume %lu\n",
+ (unsigned long) newVol);
if (!error) error = (code ? code : rcode);
}
VDONE;
if (code)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on destination volume %u\n",afromvol);
+ fprintf(STDERR,"Could not end transaction on destination volume %lu\n",
+ (unsigned long) afromvol);
if (!error) error = (code ? code : rcode);
}
VDONE;
/* create the vldb entry */
vcode = VLDB_CreateEntry(&storeEntry);
if(vcode) {
- fprintf(STDERR,"Could not create a VLDB entry for the volume %s %u\n", atovolname,newVol);
+ fprintf(STDERR,"Could not create a VLDB entry for the volume %s %lu\n",
+ atovolname, (unsigned long) newVol);
/*destroy the created volume*/
VPRINT1("Deleting the newly created volume %u\n",newVol);
AFSVolDeleteVolume(toconn,totid);
if (code || rcode)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on the source volume %u\n", afromvol);
+ fprintf(STDERR,"Could not end transaction on the source volume %lu\n",
+ (unsigned long) afromvol);
if (!error) error = (code ? code : rcode);
}
VDONE;
if (code || rcode)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on the source's clone volume %u\n",cloneVol);
+ fprintf(STDERR,"Could not end transaction on the source's clone volume %lu\n",
+ (unsigned long) cloneVol);
if (!error) error = (code ? code : rcode);
}
VDONE;
if (code)
{
VPRINT("\n");
- fprintf(STDERR,"Could not end transaction on destination volume %u\n", newVol);
+ fprintf(STDERR,"Could not end transaction on destination volume %lu\n",
+ (unsigned long) newVol);
if (!error) error = (code ? code : rcode);
}
VDONE;
* since we are following the RW hash chain for searching */
code = VLDB_GetEntryByID(avolid, RWVOL, &entry);
if (code) {
- fprintf(STDERR, "Could not fetch the entry for the volume %u from the VLDB \n", avolid);
+ fprintf(STDERR, "Could not fetch the entry for the volume %lu from the VLDB \n",
+ (unsigned long) avolid);
error = code; goto bfail;
}
MapHostToNetwork(&entry);
code = ubik_Call(VL_SetLock,cstruct, 0, avolid, RWVOL, VLOP_BACKUP);
if (code) {
- fprintf(STDERR,"Could not lock the VLDB entry for the volume %u\n",avolid);
+ fprintf(STDERR,"Could not lock the VLDB entry for the volume %lu\n",
+ (unsigned long) avolid);
error = code;
goto bfail;
}
/* Reread the vldb entry */
code = VLDB_GetEntryByID(avolid, RWVOL, &entry);
if (code) {
- fprintf(STDERR,"Could not fetch the entry for the volume %u from the VLDB \n",avolid);
+ fprintf(STDERR,"Could not fetch the entry for the volume %lu from the VLDB \n",
+ (unsigned long) avolid);
error = code;
goto bfail;
}
code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &backupID);
if (code) {
fprintf(STDERR,
- "Could not allocate ID for the backup volume of %u from the VLDB\n",
- avolid);
+ "Could not allocate ID for the backup volume of %lu from the VLDB\n",
+ (unsigned long) avolid);
error = code;
goto bfail;
}
code = AFSVolTransCreate(aconn, backupID, apart, ITOffline, &btid);
if (code) {
if (code != VNOVOL) {
- fprintf(STDERR,"Could not reach the backup volume %u\n", backupID);
+ fprintf(STDERR,"Could not reach the backup volume %lu\n",
+ (unsigned long) backupID);
error = code;
goto bfail;
}
btid = 0;
if (code || rcode) {
fprintf(STDERR,
- "Could not end transaction on the previous backup volume %u\n",
- backupID);
+ "Could not end transaction on the previous backup volume %lu\n",
+ (unsigned long) backupID);
error = (code ? code : rcode);
goto bfail;
}
*/
code = AFSVolTransCreate(aconn, avolid, apart, ITBusy, &ttid);
if (code) {
- fprintf(STDERR,"Could not start a transaction on the volume %u\n",avolid);
+ fprintf(STDERR,"Could not start a transaction on the volume %lu\n",
+ (unsigned long) avolid);
error = code;
goto bfail;
}
code = AFSVolReClone(aconn, ttid, backupID);
if (code) {
- fprintf(STDERR,"Could not re-clone backup volume %u\n", backupID);
+ fprintf(STDERR,"Could not re-clone backup volume %lu\n",
+ (unsigned long) backupID);
error = code;
goto bfail;
}
code = AFSVolClone(aconn, ttid, 0,backupVolume, vname, &backupID);
if (code) {
- fprintf(STDERR,"Failed to clone the volume %u\n",avolid);
+ fprintf(STDERR,"Failed to clone the volume %lu\n",
+ (unsigned long) avolid);
error = code;
goto bfail;
}
code = AFSVolEndTrans(aconn, ttid, &rcode);
ttid = 0;
if (code || rcode) {
- fprintf(STDERR, "Failed to end the transaction on the rw volume %u\n", avolid);
+ fprintf(STDERR, "Failed to end the transaction on the rw volume %lu\n",
+ (unsigned long) avolid);
error = (code ? code : rcode);
goto bfail;
}
/* Now go back to the backup volume and bring it on line */
code = AFSVolTransCreate(aconn, backupID, apart, ITOffline, &btid);
if (code) {
- fprintf(STDERR,"Failed to start a transaction on the backup volume %u\n",backupID);
+ fprintf(STDERR,"Failed to start a transaction on the backup volume %lu\n",
+ (unsigned long) backupID);
error = code;
goto bfail;
}
code = AFSVolSetFlags(aconn, btid, 0);
if (code) {
- fprintf(STDERR,"Could not mark the backup volume %u on line \n",backupID);
+ fprintf(STDERR,"Could not mark the backup volume %lu on line \n",
+ (unsigned long) backupID);
error = code;
goto bfail;
}
code = AFSVolEndTrans(aconn, btid, &rcode);
btid = 0;
if (code || rcode) {
- fprintf(STDERR, "Failed to end the transaction on the backup volume %u\n", backupID);
+ fprintf(STDERR, "Failed to end the transaction on the backup volume %lu\n",
+ (unsigned long) backupID);
error = (code ? code : rcode);
goto bfail;
}
if (ttid) {
code = AFSVolEndTrans(aconn, ttid, &rcode);
if (code || rcode) {
- fprintf(STDERR, "Could not end transaction on the volume %u\n", avolid);
+ fprintf(STDERR, "Could not end transaction on the volume %lu\n",
+ (unsigned long) avolid);
if (!error)
error = (code ? code : rcode);
}
if (btid) {
code = AFSVolEndTrans(aconn, btid, &rcode);
if (code || rcode) {
- fprintf(STDERR,"Could not end transaction the backup volume %u\n",backupID);
+ fprintf(STDERR,"Could not end transaction the backup volume %lu\n",
+ (unsigned long) backupID);
if (!error)
error = (code ? code : rcode);
}
code = VLDB_ReplaceEntry(avolid, RWVOL, &storeEntry,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (code) {
- fprintf(STDERR,"Could not update the VLDB entry for the volume %u \n",avolid);
+ fprintf(STDERR,"Could not update the VLDB entry for the volume %lu \n",
+ (unsigned long) avolid);
if (!error)
error = code;
}
code = ubik_Call(VL_ReleaseLock,cstruct, 0, avolid, RWVOL,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (code) {
- fprintf(STDERR,"Could not unlock the VLDB entry for the volume %u \n",avolid);
+ fprintf(STDERR,"Could not unlock the VLDB entry for the volume %lu \n",
+ (unsigned long) avolid);
if (!error)
error = code;
}
if (!acode) { /* It really was there */
acode = AFSVolDeleteVolume(conn, tid);
if (acode) {
- fprintf(STDERR, "Failed to delete volume %u.\n", vid);
+ fprintf(STDERR, "Failed to delete volume %lu.\n", (unsigned long) vid);
PrintError ("", acode);
}
ccode = AFSVolEndTrans(conn, tid, &rcode);
if (!ccode)
ccode = rcode;
if (ccode) {
- fprintf(STDERR, "Failed to end transaction on volume %u.\n", vid);
+ fprintf(STDERR, "Failed to end transaction on volume %lu.\n",
+ (unsigned long) vid);
PrintError ("", ccode);
}
}
strcat(volname, ".readonly");
if (verbose) {
- fprintf(STDOUT,"Creating new volume %u on replication site %s: ",
- volid, hostutil_GetNameByINet(vldbEntryPtr->serverNumber[index]));
+ fprintf(STDOUT,"Creating new volume %lu on replication site %s: ",
+ (unsigned long) volid,
+ hostutil_GetNameByINet(vldbEntryPtr->serverNumber[index]));
fflush(STDOUT);
}
if (verbose) {
if (fullrelease) {
- fprintf(STDOUT,"This is a complete release of the volume %u\n", afromvol);
+ fprintf(STDOUT,"This is a complete release of the volume %lu\n",
+ (unsigned long) afromvol);
} else {
fprintf(STDOUT,"This is a completion of the previous release\n");
}
if (!volcount) continue;
if (verbose) {
- fprintf(STDOUT,"Starting ForwardMulti from %u to %u on %s",
- cloneVolId, entry.volumeId[ROVOL],
+ fprintf(STDOUT,"Starting ForwardMulti from %lu to %u on %s",
+ (unsigned long) cloneVolId, entry.volumeId[ROVOL],
hostutil_GetNameByINet(entry.serverNumber[times[0].vldbEntryIndex]));
for (s=1; s<volcount; s++) {
}
if (failure) {
char pname[10];
- fprintf(STDERR, "The volume %u could not be released to the following %d sites:\n",
- afromvol, failure);
+ fprintf(STDERR, "The volume %lu could not be released to the following %d sites:\n",
+ (unsigned long) afromvol, failure);
for (i=0; i<entry.nServers; i++) {
if (!(entry.serverFlags[i] & NEW_REPSITE)) {
MapPartIdIntoName(entry.serverPartition[i],pname);
/* All the ROs were release successfully. Remove the temporary clone */
if (!roclone) {
if (verbose) {
- fprintf(STDOUT,"Deleting the releaseClone %u ...", cloneVolId);
+ fprintf(STDOUT,"Deleting the releaseClone %lu ...",
+ (unsigned long) cloneVolId);
fflush(STDOUT);
}
code = DelVol (fromconn, cloneVolId, afrompart, ITOffline);
code = AFSVolEndTrans(fromconn, clonetid, &rcode);
clonetid = 0;
if (code) {
- fprintf (STDERR,"Failed to end cloning transaction on the RW volume %u\n", afromvol);
+ fprintf (STDERR,"Failed to end cloning transaction on the RW volume %lu\n",
+ (unsigned long) afromvol);
if (!error) error = code;
}
}
code = AFSVolEndTrans(fromconn, fromtid, &rcode);
fromtid = 0;
if (code) {
- fprintf (STDERR,"Failed to end transaction on the release clone %u\n", cloneVolId);
+ fprintf (STDERR,"Failed to end transaction on the release clone %lu\n",
+ (unsigned long) cloneVolId);
if (!error) error = code;
}
}
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, afromvol, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
- fprintf(STDERR,"Could not release lock on the VLDB entry for volume %u\n", afromvol);
+ fprintf(STDERR,"Could not release lock on the VLDB entry for volume %lu\n",
+ (unsigned long) afromvol);
if (!error) error = vcode;
}
}
VPRINT1("Ending transaction on volume %u...", afromvol);
code = AFSVolEndTrans(fromconn, fromtid, &rcode);
if (code || rcode) {
- fprintf(STDERR,"Could not end transaction on the volume %u\n", afromvol);
+ fprintf(STDERR,"Could not end transaction on the volume %lu\n",
+ (unsigned long) afromvol);
if (!error) error = (code?code:rcode);
}
VDONE;
code = AFSVolDeleteVolume(fromconn, clonetid);
if ( code )
{
- fprintf(STDERR,"Failed to delete the cloned volume %u\n", clonevol);
+ fprintf(STDERR,"Failed to delete the cloned volume %lu\n",
+ (unsigned long) clonevol);
}
else
{
VPRINT1("Ending transaction on cloned volume %u...", clonevol);
code = AFSVolEndTrans(fromconn, clonetid, &rcode);
if (code || rcode) {
- fprintf(STDERR,"Could not end transaction on the cloned volume %u\n", clonevol);
+ fprintf(STDERR,"Could not end transaction on the cloned volume %lu\n",
+ (unsigned long) clonevol);
if (!error) error = (code?code:rcode);
}
VDONE;
EGOTO1(refail, VOLSERBADOP, "The volume name %s exceeds the maximum limit of (VOLSER_OLDMAXVOLNAME -1 ) bytes\n",tovolname);
}
MapPartIdIntoName(topart, partName);
- fprintf(STDOUT,"Restoring volume %s Id %u on server %s partition %s ..", tovolname,
- pvolid, hostutil_GetNameByINet(toserver), partName);
+ fprintf(STDOUT,"Restoring volume %s Id %lu on server %s partition %s ..",
+ tovolname,
+ (unsigned long) pvolid,
+ hostutil_GetNameByINet(toserver), partName);
fflush(STDOUT);
code = AFSVolCreateVolume(toconn, topart, tovolname, volsertype, 0,&pvolid, &totid);
if (code){
}
code = AFSVolGetStatus(toconn,totid, &tstatus);
if(code) {
- fprintf(STDERR,"Could not get status information about the volume %u\n",pvolid);
+ fprintf(STDERR,"Could not get status information about the volume %lu\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
code = AFSVolSetIdsTypes(toconn,totid, tovolname, voltype, pvolid,0,0);
if(code) {
- fprintf(STDERR,"Could not set the right type and ID on %u\n",pvolid);
+ fprintf(STDERR,"Could not set the right type and ID on %lu\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
newDate = time(0);
code = AFSVolSetDate(toconn,totid, newDate);
if(code) {
- fprintf(STDERR,"Could not set the date on %u\n",pvolid);
+ fprintf(STDERR,"Could not set the date on %lu\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
volflag = ((flags & RV_OFFLINE) ? VTOutOfService : 0); /* off or on-line */
code = AFSVolSetFlags(toconn, totid, volflag);
if (code){
- fprintf(STDERR,"Could not mark %u online\n",pvolid );
+ fprintf(STDERR,"Could not mark %lu online\n", (unsigned long) pvolid );
error = code;
goto refail;
}
totid = 0;
if(!code) code = rcode;
if(code) {
- fprintf(STDERR,"Could not end transaction on %u\n",pvolid);
+ fprintf(STDERR,"Could not end transaction on %lu\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
*/
vcode = VLDB_GetEntryByID(pvolid,voltype, &entry);
if(vcode && vcode != VL_NOENT && vcode != VL_ENTDELETED) {
- fprintf(STDERR,"Could not fetch the entry for volume number %u from VLDB \n",pvolid);
+ fprintf(STDERR,"Could not fetch the entry for volume number %lu from VLDB \n",
+ (unsigned long) pvolid);
error = vcode;
goto refail;
}
MapNetworkToHost(&entry,&storeEntry);
vcode = VLDB_CreateEntry(&storeEntry);
if(vcode) {
- fprintf(STDERR,"Could not create the VLDB entry for volume number %u \n",pvolid);
+ fprintf(STDERR,"Could not create the VLDB entry for volume number %lu \n",
+ (unsigned long) pvolid);
error = vcode;
goto refail;
}
}
vcode = ubik_Call(VL_SetLock,cstruct, 0, pvolid, voltype, VLOP_RESTORE);
if(vcode) {
- fprintf(STDERR,"Could not lock the entry for volume number %u \n",pvolid);
+ fprintf(STDERR,"Could not lock the entry for volume number %lu \n",
+ (unsigned long) pvolid);
error = vcode;
goto refail;
}
if (!code){
code = AFSVolSetFlags(tempconn, temptid, VTDeleteOnSalvage | VTOutOfService);
if(code) {
- fprintf(STDERR,"Could not set flags on volume %u on the older site\n",pvolid);
+ fprintf(STDERR,"Could not set flags on volume %lu on the older site\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
code = AFSVolDeleteVolume(tempconn,temptid);
if(code){
- fprintf(STDERR,"Could not delete volume %u on the older site\n",pvolid);
+ fprintf(STDERR,"Could not delete volume %lu on the older site\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
temptid = 0;
if(!code) code = rcode;
if(code){
- fprintf(STDERR,"Could not end transaction on volume %u on the older site\n",pvolid);
+ fprintf(STDERR,"Could not end transaction on volume %lu on the older site\n",
+ (unsigned long) pvolid);
error = code;
goto refail;
}
MapNetworkToHost(&entry,&storeEntry);
vcode = VLDB_ReplaceEntry(pvolid,voltype, &storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP );
if(vcode) {
- fprintf(STDERR,"Could not update the entry for volume number %u \n",pvolid);
+ fprintf(STDERR,"Could not update the entry for volume number %lu \n",
+ (unsigned long) pvolid);
error = vcode;
goto refail;
}
if(islocked) {
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, pvolid, voltype, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if(vcode) {
- fprintf(STDERR,"Could not release lock on the VLDB entry for the volume %u\n",pvolid);
+ fprintf(STDERR,"Could not release lock on the VLDB entry for the volume %lu\n",
+ (unsigned long) pvolid);
if(!error) error = vcode;
}
}
code = AFSVolEndTrans(toconn, totid, &rcode);
if(!code) code = rcode;
if(code) {
- fprintf(STDERR,"Could not end transaction on the volume %u \n",pvolid);
+ fprintf(STDERR,"Could not end transaction on the volume %lu \n",
+ (unsigned long) pvolid);
if(!error) error = code;
}
}
code = AFSVolEndTrans(toconn, temptid, &rcode);
if(!code) code = rcode;
if(code) {
- fprintf(STDERR,"Could not end transaction on the volume %u \n",pvolid);
+ fprintf(STDERR,"Could not end transaction on the volume %lu \n",
+ (unsigned long) pvolid);
if(!error) error = code;
}
}
VPRINT("Binding to the VLDB server\n");
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0,volid,-1,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP );
if(vcode) {
- fprintf(STDERR,"Could not unlock the entry for volume number %u in VLDB \n",volid);
+ fprintf(STDERR,"Could not unlock the entry for volume number %lu in VLDB \n",
+ (unsigned long) volid);
PrintError("",vcode);
return (vcode);
}
error = ubik_Call(VL_SetLock,cstruct, 0,volid,RWVOL, VLOP_ADDSITE);
if (error) {
- fprintf(STDERR," Could not lock the VLDB entry for the volume %u \n", volid);
+ fprintf(STDERR," Could not lock the VLDB entry for the volume %lu \n",
+ (unsigned long) volid);
goto asfail;
}
islocked = 1;
error = VLDB_GetEntryByID(volid,RWVOL, &entry);
if (error) {
- fprintf(STDERR,"Could not fetch the VLDB entry for volume number %u \n",volid);
+ fprintf(STDERR,"Could not fetch the VLDB entry for volume number %lu \n",
+ (unsigned long) volid);
goto asfail;
}
MapNetworkToHost(&entry,&storeEntry);
error = VLDB_ReplaceEntry(volid,RWVOL,&storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (error) {
- fprintf(STDERR,"Could not update entry for volume %u \n",volid);
+ fprintf(STDERR,"Could not update entry for volume %lu \n",
+ (unsigned long) volid);
goto asfail;
}
islocked = 0;
if (islocked) {
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
- fprintf(STDERR,"Could not release lock on volume entry for %u \n",volid);
+ fprintf(STDERR,"Could not release lock on volume entry for %lu \n",
+ (unsigned long) volid);
PrintError("", vcode);
}
}
vcode = ubik_Call(VL_SetLock,cstruct, 0,volid,RWVOL, VLOP_ADDSITE);
if(vcode) {
- fprintf(STDERR," Could not lock the VLDB entry for volume %u \n", volid);
+ fprintf(STDERR," Could not lock the VLDB entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
return(vcode);
}
islocked = 1;
vcode = VLDB_GetEntryByID(volid,RWVOL, &entry);
if(vcode) {
- fprintf(STDERR,"Could not fetch the entry for volume number %u from VLDB \n",volid);
+ fprintf(STDERR,"Could not fetch the entry for volume number %lu from VLDB \n",
+ (unsigned long) volid);
PrintError("",vcode);
return (vcode);
}
fprintf(STDERR,"This site is not a replication site \n");
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if(vcode) {
- fprintf(STDERR,"Could not update entry for volume %u \n",volid);
+ fprintf(STDERR,"Could not update entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return(vcode);
fflush(STDOUT);
vcode = ubik_Call(VL_DeleteEntry,cstruct, 0,volid, ROVOL);
if(vcode) {
- fprintf(STDERR,"Could not delete VLDB entry for volume %u \n",volid);
+ fprintf(STDERR,"Could not delete VLDB entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
return(vcode);
}
VDONE;
}
MapNetworkToHost(&entry,&storeEntry);
- fprintf(STDOUT,"Deleting the replication site for volume %u ...",volid);
+ fprintf(STDOUT,"Deleting the replication site for volume %lu ...",
+ (unsigned long) volid);
fflush(STDOUT);
vcode = VLDB_ReplaceEntry(volid,RWVOL,&storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if(vcode){
- fprintf(STDERR,"Could not release lock on volume entry for %u \n",volid);
+ fprintf(STDERR,"Could not release lock on volume entry for %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return(vcode);
vcode = ubik_Call(VL_SetLock,cstruct, 0,volid,RWVOL, VLOP_ADDSITE);
if(vcode) {
- fprintf(STDERR," Could not lock the VLDB entry for volume %u \n", volid);
+ fprintf(STDERR," Could not lock the VLDB entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
return(vcode);
}
vcode = VLDB_GetEntryByID(volid,RWVOL, &entry);
if(vcode) {
- fprintf(STDERR,"Could not fetch the entry for volume number %u from VLDB \n",volid);
+ fprintf(STDERR,"Could not fetch the entry for volume number %lu from VLDB \n",
+ (unsigned long) volid);
PrintError("",vcode);
return (vcode);
}
index = Lp_GetRwIndex(&entry);
if (index < 0) {
/* no RW site exists */
- fprintf(STDERR,"No existing RW site for volume %u", volid);
+ fprintf(STDERR,"No existing RW site for volume %lu",
+ (unsigned long) volid);
vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if(vcode) {
- fprintf(STDERR,"Could not release lock on entry for volume %u \n",volid);
+ fprintf(STDERR,"Could not release lock on entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
return(vcode);
}
MapNetworkToHost(&entry,&storeEntry);
vcode = VLDB_ReplaceEntry(volid,RWVOL,&storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if(vcode){
- fprintf(STDERR,"Could not update entry for volume %u \n",volid);
+ fprintf(STDERR,"Could not update entry for volume %lu \n",
+ (unsigned long) volid);
PrintError("",vcode);
ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return(vcode);
if(code || rcode) success = 0;
}
if(success) curPtr->volFlags |= CLONEZAPPED;
- if(!success) fprintf(STDERR,"Could not zap volume %u\n",curPtr->volCloneId);
+ if(!success) fprintf(STDERR,"Could not zap volume %lu\n",
+ (unsigned long) curPtr->volCloneId);
if(success) VPRINT2("Clone of %s %u deleted\n", curPtr->volName,curPtr->volCloneId);
curPos++;
tid = 0;
if(code){
curPtr->volFlags &= ~CLONEVALID;
curPos++;
- fprintf(STDERR,"Could not clone %s due to error %u\n", curPtr->volName,code);
+ fprintf(STDERR,"Could not clone %s due to error %lu\n", curPtr->volName,
+ (unsigned long) code);
code=AFSVolEndTrans(aconn, tid, &rcode);
if(code)
fprintf(STDERR,"WARNING: could not end transaction\n");
aconn = UV_Bind(aserver,AFSCONF_VOLUMEPORT);
code = AFSVolListOneVolume(aconn, apart, volid, &volumeInfo);
if(code) {
- fprintf(STDERR,"Could not fetch the information about volume %u from the server\n",volid);
+ fprintf(STDERR,"Could not fetch the information about volume %lu from the server\n",
+ (unsigned long) volid);
}
else{
*resultPtr = volumeInfo.volEntries_val;
if (++pass == 2) {
code = ubik_Call(VL_SetLock, cstruct, 0, rwvolid, RWVOL, VLOP_DELETE);
if (code) {
- fprintf(STDERR, "Could not lock VLDB entry for %u\n", rwvolid);
+ fprintf(STDERR, "Could not lock VLDB entry for %lu\n",
+ (unsigned long) rwvolid);
ERROR_EXIT(code);
}
islocked = 1;
code = VLDB_GetEntryByID(rwvolid, RWVOL, &entry);
if (code) {
if (code != VL_NOENT) {
- fprintf(STDOUT,"Could not retreive the VLDB entry for volume %u \n", rwvolid);
+ fprintf(STDOUT,"Could not retreive the VLDB entry for volume %lu \n",
+ (unsigned long) rwvolid);
ERROR_EXIT(code);
}
/* The RW volume exists elsewhere - report this one a duplicate */
if (pass == 1) {
MapPartIdIntoName(apart, pname);
- fprintf(STDERR,"*** Warning: Orphaned RW volume %u exists on %s %s\n",
- rwvolid, hostutil_GetNameByINet(aserver), pname);
+ fprintf(STDERR,"*** Warning: Orphaned RW volume %lu exists on %s %s\n",
+ (unsigned long) rwvolid,
+ hostutil_GetNameByINet(aserver), pname);
MapPartIdIntoName(entry.serverPartition[idx], pname);
- fprintf(STDERR," VLDB reports RW volume %u exists on %s %s\n",
- rwvolid,
+ fprintf(STDERR," VLDB reports RW volume %lu exists on %s %s\n",
+ (unsigned long) rwvolid,
hostutil_GetNameByINet(entry.serverNumber[idx]), pname);
}
} else {
entry.volumeId[BACKVOL],
hostutil_GetNameByINet(entry.serverNumber[idx]), pname);
MapPartIdIntoName(apart, pname);
- fprintf(STDERR," VLDB reports its RW volume %u exists on %s %s\n",
- rwvolid, hostutil_GetNameByINet(aserver), pname);
+ fprintf(STDERR," VLDB reports its RW volume %lu exists on %s %s\n",
+ (unsigned long) rwvolid,
+ hostutil_GetNameByINet(aserver), pname);
}
}
}
/* VLDB says RW and/or BK is elsewhere - report this BK volume orphaned */
if (pass == 1) {
MapPartIdIntoName(apart, pname);
- fprintf(STDERR,"*** Warning: Orphaned BK volume %u exists on %s %s\n",
- volumeinfo->volid, hostutil_GetNameByINet(aserver), pname);
+ fprintf(STDERR,"*** Warning: Orphaned BK volume %lu exists on %s %s\n",
+ (unsigned long) volumeinfo->volid,
+ hostutil_GetNameByINet(aserver), pname);
MapPartIdIntoName(entry.serverPartition[idx], pname);
- fprintf(STDERR," VLDB reports its RW/BK volume %u exists on %s %s\n",
- rwvolid,
+ fprintf(STDERR," VLDB reports its RW/BK volume %lu exists on %s %s\n",
+ (unsigned long) rwvolid,
hostutil_GetNameByINet(entry.serverNumber[idx]), pname);
}
} else {
MapPartIdIntoName(entry.serverPartition[idx], pname);
fprintf(STDERR,"*** Warning: Orphaned BK volume %u exists on %s %s\n",
entry.volumeId[BACKVOL], hostutil_GetNameByINet(aserver), pname);
- fprintf(STDERR," VLDB reports its BK volume ID is %u\n",
- volumeinfo->volid);
+ fprintf(STDERR," VLDB reports its BK volume ID is %lu\n",
+ (unsigned long) volumeinfo->volid);
}
} else {
if (pass == 1) {
MapPartIdIntoName(entry.serverPartition[idx], pname);
- fprintf(STDERR,"*** Warning: Orphaned BK volume %u exists on %s %s\n",
- volumeinfo->volid, hostutil_GetNameByINet(aserver), pname);
+ fprintf(STDERR,"*** Warning: Orphaned BK volume %lu exists on %s %s\n",
+ (unsigned long) volumeinfo->volid,
+ hostutil_GetNameByINet(aserver), pname);
fprintf(STDERR," VLDB reports its BK volume ID is %u\n",
entry.volumeId[BACKVOL]);
}
fprintf(STDERR,"*** Warning: Orphaned RO volume %u exists on %s %s\n",
entry.volumeId[ROVOL],
hostutil_GetNameByINet(entry.serverNumber[j]), pname);
- fprintf(STDERR," VLDB reports its RO volume ID is %u\n",
- volumeinfo->volid);
+ fprintf(STDERR," VLDB reports its RO volume ID is %lu\n",
+ (unsigned long) volumeinfo->volid);
}
Lp_SetRWValue(entry, entry.serverNumber[idx],
*/
if (pass == 1) {
MapPartIdIntoName(apart, pname);
- fprintf(STDERR,"*** Warning: Orphaned RO volume %u exists on %s %s\n",
- volumeinfo->volid, hostutil_GetNameByINet(aserver), pname);
+ fprintf(STDERR,"*** Warning: Orphaned RO volume %lu exists on %s %s\n",
+ (unsigned long) volumeinfo->volid,
+ hostutil_GetNameByINet(aserver), pname);
fprintf(STDERR," VLDB reports its RO volume ID is %u\n",
entry.volumeId[ROVOL]);
}
if (createentry) {
code = VLDB_CreateEntry(&storeEntry);
if (code) {
- fprintf(STDOUT,"Could not create a VLDB entry for the volume %u\n", rwvolid);
+ fprintf(STDOUT,"Could not create a VLDB entry for the volume %lu\n",
+ (unsigned long) rwvolid);
ERROR_EXIT(code);
}
}
code = VLDB_ReplaceEntry(rwvolid, RWVOL, &storeEntry,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (code) {
- fprintf(STDERR,"Could not update entry for %u\n", rwvolid);
+ fprintf(STDERR,"Could not update entry for %lu\n",
+ (unsigned long) rwvolid);
ERROR_EXIT(code);
}
}
tentries++;
if (verbose) {
- fprintf(STDOUT,"Processing volume entry %d: %s (%u) on server %s %s...\n",
- j+1, vi->name, vi->volid,
+ fprintf(STDOUT,"Processing volume entry %d: %s (%lu) on server %s %s...\n",
+ j+1, vi->name, (unsigned long) vi->volid,
hostutil_GetNameByINet(aserver), pname);
fflush(STDOUT);
}
aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
code = AFSVolTransCreate(aconn, volid, part, ITOffline, &ttid);
if(code){
- fprintf(STDERR,"Could not start transaction on volume %u\n",volid);
+ fprintf(STDERR,"Could not start transaction on volume %lu\n",
+ (unsigned long) volid);
error = code;
goto zfail;
}
code = AFSVolDeleteVolume(aconn, ttid);
if(code){
- fprintf(STDERR,"Could not delete volume %u\n",volid);
+ fprintf(STDERR,"Could not delete volume %lu\n",
+ (unsigned long) volid);
error = code;
goto zfail;
}
ttid = 0;
if(!code) code = rcode;
if(code){
- fprintf(STDERR,"Could not end transaction on volume %u\n",volid);
+ fprintf(STDERR,"Could not end transaction on volume %lu\n",
+ (unsigned long) volid);
error = code;
goto zfail;
}
str = astring;
ptr = astring;
tryname = 0;
- while (curval = *str++){
+ while ((curval = *str++)){
if(curval < '0' || curval > '9')
tryname = 1;
}
}
value = 0;
- while (tc = *astring++) {
+ while ((tc = *astring++)) {
if (tc & 0x80) {
if(!tryname) fprintf(STDERR,"goofed in volid \n");
else {fprintf(STDERR,"Could not get entry from vldb for %s\n",ptr);PrintError("",vcode);}