/*@printflike@*/ extern void Log(const char *format, ...);
-int (*vol_PollProc) () = 0; /* someone must init this */
+int (*vol_PollProc) (void) = 0; /* someone must init this */
#define ERROR_EXIT(code) {error = code; goto error_exit;}
struct clone_items *last;
};
-void CloneVolume();
-void CloneVolume_r();
+void CloneVolume(Error *, Volume *, Volume *, Volume *);
static int
ci_AddItem(struct clone_head *ah, Inode aino)
/* apply a function to all dudes in the set */
int
-ci_Apply(struct clone_head *ah, int (*aproc) (), char *arock)
+ci_Apply(struct clone_head *ah, int (*aproc) (Inode, void *), void *arock)
{
register struct clone_items *ti;
register int i;
struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
int ReadWriteOriginal = VolumeWriteable(rwvp);
- Device device = rwvp->device;
/* Open the RW volume's index file and seek to beginning */
IH_COPY(rwH, rwvp->vnodeIndex[class].handle);
/*@printflike@*/ extern void Log(const char *format, ...);
-int (*V_BreakVolumeCallbacks) ();
+int (*V_BreakVolumeCallbacks) (VolumeId);
#define MAXHANDLERS 4 /* Up to 4 clients; must be at least 2, so that
* move = dump+restore can run on single server */
afs_int32
SYNC_closeChannel(SYNC_client_state * state)
{
- afs_int32 code;
SYNC_command com;
SYNC_response res;
SYNC_PROTO_BUF_DECL(ores);
int
SYNC_verifyProtocolString(char * buf, size_t len)
{
- int ret = 0;
size_t s_len;
s_len = afs_strnlen(buf, len);
{
static char pbuffer[128];
char pbuf[128], *ptr;
- int code, i;
#ifdef AFS_SUN5_ENV
struct mnttab mnt;
FILE *mntfile;
{
static char rawname[100];
struct stat statbuf;
- char *p;
int code, i;
i = strlen(devfile);
{
struct cmd_syndesc *ts;
int err = 0;
- int i;
- extern char cml_version_number[];
/* Initialize directory paths */
if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
common_volop_prolog(struct cmd_syndesc * as, struct state * state)
{
register struct cmd_item *ti;
- char pname[100], *temp;
state->vop = (struct volop_state *) calloc(1, sizeof(struct volop_state));
assert(state->vop != NULL);
res->hdr.reason, reason_code_to_string(res->hdr.reason));
VDisconnectFS();
+
+ return 0;
+
}
SYNC_PROTO_BUF_DECL(res_buf);
SYNC_response res;
Volume v;
+#ifdef AFS_DEMAND_ATTACH_FS
int hi, lo;
+#endif
res.hdr.response_len = sizeof(res.hdr);
res.payload.buf = res_buf;
printf("volume = {\n");
printf("\thashid = %u\n", v.hashid);
- printf("\theader = 0x%x\n", v.header);
+ printf("\theader = %p\n", v.header);
printf("\tdevice = %d\n", v.device);
- printf("\tpartition = 0x%x\n", v.partition);
- printf("\tlinkHandle = 0x%x\n", v.linkHandle);
+ printf("\tpartition = %p\n", v.partition);
+ printf("\tlinkHandle = %p\n", v.linkHandle);
printf("\tnextVnodeUnique = %u\n", v.nextVnodeUnique);
- printf("\tdiskDataHandle = 0x%x\n", v.diskDataHandle);
+ printf("\tdiskDataHandle = %p\n", v.diskDataHandle);
printf("\tvnodeHashOffset = %u\n", v.vnodeHashOffset);
printf("\tshuttingDown = %d\n", v.shuttingDown);
printf("\tgoingOffline = %d\n", v.goingOffline);
printf("\tupdateTime = %u\n", v.updateTime);
printf("\tvnodeIndex[vSmall] = {\n");
- printf("\t\thandle = 0x%x\n", v.vnodeIndex[vSmall].handle);
- printf("\t\tbitmap = 0x%x\n", v.vnodeIndex[vSmall].bitmap);
+ printf("\t\thandle = %p\n", v.vnodeIndex[vSmall].handle);
+ printf("\t\tbitmap = %p\n", v.vnodeIndex[vSmall].bitmap);
printf("\t\tbitmapSize = %u\n", v.vnodeIndex[vSmall].bitmapSize);
printf("\t\tbitmapOffset = %u\n", v.vnodeIndex[vSmall].bitmapOffset);
printf("\t}\n");
printf("\tvnodeIndex[vLarge] = {\n");
- printf("\t\thandle = 0x%x\n", v.vnodeIndex[vLarge].handle);
- printf("\t\tbitmap = 0x%x\n", v.vnodeIndex[vLarge].bitmap);
+ printf("\t\thandle = %p\n", v.vnodeIndex[vLarge].handle);
+ printf("\t\tbitmap = %p\n", v.vnodeIndex[vLarge].bitmap);
printf("\t\tbitmapSize = %u\n", v.vnodeIndex[vLarge].bitmapSize);
printf("\t\tbitmapOffset = %u\n", v.vnodeIndex[vLarge].bitmapOffset);
printf("\t}\n");
printf("\t}\n");
/* volume op state */
- printf("\tpending_vol_op = 0x%x\n", v.pending_vol_op);
+ printf("\tpending_vol_op = %p\n", v.pending_vol_op);
}
#else /* !AFS_DEMAND_ATTACH_FS */
if (res.hdr.flags & SYNC_FLAG_DAFS_EXTENSIONS) {
SYNC_PROTO_BUF_DECL(res_buf);
SYNC_response res;
FSSYNC_VolOp_info vop;
- int i;
res.hdr.response_len = sizeof(res.hdr);
res.payload.buf = res_buf;
printf("\t\treason = %d (%s)\n",
vop.com.reason, reason_code_to_string(vop.com.reason));
printf("\t\tcommand_len = %u\n", vop.com.command_len);
- printf("\t\tflags = 0x%x\n", vop.com.flags);
+ printf("\t\tflags = 0x%lux\n", afs_cast_uint32(vop.com.flags));
printf("\t}\n");
printf("\tvop = {\n");
vn_prolog(struct cmd_syndesc * as, struct state * state)
{
register struct cmd_item *ti;
- char pname[100], *temp;
state->vop = (struct volop_state *) calloc(1, sizeof(struct volop_state));
assert(state->vop != NULL);
SYNC_PROTO_BUF_DECL(res_buf);
SYNC_response res;
Vnode v;
- int hi, lo;
res.hdr.response_len = sizeof(res.hdr);
res.payload.buf = res_buf;
printf("vnode = {\n");
printf("\tvid_hash = {\n");
- printf("\t\tnext = 0x%lx\n", v.vid_hash.next);
- printf("\t\tprev = 0x%lx\n", v.vid_hash.prev);
+ printf("\t\tnext = %p\n", v.vid_hash.next);
+ printf("\t\tprev = %p\n", v.vid_hash.prev);
printf("\t}\n");
- printf("\thashNext = 0x%lx\n", v.hashNext);
- printf("\tlruNext = 0x%lx\n", v.lruNext);
- printf("\tlruPrev = 0x%lx\n", v.lruPrev);
+ printf("\thashNext = %p\n", v.hashNext);
+ printf("\tlruNext = %p\n", v.lruNext);
+ printf("\tlruPrev = %p\n", v.lruPrev);
printf("\thashIndex = %hu\n", v.hashIndex);
printf("\tchanged_newTime = %u\n", (unsigned int) v.changed_newTime);
printf("\tchanged_oldTime = %u\n", (unsigned int) v.changed_oldTime);
printf("\tdelete = %u\n", (unsigned int) v.delete);
printf("\tvnodeNumber = %u\n", v.vnodeNumber);
- printf("\tvolumePtr = 0x%lx\n", v.volumePtr);
+ printf("\tvolumePtr = %p\n", v.volumePtr);
printf("\tnUsers = %u\n", v.nUsers);
printf("\tcacheCheck = %u\n", v.cacheCheck);
}
#endif /* !AFS_DEMAND_ATTACH_FS */
- printf("\twriter = %u\n", v.writer);
- printf("\tvcp = 0x%lx\n", v.vcp);
- printf("\thandle = 0x%lx\n", v.handle);
+ printf("\twriter = %u\n", (unsigned int) v.writer);
+ printf("\tvcp = %p\n", v.vcp);
+ printf("\thandle = %p\n", v.handle);
printf("\tdisk = {\n");
printf("\t\ttype = %u\n", v.disk.type);
static void
print_vol_stats_general(VolPkgStats * stats)
{
+#ifdef AFS_DEMAND_ATTACH_FS
int i;
+#endif
afs_uint32 hi, lo;
printf("VolPkgStats = {\n");
static void
print_vol_stats_hash(struct VolumeHashChainStats * stats)
{
+#ifdef AFS_DEMAND_ATTACH_FS
afs_uint32 hi, lo;
+#endif
printf("DiskPartitionStats = {\n");
printf("\ttable_size = %d\n", stats->table_size);
Institution: The Information Technology Center, Carnegie-Mellon University
*/
-#ifdef notdef
-
-/* All this is going away in early 1989 */
-int newVLDB; /* Compatibility flag */
-
-#endif
-static int newVLDB = 1;
-
-
#ifndef AFS_PTHREAD_ENV
#define USUAL_PRIORITY (LWP_MAX_PRIORITY - 2)
/*@printflike@*/ extern void Log(const char *format, ...);
-int (*V_BreakVolumeCallbacks) ();
+int (*V_BreakVolumeCallbacks) (VolumeId volume);
#define MAXHANDLERS 4 /* Up to 4 clients; must be at least 2, so that
* move = dump+restore can run on single server */
/* Forward declarations */
static void * FSYNC_sync(void *);
-static void FSYNC_newconnection();
-static void FSYNC_com();
-static void FSYNC_Drop();
-static void AcceptOn();
-static void AcceptOff();
-static void InitHandler();
-static int AddHandler();
-static int FindHandler();
-static int FindHandler_r();
-static int RemoveHandler();
+static void FSYNC_newconnection(int afd);
+static void FSYNC_com(int fd);
+static void FSYNC_Drop(int fd);
+static void AcceptOn(void);
+static void AcceptOff(void);
+static void InitHandler(void);
+static int AddHandler(int fd, void (*aproc)(int));
+static int FindHandler(int afd);
+static int FindHandler_r(int afd);
+static int RemoveHandler(int afd);
#if defined(HAVE_POLL) && defined (AFS_PTHREAD_ENV)
static void CallHandler(struct pollfd *fds, int nfds, int mask);
static void GetHandler(struct pollfd *fds, int maxfds, int events, int *nfds);
static afs_int32 FSYNC_com_VolOp(int fd, SYNC_command * com, SYNC_response * res);
+#ifdef AFS_DEMAND_ATTACH_FS
static afs_int32 FSYNC_com_VolError(FSSYNC_VolOp_command * com, SYNC_response * res);
+#endif
static afs_int32 FSYNC_com_VolOn(FSSYNC_VolOp_command * com, SYNC_response * res);
static afs_int32 FSYNC_com_VolOff(FSSYNC_VolOp_command * com, SYNC_response * res);
static afs_int32 FSYNC_com_VolMove(FSSYNC_VolOp_command * com, SYNC_response * res);
static afs_int32 FSYNC_com_StatsOp(int fd, SYNC_command * com, SYNC_response * res);
static afs_int32 FSYNC_com_StatsOpGeneral(FSSYNC_StatsOp_command * scom, SYNC_response * res);
+
+#ifdef AFS_DEMAND_ATTACH_FS
static afs_int32 FSYNC_com_StatsOpViceP(FSSYNC_StatsOp_command * scom, SYNC_response * res);
static afs_int32 FSYNC_com_StatsOpHash(FSSYNC_StatsOp_command * scom, SYNC_response * res);
static afs_int32 FSYNC_com_StatsOpHdr(FSSYNC_StatsOp_command * scom, SYNC_response * res);
static afs_int32 FSYNC_com_StatsOpVLRU(FSSYNC_StatsOp_command * scom, SYNC_response * res);
-
+#endif
static void FSYNC_com_to_info(FSSYNC_VolOp_command * vcom, FSSYNC_VolOp_info * info);
static void *
FSYNC_sync(void * args)
{
-#ifdef USE_UNIX_SOCKETS
- char tbuffer[AFSDIR_PATH_MAX];
-#endif /* USE_UNIX_SOCKETS */
- int on = 1;
extern int VInit;
int code;
- int numTries;
#ifdef AFS_PTHREAD_ENV
int tid;
#endif
CallHandler(&FSYNC_readfds);
#endif
}
+ return NULL; /* hush now, little gcc */
}
static void
#else /* USE_UNIX_SOCKETS */
struct sockaddr_in other;
#endif
- int junk, fd;
+ int fd;
+ socklen_t junk;
junk = sizeof(other);
fd = accept(afd, (struct sockaddr *)&other, &junk);
if (fd == -1) {
}
#else /* !AFS_DEMAND_ATTACH_FS */
tvolName[0] = '/';
- snprintf(&tvolName[1], sizeof(tvolName)-1, VFORMAT, vcom->vop->volume);
+ snprintf(&tvolName[1], sizeof(tvolName)-1, VFORMAT, afs_cast_uint32(vcom->vop->volume));
tvolName[sizeof(tvolName)-1] = '\0';
vp = VAttachVolumeByName_r(&error, vcom->vop->partName, tvolName,
FSSYNC_VolOp_info info;
afs_int32 code = SYNC_OK;
int i;
- Volume * vp, * nvp;
+ Volume * vp;
Error error;
#ifdef AFS_DEMAND_ATTACH_FS
int reserved = 0;
+ Volume *nvp;
#endif
if (SYNC_verifyProtocolString(vcom->vop->partName, sizeof(vcom->vop->partName))) {
afs_int32 code = SYNC_FAILED;
Error error;
Volume * vp;
- int hdr_ok = 0;
if (SYNC_verifyProtocolString(vcom->vop->partName, sizeof(vcom->vop->partName))) {
res->hdr.reason = SYNC_REASON_MALFORMED_PACKET;
goto done;
}
- load_done:
memcpy(res->payload.buf, &V_disk(vp), sizeof(VolumeDiskData));
res->hdr.response_len += sizeof(VolumeDiskData);
#ifndef AFS_DEMAND_ATTACH_FS
Volume *vp;
tvolName[0] = '/';
- sprintf(&tvolName[1], VFORMAT, p[i].volumeID);
+ sprintf(&tvolName[1], VFORMAT, afs_cast_uint32(p[i].volumeID));
vp = VAttachVolumeByName_r(&error, p[i].partName, tvolName,
V_VOLUPD);
if (vp)
static int AcceptHandler = -1; /* handler id for accept, if turned on */
static void
-AcceptOn()
+AcceptOn(void)
{
if (AcceptHandler == -1) {
assert(AddHandler(fssync_server_state.fd, FSYNC_newconnection));
}
static void
-AcceptOff()
+AcceptOff(void)
{
if (AcceptHandler != -1) {
assert(RemoveHandler(fssync_server_state.fd));
/* The multiple FD handling code. */
static int HandlerFD[MAXHANDLERS];
-static int (*HandlerProc[MAXHANDLERS]) ();
+static void (*HandlerProc[MAXHANDLERS]) (int);
static void
-InitHandler()
+InitHandler(void)
{
register int i;
ObtainWriteLock(&FSYNC_handler_lock);
#endif
static int
-AddHandler(int afd, int (*aproc) ())
+AddHandler(int afd, void (*aproc) (int))
{
register int i;
ObtainWriteLock(&FSYNC_handler_lock);
int
main(int argc, char **argv)
{
- int error = 0;
- struct stat status;
- int dev, fd, inode;
-
#if defined(AFS_NT40_ENV) || defined(AFS_NAMEI_ENV)
fprintf(stderr, "gi not supported on NT or NAMEI systems.\n");
exit(1);
#else
+ int error = 0;
+ struct stat status;
+ int dev, fd, inode;
argc--;
argv++;
/* Hash table for inode handles */
IHashBucket_t ihashTable[I_HANDLE_HASH_SIZE];
+void *ih_sync_thread(void *);
#ifdef AFS_PTHREAD_ENV
/* Initialize the global ihandle mutex */
fdCacheSize = MIN(fdMaxCacheSize, FD_DEFAULT_CACHESIZE);
{
- void *ih_sync_thread();
#ifdef AFS_PTHREAD_ENV
pthread_t syncer;
pthread_attr_t tattr;
}
void
-ih_sync_all() {
+ih_sync_all(void) {
+
int ihash;
IH_LOCK;
}
void *
-ih_sync_thread() {
+ih_sync_thread(void *dummy) {
while(1) {
#ifdef AFS_PTHREAD_ENV
#endif
ih_sync_all();
}
+ return NULL;
}
*/
static afs_int32
-convertVolumeInfo(fdr, fdw, vid)
- int fdr;
- int fdw;
- afs_uint32 vid;
+convertVolumeInfo(int fdr, int fdw, afs_uint32 vid)
{
struct VolumeDiskData vd;
char *p;
char smallSeen = 0;
char largeSeen = 0;
char linkSeen = 0;
- int code, fd, fd2, found;
+ int code, fd, fd2;
char *p;
DIR *dirp;
Inode ino;
struct DiskPartition64 *partP;
struct ViceInodeInfo info;
struct VolumeDiskHeader h;
- char volname[20];
char headername[16];
afs_int32 error = 0;
#else
#include <strings.h>
#endif
-
+#include <afs/afsutil.h>
+
#include <afs/assert.h>
#include "nfs.h"
#include "lwp.h"
struct Lock localLock;
-char *vol_DevName();
#define MAXATONCE 100
/* structure containing neatly packed set of inodes and the # of times we'll have
dirp = opendir(part);
assert(dirp);
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
if (dp->d_name[0] == 'V') {
Log("This program is compiled with AFS_NAMEI_ENV, but partition %s seems to contain volumes which don't use the namei-interface; aborting\n", part);
closedir(dirp);
* partitions, in the NAMEI fileserver.
*/
void
-VAttachPartitions2()
+VAttachPartitions2(void)
{
#ifdef AFS_NAMEI_ENV
DIR *dirp;
exit(-1);
}
- while (fsent = getfsent()) {
+ while ((fsent = getfsent())) {
if (strcmp(fsent->fs_type, "rw") != 0)
continue;
void
VSetPartitionDiskUsage_r(register struct DiskPartition64 *dp)
{
- int fd, bsize, code;
+ int bsize, code;
afs_int64 totalblks, free, used, availblks;
int reserved;
#ifdef afs_statvfs
SetSalvageDirHandle(DirHandle * dir, afs_int32 volume, Device device,
Inode inode)
{
- static SalvageCacheCheck = 1;
+ static int SalvageCacheCheck = 1;
memset(dir, 0, sizeof(DirHandle));
dir->dirh_device = device;
#include <string.h>
#include <sys/stat.h>
#include <afs/assert.h>
+#include <afs/afsutil.h>
#include <rx/xdr.h>
#include "afs/afsint.h"
/* forward declarations */
static int ObliterateRegion(Volume * avp, VnodeClass aclass, StreamHandle_t * afile,
afs_int32 * aoffset);
+#if 0
static void PurgeIndex(Volume * vp, VnodeClass class);
+static void PurgeHeader(Volume * vp);
+#endif
+
static void PurgeIndex_r(Volume * vp, VnodeClass class);
static void PurgeHeader_r(Volume * vp);
-static void PurgeHeader(Volume * vp);
/* No lock needed. Only the volserver will call this, and only one transaction
* can have a given volume (volid/partition pair) in use at a time
return -1;
}
+#if 0
static void
PurgeIndex(Volume * vp, VnodeClass class)
{
PurgeIndex_r(vp, class);
VOL_UNLOCK;
}
+#endif
static void
PurgeIndex_r(Volume * vp, VnodeClass class)
FDH_CLOSE(fdP);
}
+#if 0
static void
PurgeHeader(Volume * vp)
{
PurgeHeader_r(vp);
VOL_UNLOCK;
}
+#endif
static void
PurgeHeader_r(Volume * vp)
{
register struct cmd_item *ti;
char pname[100], *temp;
- afs_int32 seenpart = 0, seenvol = 0, vid = 0, seenany = 0;
+ afs_int32 seenpart = 0, seenvol = 0, vid = 0;
+
+#ifdef FAST_RESTART
+ afs_int32 seenany = 0;
+#endif
+
struct DiskPartition64 *partP;
#ifdef AFS_SGI_VNODE_GLUE
#define MAXHANDLERS 4 /* Up to 4 clients; must be at least 2, so that
* move = dump+restore can run on single server */
+
+/*
+ * This lock controls access to the handler array.
+ */
+struct Lock SALVSYNC_handler_lock;
+
+
+#ifdef AFS_DEMAND_ATTACH_FS
+/*
+ * SALVSYNC is a feature specific to the demand attach fileserver
+ */
+
/* Forward declarations */
static void * SALVSYNC_syncThread(void *);
static void SALVSYNC_newconnection(int fd);
static int RemoveHandler(register int afd);
static void GetHandler(fd_set * fdsetp, int *maxfdp);
-
-/*
- * This lock controls access to the handler array.
- */
-struct Lock SALVSYNC_handler_lock;
-
-
-#ifdef AFS_DEMAND_ATTACH_FS
-/*
- * SALVSYNC is a feature specific to the demand attach fileserver
- */
-
static int AllocNode(struct SalvageQueueNode ** node);
static int AddToSalvageQueue(struct SalvageQueueNode * node);
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <stdarg.h>
#ifdef AFS_PTHREAD_ENV
#include <assert.h>
#else /* AFS_PTHREAD_ENV */
struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES];
-private void StickOnLruChain_r(register Vnode * vnp,
- register struct VnodeClassInfo *vcp);
+void VNLog(afs_int32 aop, afs_int32 anparms, ... );
extern int LogLevel;
static afs_int32 theLog[THELOGSIZE];
static afs_int32 vnLogPtr = 0;
void
-VNLog(afs_int32 aop, afs_int32 anparms, afs_int32 av1, afs_int32 av2,
- afs_int32 av3, afs_int32 av4)
+VNLog(afs_int32 aop, afs_int32 anparms, ... )
{
register afs_int32 temp;
- afs_int32 data[4];
+ va_list ap;
+
+ va_start(ap, anparms);
- /* copy data to array */
- data[0] = av1;
- data[1] = av2;
- data[2] = av3;
- data[3] = av4;
if (anparms > 4)
anparms = 4; /* do bounds checking */
if (vnLogPtr >= THELOGSIZE)
vnLogPtr = 0;
for (temp = 0; temp < anparms; temp++) {
- theLog[vnLogPtr++] = data[temp];
+ theLog[vnLogPtr++] = va_arg(ap, afs_int32);
if (vnLogPtr >= THELOGSIZE)
vnLogPtr = 0;
}
+ va_end(ap);
}
/* VolumeHashOffset -- returns a new value to be stored in the
{
register Vnode *vnp;
VnodeId vnodeNumber;
- int bitNumber, code;
+ int bitNumber;
register struct VnodeClassInfo *vcp;
VnodeClass class;
Unique unique;
VGetVnode_r(Error * ec, Volume * vp, VnodeId vnodeNumber, int locktype)
{ /* READ_LOCK or WRITE_LOCK, as defined in lock.h */
register Vnode *vnp;
- int code;
VnodeClass class;
struct VnodeClassInfo *vcp;
- Volume * oldvp = NULL;
*ec = 0;
int writeLocked;
VnodeClass class;
struct VnodeClassInfo *vcp;
- int code;
*ec = 0;
assert(Vn_refcount(vnp) != 0);
int writeLocked;
VnodeClass class;
struct VnodeClassInfo *vcp;
- int code;
#ifdef AFS_PTHREAD_ENV
pthread_t thisProcess;
#else /* AFS_PTHREAD_ENV */
} else {
VnStore(ec, vp, vnp, vcp, class);
}
- sane:
vcp->writes++;
vnp->changed_newTime = vnp->changed_oldTime = 0;
}
#include "viceinode.h"
#include "volinodes.h"
#include <afs/afssyscalls.h>
-
+#include <afs/afsutil.h>
+
#ifdef _AIX
#include <time.h>
#endif
{
#define MAX_DATE_RESULT 100
static char results[8][MAX_DATE_RESULT];
- static next;
+ static int next;
struct tm *tm = localtime(&date);
char buf[32];
#ifdef AFS_NT40_ENV
#include <direct.h>
struct DiskPartition64 *
-FindCurrentPartition()
+FindCurrentPartition(void)
{
int dr = _getdrive();
struct DiskPartition64 *dp;
}
#else
struct DiskPartition64 *
-FindCurrentPartition()
+FindCurrentPartition(void)
{
char partName[1024];
char tmp = '\0';
vsp->fileName = 0;
}
+int
CompareInodes(const void *_p1, const void *_p2)
{
register const struct ViceInodeInfo *p1 = _p1;
{
int volume = ip->u.vnode.volumeId;
int rwvolume = volume;
- register n, nSpecial;
+ register int n, nSpecial;
register Unique maxunique;
n = nSpecial = 0;
maxunique = 0;
register struct ViceInodeInfo *ip;
struct ViceInodeInfo *buf;
struct afs_stat status;
- register nInodes;
+ register int nInodes;
assert(afs_fstat(inodeFd, &status) == 0);
buf = (struct ViceInodeInfo *)malloc(status.st_size);
}
void
-Exit(code)
- int code;
+Exit(int code)
{
if (ShowLog)
showlog();
we require the table to be ordered */
#define MAXINODETYPE VI_LINKTABLE
-Volume *VWaitAttachVolume();
-
#endif /* __volinodes_h_ */
static void FreeVolumeHeader(register Volume * vp);
static void AddVolumeToHashTable(register Volume * vp, int hashid);
static void DeleteVolumeFromHashTable(register Volume * vp);
+#if 0
static int VHold(Volume * vp);
+#endif
static int VHold_r(Volume * vp);
static void VGetBitmap_r(Error * ec, Volume * vp, VnodeClass class);
static void VReleaseVolumeHandles_r(Volume * vp);
static int VCheckOffline(register Volume * vp);
static int VCheckDetach(register Volume * vp);
static Volume * GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint, int flags);
+#if 0
static int VolumeExternalName_r(VolumeId volumeId, char * name, size_t len);
+#endif
int LogLevel; /* Vice loglevel--not defined as extern so that it will be
* defined when not linked with vice, XXXX */
assert(pthread_cond_destroy(¶ms.thread_done_cv) == 0);
#else /* AFS_PTHREAD_ENV */
- DIR *dirp;
- struct dirent *dp;
/* Attach all the volumes in this partition */
for (diskP = DiskPartitionList; diskP; diskP = diskP->next) {
Volume *
VAttachVolumeByName_r(Error * ec, char *partition, char *name, int mode)
{
- register Volume *vp = NULL, *svp = NULL;
+ register Volume *vp = NULL;
int fd, n;
struct afs_stat status;
struct VolumeDiskHeader diskHeader;
VolId volumeId;
#ifdef AFS_DEMAND_ATTACH_FS
VolumeStats stats_save;
+ Volume *svp = NULL;
#endif /* AFS_DEMAND_ATTACH_FS */
*ec = 0;
Log("VAttachVolume: Error reading diskDataHandle vol header %s; error=%u\n", path, *ec);
}
- disk_header_loaded:
-
#ifdef AFS_DEMAND_ATTACH_FS
+ disk_header_loaded:
if (!*ec) {
/* check for pending volume operations */
}
#endif /* AFS_DEMAND_ATTACH_FS */
+#if 0
static int
VHold(register Volume * vp)
{
VOL_UNLOCK;
return retVal;
}
+#endif
/***************************************************/
static int
VCheckOffline(register Volume * vp)
{
- Volume * rvp = NULL;
int ret = 0;
if (vp->goingOffline && !vp->nUsers) {
*
* @internal volume package internal use only.
*/
+#ifdef AFS_DEMAND_ATTACH_FS
static int
VolumeExternalName_r(VolumeId volumeId, char * name, size_t len)
{
return afs_snprintf(name, len, VFORMAT, volumeId);
}
+#endif
/***************************************************/
VLookupVolume_r(Error * ec, VolId volumeId, Volume * hint)
{
register int looks = 0;
- Volume * vp, *np, *pp;
+ Volume * vp, *np;
+#ifdef AFS_DEMAND_ATTACH_FS
+ Volume *pp;
+#endif
VolumeHashChainHead * head;
*ec = 0;
/* Some initialization parameters for the volume package */
/* Add new initialization parameters here */
-extern int (*V_BreakVolumeCallbacks) ();
-extern int (*vol_PollProc) ();
+extern int (*V_BreakVolumeCallbacks) (VolumeId);
+extern int (*vol_PollProc) (void);
+
#define DOPOLL ((vol_PollProc)? (*vol_PollProc)() : 0)
#ifdef AFS_DEMAND_ATTACH_FS
extern Volume * VLookupVolume_r(Error * ec, VolId volumeId, Volume * hint);
extern void VGetVolumePath(Error * ec, VolId volumeId, char **partitionp,
char **namep);
+extern char *vol_DevName(dev_t adev, char *wpath);
+
#ifdef AFS_DEMAND_ATTACH_FS
extern Volume *VPreAttachVolumeByName(Error * ec, char *partition, char *name);
extern Volume *VPreAttachVolumeByName_r(Error * ec, char *partition, char *name);