[OpenAFS-devel] Some patches

Hartmut Reuter reuter@rzg.mpg.de
Wed, 31 Jan 2001 13:03:15 +0100


This is a multi-part message in MIME format.
--------------9ED0C27F2314BC0FCA3F6845
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi Derrick,

here are now some patches in the attachment:

1) 	Patch to compile OpenAFS 1.0.2 under sgi_65. This is mainly
	removing (ifdef-ing) of EFS stuff.

2)	X_UBIK: If compiled with -DX_UBIK you get the possibility
	to declare some of the database servers as "clones". These
	never can become sync-site and are not counted in the voting.
	You specify a clone by putting its name in [] in the 
	"bos addhost" command. This extension is very nice if your 
	cell has database servers far away in other towns as it happens
	for our cell with parts in Greifswald and Berlin (800 or 550 km).

3)	Extensions used by MR-AFS in the client. I have added only two
	pioctl-calls which are used by the "fs"-command for a large number
	of MR-AFS specific subcommands. With this modification also the 
	data type afs_int64 is introduced because MR-AFS supports large files.
	afs_int64 is either "long long" or a structure consisting of two
	32-bit numbers. We are already running on rs_aix42 a fully large-file
	capable AFS-client, but these changes are still in a beta test and 
	not yet added here.

Best regards,
Hartmut
 
-- 
-----------------------------------------------------------------
Hartmut Reuter                           e-mail reuter@rzg.mpg.de
					   phone +49-89-3299-1328
RZG (Rechenzentrum Garching)               fax   +49-89-3299-1301 
Computing Center of the Max-Planck-Gesellschaft (MPG) and the
Institut fuer Plasmaphysik (IPP)
-----------------------------------------------------------------
--------------9ED0C27F2314BC0FCA3F6845
Content-Type: text/plain; charset=us-ascii;
 name="diffs.sgi_65"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diffs.sgi_65"

diff -r -u src.orig/afs/IRIX/osi_file.c src/afs/IRIX/osi_file.c
--- src.orig/afs/IRIX/osi_file.c	Sat Nov  4 11:03:22 2000
+++ src/afs/IRIX/osi_file.c	Tue Jan 30 10:06:27 2001
@@ -23,6 +23,7 @@
  * now vectors to the correct EFS or XFS function. If new functionality is
  * added which accesses the inode, that will also need EFS/XFS variants.
  */
+#ifdef AFS_SGI_EFS_IOPS_ENV
 vnode_t *afs_EFSIGetVnode(ino_t ainode)
 {
     struct inode *ip;
@@ -39,6 +40,7 @@
     iunlock(ip);
     return (EFS_ITOV(ip));
 }    
+#endif /* AFS_SGI_EFS_IOPS_ENV */
 
 vnode_t *afs_XFSIGetVnode(ino_t ainode)
 {
@@ -142,6 +144,7 @@
     return code;
 }
 
+#ifdef AFS_SGI_EFS_IOPS_ENV
 void osi_DisableAtimes(avp)
 struct vnode *avp;
 {
@@ -152,6 +155,7 @@
    }
 
 }
+#endif /* AFS_SGI_EFS_IOPS_ENV */
 
 
 /* Generic read interface */
@@ -185,7 +189,9 @@
     if (code == 0) {
 	code = asize - resid;
 	afile->offset += code;
+#ifdef AFS_SGI_EFS_IOPS_ENV
 	osi_DisableAtimes(afile->vnode);
+#endif /* AFS_SGI_EFS_IOPS_ENV */
     }
     else {
 	afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
diff -r -u src.orig/afs/IRIX/osi_inode.c src/afs/IRIX/osi_inode.c
--- src.orig/afs/IRIX/osi_inode.c	Sat Nov  4 11:03:22 2000
+++ src/afs/IRIX/osi_inode.c	Tue Jan 30 16:57:43 2001
@@ -166,7 +166,8 @@
 	return ENOSYS;
 #endif
 
-    if (error = iget(vfstom(vfsp), (unsigned int)(inode&0xffffffff), &ip)) {
+    if (error = iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), 
+				(unsigned int)(inode&0xffffffff), &ip)) {
 	return error;
     }
     *ipp = ip;
@@ -216,8 +217,9 @@
     }
 #endif
 
-    if (error = xfs_iget(vfstom(vfsp), (void*)0,
-			 (xfs_ino_t)inode,XFS_ILOCK_SHARED, &ip, (daddr_t)0)) {
+    if (error = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)),
+		    (void*)0, (xfs_ino_t)inode, 
+		    XFS_ILOCK_SHARED, &ip, (daddr_t)0)) {
 	SET_XFS_ERROR(3, vfsp->vfs_dev, inode);
 	return error;
     }
@@ -276,6 +278,7 @@
 	sysarg_t	param4;
 };
 
+#ifdef AFS_SGI_EFS_IOPS_ENV
 /* EFS only fs suite uses this entry point - icreate in afssyscalls.c. */
 int
 icreate(struct icreateargs *uap, rval_t *rvp)
@@ -327,6 +330,7 @@
 	iput(newip);
 	return 0;
 }
+#endif /* AFS_SGI_EFS_IOPS_ENV */
 
 #ifdef AFS_SGI_XFS_IOPS_ENV
 /* inode creation routines for icreatename64 entry point. Use for EFS/XFS
@@ -620,6 +624,7 @@
 	if (!vfsp)
 	    return ENXIO;
 
+#ifdef AFS_SGI_EFS_IOPS_ENV
 	if (vfsp->vfs_fstype == efs_fstype) {
 	    struct inode *ip;
 	    if (error = igetinode(vfsp, (dev_t)dev, inode, &ip))
@@ -631,7 +636,9 @@
 	    }
 	    iunlock(ip);
 	}
-	else if (vfsp->vfs_fstype == xfs_fstype) {
+	else 
+#endif /* AFS_SGI_EFS_IOPS_ENV */
+	if (vfsp->vfs_fstype == xfs_fstype) {
 	    struct xfs_inode *xip;
 	    if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip))
 		return error;
@@ -769,6 +776,7 @@
  *
  * XFS/EFS iinc/idec code for EFS. Uses 32 bit inode numbers. 
  */
+#ifdef AFS_SGI_EFS_IOPS_ENV
 static int efs_iincdec(vfsp, inode, inode_p1, amount)
 struct vfs *vfsp;
 int inode, inode_p1, amount;
@@ -796,6 +804,7 @@
     iput(ip);
     return error;
 }
+#endif /* AFS_SGI_EFS_IOPS_ENV */
 
 /* xfs_iincdec
  *
@@ -814,8 +823,8 @@
     int nlink;
     int vol;
     
-    code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED,
-		    &ip, (daddr_t)0);
+    code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), (void*)0, 
+		(xfs_ino_t)inode, XFS_ILOCK_SHARED, &ip, (daddr_t)0);
     if (code)
 	return code;
 
@@ -963,9 +972,11 @@
 	inode |= inode_lo;
 	return xfs_iincdec64(vfsp, inode, inode_p1, amount);
     }
+#ifdef AFS_SGI_EFS_IOPS_ENV
     else if (vfsp->vfs_fstype == efs_fstype) {
 	return efs_iincdec(vfsp, inode_lo, inode_p1, amount);
     }
+#endif /* AFS_SGI_EFS_IOPS_ENV */
     return ENXIO;
 }
 
@@ -1143,7 +1154,8 @@
     inode = inode_hi;
     inode <<= 32;
     inode |= inode_lo;
-    code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode,
+    code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), 
+		    (void*)0, (xfs_ino_t)inode,
 		    XFS_ILOCK_SHARED, &ip, (daddr_t)0);
     if (code)
 	return code;
diff -r -u src.orig/afs/sysincludes.h src/afs/sysincludes.h
--- src.orig/afs/sysincludes.h	Sat Dec  2 18:41:44 2000
+++ src/afs/sysincludes.h	Tue Jan 30 15:47:11 2001
@@ -79,7 +79,10 @@
 #ifdef AFS_SGI64_ENV
 #include <ksys/behavior.h>
 #endif /* AFS_SGI64_ENV */
+#include "../fs/efs_inode.h"
+#ifdef AFS_SGI_EFS_IOPS_ENV
 #include "../sgiefs/efs.h"
+#endif
 #include "../sys/kmem.h"
 #include "../sys/cred.h"
 #include "../sys/resource.h"
diff -r -u src.orig/libafs/MakefileProto.IRIX src/libafs/MakefileProto.IRIX
--- src.orig/libafs/MakefileProto.IRIX	Sat Nov  4 11:05:04 2000
+++ src/libafs/MakefileProto.IRIX	Wed Jan 31 09:53:57 2001
@@ -218,7 +218,7 @@
 	-ln -s /usr/include/sys h
 	-ln -s /usr/include/net /usr/include/netinet .
 	-ln -s /usr/include/rpc /usr/include/sys .
-	-ln -s ../../obj/sgiefs sgiefs
+	-ln -s /usr/include/sys/fs .
 	-mkdir ${DESTDIR}root.client/bin
 	-mkdir ${DESTDIR}root.client/usr/vice/etc/sgiload
 <all -sgi_65>
@@ -342,14 +342,13 @@
 		export CPU_KDEFS ;\
 		export LDFLAGS ;\
 		cd $$dir ; \
-		$(MAKE) IPNO=$$p DESTDIR=../${DESTDIR} $$t.libafs || exit $$?; \
+		$(MAKE) IPNO=$$p DESTDIR=${DESTDIR} $$t.libafs || exit $$?; \
 		cd ../ ; \
 	  done; \
 	done
 <all>
 
 
-LIBAFSA = libafs.a
 LIBAFSNONFSA = libafs.nonfs.a
 COPYFILES = copyfiles
 LINKFILES = linkfiles
@@ -358,46 +357,31 @@
 MODLOADCLIENTDIR = ${DESTDIR}root.client/usr/vice/etc/sgiload
 
 # Make the NFS and no-NFS clients for this directory.
-# STATIC.libafs: ${LIBAFSA} ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
+# STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
 STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
 <all -sgi_65>
-	${CP} ${LIBAFSA} \
-		${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.a
 	${CP} ${LIBAFSNONFSA} \
 		${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.a
 <sgi_65>
-	${CP} ${LIBAFSA} \
-		${STATICCLIENTDIR}/libafs.${IPNO}.a
 	${CP} ${LIBAFSNONFSA} \
 		${STATICCLIENTDIR}/libafs.${IPNO}.nonfs.a
 <all>
 
-${LIBAFSA}: $(AFSAOBJS) $(AFSNFSOBJS)
-	$(AR) cru  $@ $?
-
 ${LIBAFSNONFSA}: $(AFSAOBJS) $(AFSNONFSOBJS)
 	$(AR) cru  $@ $?
 
-LIBAFSO = libafs.o
 LIBAFSNONFSO = libaf.nonfs.o
 
-# MODLOAD.libafs: ${LIBAFSO} ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
+# MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
 MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
 <all -sgi_65>
-	${CP} ${LIBAFSO} \
-		${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.o
 	${CP} ${LIBAFSNONFSO} \
 		${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.o
 <sgi_65>
-	${CP} ${LIBAFSO} \
-		${MODLOADCLIENTDIR}/libafs.${IPNO}.o
 	${CP} ${LIBAFSNONFSO} \
 		${MODLOADCLIENTDIR}/libafs.${IPNO}.nonfs.o
 <all>
 
-${LIBAFSO}: $(AFSAOBJS) $(AFSNFSOBJS)
-	$(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSO} $(AFSAOBJS) $(AFSNFSOBJS)
-	
 
 ${LIBAFSNONFSO}: $(AFSAOBJS) $(AFSNONFSOBJS)
 	$(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSNONFSO} \
diff -r -u src.orig/rx/rx.c src/rx/rx.c
--- src.orig/rx/rx.c	Fri Jan 19 10:37:54 2001
+++ src/rx/rx.c	Wed Jan 31 10:51:51 2001
@@ -455,7 +455,7 @@
 #else
 	struct sockaddr_in addr;
 	int addrlen = sizeof(addr);
-	if (getsockname(rx_socket, (struct sockaddr *) &addr, &addrlen)) {
+	if (getsockname((int)rx_socket, (struct sockaddr *) &addr, &addrlen)) {
 	    rx_Finalize();
 	    return -1;
 	}
diff -r -u src.orig/vol/Makefile src/vol/Makefile
--- src.orig/vol/Makefile	Sat Nov  4 11:06:21 2000
+++ src/vol/Makefile	Mon Jan 29 17:09:57 2001
@@ -81,9 +81,6 @@
                 *linux* ) \
                         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
 				${LIBS}  ;; \
-                sgi_* ) \
-                        ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
-				${LIBS} ../sgiefs/libefs.a ;; \
                 *) \
                         ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
 				${LIBS};; \
diff -r -u src.orig/vol/devname.c src/vol/devname.c
--- src.orig/vol/devname.c	Sat Nov  4 11:06:21 2000
+++ src/vol/devname.c	Mon Jan 29 17:18:00 2001
@@ -54,8 +54,10 @@
 #if defined(AFS_SGI_ENV)
 #include <fcntl.h>
 #include <mntent.h>
-#include "../sgiefs/efs.h"
+#ifdef AFS_SGI_EFS_IOPS_ENV
 #define ROOTINO EFS_ROOTINO
+#include "../sgiefs/efs.h"
+#endif
 #else
 #ifdef AFS_LINUX22_ENV
 #include <mntent.h>
diff -r -u src.orig/vol/listinodes.c src/vol/listinodes.c
--- src.orig/vol/listinodes.c	Sat Nov  4 11:06:23 2000
+++ src/vol/listinodes.c	Mon Jan 29 17:07:56 2001
@@ -417,6 +417,7 @@
 /* libefs.h includes <assert.h>, which we don't want */
 #define	__ASSERT_H__
 
+#ifdef AFS_SGI_EFS_IOPS_ENV
 #include "../sgiefs/libefs.h"
 extern int Log();
 
@@ -606,6 +607,7 @@
 
 	return err;
 }
+#endif /* AFS_SGI_EFS_IOPS_ENV */
 
 #ifdef AFS_SGI_XFS_IOPS_ENV
 #include <dirent.h>
@@ -1022,7 +1024,9 @@
 	int ninodes = 0, err = 0;
 	struct efs_dinode *dinodeBuf = NULL;
 	int last_cgno;
+#ifdef AFS_SGI_EFS_IOPS_ENV
 	EFS_MOUNT *mp;
+#endif
 	ino_t	imax, inum;	/* total number of I-nodes in file system */
 
 	*forcep = 0;
@@ -1044,14 +1048,17 @@
 	}
 	else
 #endif
-	{
-	    if (root_inode.st_ino != EFS_ROOTINO) {
-		Log("%s is not root of a filesystem\n", mountedOn);
-		return -1;
-	    }
+#ifdef AFS_SGI_EFS_IOPS_ENV
+	if (root_inode.st_ino == EFS_ROOTINO) {
 	    return efs_ListViceInodes(devname, mountedOn, resultFile,
 				     judgeInode, judgeParam,
 				     forcep, forceR, wpath);
+	}
+	else 
+#endif
+	{
+	    Log("%s is not root of a filesystem\n", mountedOn);
+	    return -1;
 	}
 }
 
diff -r -u src.orig/vol/volume.c src/vol/volume.c
--- src.orig/vol/volume.c	Fri Jan 19 10:06:02 2001
+++ src/vol/volume.c	Mon Jan 29 17:16:26 2001
@@ -72,13 +72,11 @@
 #if defined(AFS_SGI_ENV)
 #include <fcntl.h>
 #include <mntent.h>
-#ifndef AFS_SGI_XFS_IOPS_ENV
+#ifdef AFS_SGI_EFS_IOPS_ENV
 #define ROOTINO EFS_ROOTINO
-#endif
-/*
 #include <sys/fs/efs.h>
-*/
-#include "../sgiefs/efs.h" /* until 5.1 release */
+#include "../sgiefs/efs.h" /* until 5.1 release */ 
+#endif
 
 #else
 #ifndef AFS_LINUX20_ENV
diff -r -u src.orig/vol/xfs_size_check.c src/vol/xfs_size_check.c
--- src.orig/vol/xfs_size_check.c	Sat Nov  4 11:06:29 2000
+++ src/vol/xfs_size_check.c	Mon Jan 29 17:15:01 2001
@@ -19,7 +19,9 @@
 #include <fcntl.h>
 #include <mntent.h>
 #include "partition.h"
+#ifdef AFS_SGI_EFS_IOPS_ENV
 #include "../sgiefs/efs.h"
+#endif
 #include <afs/xfsattrs.h>
 
 char *prog = "xfs_size_check";
diff -r -u src.orig/volser/Makefile src/volser/Makefile
--- src.orig/volser/Makefile	Sat Nov  4 11:06:31 2000
+++ src/volser/Makefile	Mon Jan 29 17:25:04 2001
@@ -107,10 +107,6 @@
                 *linux*) \
                         ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \
 				${LDFLAGS} $(LIBS) ${XLIBS} ;; \
-                sgi_*) \
-                        ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \
-				${LDFLAGS} $(LIBS) ${XLIBS} \
-				../sgiefs/libefs.a ;; \
                 *) \
                         ${CC} ${DBUG} -g -o volserver $(SOBJS) $(HACKS) \
 				${LDFLAGS} $(LIBS) ${XLIBS} ;; \

--------------9ED0C27F2314BC0FCA3F6845
Content-Type: text/plain; charset=us-ascii;
 name="diffs.x_ubik"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diffs.x_ubik"

diff -r -u src.orig/auth/cellconfig.c src/auth/cellconfig.c
--- src.orig/auth/cellconfig.c	Wed Dec 13 22:49:19 2000
+++ src/auth/cellconfig.c	Thu Jan 25 17:34:42 2001
@@ -407,7 +407,11 @@
 		return -1;
 	    }
 	    i = curEntry->cellInfo.numServers;
+#ifdef X_UBIK
+            code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i], &curEntry->cellInfo.isClone[i]);
+#else /* X_UBIK */
 	    code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i]);
+#endif /* X_UBIK */
 	    if (code) {
 		if (code == AFSCONF_SYNTAX) {
 		    for (bp=tbuffer; *bp != '\n'; bp++) {	/* Take out the <cr> from the buffer */
@@ -443,14 +447,30 @@
  *"128.2.1.3	#hostname"
  * into the appropriate pieces.  
  */
+#ifdef X_UBIK
+static ParseHostLine(aline, addr, aname, aclone)
+    char *aclone;
+#else /* X_UBIK */
 static ParseHostLine(aline, addr, aname)
-register struct sockaddr_in *addr;
-char *aline, *aname; {
+#endif /* X_UBIK */
+    register struct sockaddr_in *addr;
+    char *aline, *aname; 
+{
     int c1, c2, c3, c4;
     register afs_int32 code;
     register char *tp;
 
-    code = sscanf(aline, "%d.%d.%d.%d #%s", &c1, &c2, &c3, &c4, aname);
+#ifdef X_UBIK
+    if (*aline == '[') {
+        *aclone = 1;
+        code = sscanf(aline, "[%d.%d.%d.%d] #%s", &c1, &c2, &c3, &c4, aname);
+    } else {
+        *aclone = 0;
+#endif /* X_UBIK */ 
+        code = sscanf(aline, "%d.%d.%d.%d #%s", &c1, &c2, &c3, &c4, aname);
+#ifdef X_UBIK
+    }
+#endif /* X_UBIK */
     if (code != 5) return AFSCONF_SYNTAX;
     addr->sin_family = AF_INET;
     addr->sin_port = 0;
diff -r -u src.orig/auth/writeconfig.c src/auth/writeconfig.c
--- src.orig/auth/writeconfig.c	Sat Nov  4 11:03:57 2000
+++ src/auth/writeconfig.c	Thu Jan 25 17:36:02 2001
@@ -121,6 +121,11 @@
 	code = acellInfo->hostAddr[i].sin_addr.s_addr;	/* net order */
 	if (code == 0) continue;    /* delete request */
 	code = ntohl(code);	/* convert to host order */
+#ifdef X_UBIK
+        if (acellInfo->isClone[i])
+            fprintf(tf, "[%d.%d.%d.%d]  #%s\n", (code>>24) & 0xff, (code>>16)&0xff, (code>>8)&0xff, code&0xff, acellInfo->hostName[i]);
+        else
+#endif /* X_UBIK */
 	fprintf(tf, "%d.%d.%d.%d    #%s\n", (code>>24) & 0xff, (code>>16)&0xff, (code>>8)&0xff, code&0xff, acellInfo->hostName[i]);
     }
     if (ferror(tf)) {
diff -r -u src.orig/bozo/bosoprocs.c src/bozo/bosoprocs.c
--- src.orig/bozo/bosoprocs.c	Sat Nov  4 11:03:59 2000
+++ src/bozo/bosoprocs.c	Thu Jan 25 17:40:37 2001
@@ -404,8 +404,18 @@
     }
     
     tp = tcell.hostName[awhich];
+#ifdef X_UBIK
+    *aname = (char *) malloc(strlen(tp)+3);
+    if (tcell.isClone[awhich]) {
+        strcpy(*aname, "[");
+        strcat(*aname, tp);
+        strcat(*aname, "]");
+    } else
+        strcpy(*aname, tp);
+#else /* X_UBIK */
     *aname = (char *) malloc(strlen(tp)+1);
     strcpy(*aname, tp);
+#endif /* X_UBIK */
     goto done;
     
 fail:
@@ -466,6 +476,10 @@
     afs_int32 which;
     register int i;
     char caller[MAXKTCNAMELEN];
+#ifdef X_UBIK
+    char *n;
+    char isClone = 0;
+#endif /* X_UBIK */
 
     if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
       code = BZACCESS;
@@ -478,9 +492,21 @@
     if (code) 
       goto fail;
 
+#ifdef X_UBIK
+    n = aname;
+    if (*n == '[') {
+        *(n + strlen(n) -1) = 0;
+        ++n;
+        isClone = 1;
+    }
+#endif /* X_UBIK */
     which = -1;
     for(i=0;i<tcell.numServers;i++) {
+#ifdef X_UBIK
+        if (strcmp(tcell.hostName[i], n) == 0) {
+#else /* X_UBIK */
 	if (strcmp(tcell.hostName[i], aname) == 0) {
+#endif /* X_UBIK */
 	    which = i;
 	    break;
 	}
@@ -513,6 +539,9 @@
 
     bzero(&tcell.hostAddr[which], sizeof(struct sockaddr_in));
     strcpy(tcell.hostName[which], aname);
+#ifdef X_UBIK
+    tcell.isClone[which] = isClone;
+#endif /* X_UBIK */
     code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
 
   fail:
diff -r -u src.orig/kauth/kaserver.c src/kauth/kaserver.c
--- src.orig/kauth/kaserver.c	Sat Nov  4 11:04:39 2000
+++ src/kauth/kaserver.c	Thu Jan 25 17:49:25 2001
@@ -156,6 +156,9 @@
     int	  servers;
     int	  initFlags;
     int   level;			/* security level for Ubik */
+#ifdef X_UBIK
+    afs_int32 i;
+#endif /* X_UBIK */
 
     struct rx_service *tservice;
     struct rx_securityClass *sca[1];
@@ -282,15 +285,29 @@
     OpenLog(AFSDIR_SERVER_KALOG_FILEPATH); 
     SetupLogSignals();
 #endif
+#ifdef X_UBIK
+    code = afsconf_GetCellInfo (KA_conf, cell, AFSCONF_KAUTHSERVICE,
+                                    &cellinfo);
+#endif /* X_UBIK */
     if (servers) {
 	if (code = ubik_ParseServerList(argc, argv, &myHost, serverList)) {
 	    com_err(whoami, code, "Couldn't parse server list");
 	    exit(1);
 	}
+#ifdef X_UBIK
+        cellinfo.hostAddr[0].sin_addr.s_addr = myHost;
+        for (i=1; i<MAXSERVERS; i++) {
+            if (!serverList[i]) break;
+            cellinfo.hostAddr[i].sin_addr.s_addr = serverList[i];
+        }
+        cellinfo.numServers = i;
+#endif /* X_UBIK */
     }
     else {
+#ifndef X_UBIK
 	code = afsconf_GetCellInfo (KA_conf, cell, AFSCONF_KAUTHSERVICE,
 				    &cellinfo);
+#endif /* X_UBIK */
 	code = convert_cell_to_ubik (&cellinfo, &myHost, serverList);
 	if (code) goto abort;
 	ViceLog (0, ("Using server list from %s cell database.\n", cell));
@@ -313,8 +330,13 @@
     ubik_CheckRXSecurityRock = (char *)KA_conf;
 
     ubik_nBuffers = 80;
+#ifdef X_UBIK
+    code = ubik_ServerInit (myHost, htons(AFSCONF_KAUTHPORT), &cellinfo,
+                            dbpath, &KA_dbase);
+#else /* X_UBIK */
     code = ubik_ServerInit (myHost, htons(AFSCONF_KAUTHPORT), serverList,
 			    dbpath, &KA_dbase);
+#endif /* X_UBIK */
     if (code) {
 	com_err(whoami, code, "Ubik init failed");
 	exit(2);
diff -r -u src.orig/ptserver/ptserver.c src/ptserver/ptserver.c
--- src.orig/ptserver/ptserver.c	Sat Nov  4 11:05:25 2000
+++ src/ptserver/ptserver.c	Thu Jan 25 17:43:14 2001
@@ -64,7 +64,9 @@
   char **argv;
 {
     register afs_int32 code;
+#ifndef X_UBIK
     afs_int32 serverList[MAXSERVERS];
+#endif /* X_UBIK */
     afs_int32 myHost;
     register struct hostent *th;
     char hostname[64];
@@ -197,10 +199,12 @@
     pr_realmName = info.name;
     pr_realmNameLen = strlen (pr_realmName);
 
+#ifndef X_UBIK
     for (i=0,j=0;i<info.numServers;i++)
 	if (info.hostAddr[i].sin_addr.s_addr != myHost) /* ubik already tacks myHost onto list */
 	    serverList[j++] = info.hostAddr[i].sin_addr.s_addr;
     serverList[j] = 0;
+#endif /* X_UBIK */
 
 #if 0
     /* get keys */
@@ -234,8 +238,13 @@
      * and the header are in separate Ubik buffers then 120 buffers may be
      * required. */
     ubik_nBuffers = 120 + /*fudge*/40;
+#ifdef X_UBIK
+    code = ubik_ServerInit(myHost, htons(AFSCONF_PROTPORT), &info,
+                           pr_dbaseName, &dbase);
+#else /* X_UBIK */
     code = ubik_ServerInit(myHost, htons(AFSCONF_PROTPORT), serverList,
 			   pr_dbaseName, &dbase);
+#endif /* X_UBIK */
     if (code) {
 	com_err (whoami, code, "Ubik init failed");
 	PT_EXIT(2);
diff -r -u src.orig/ubik/beacon.c src/ubik/beacon.c
--- src.orig/ubik/beacon.c	Sat Nov  4 11:05:52 2000
+++ src/ubik/beacon.c	Thu Jan 25 17:17:04 2001
@@ -24,6 +24,9 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rx_multi.h>
+#ifdef X_UBIK
+#include <afs/cellconfig.h>
+#endif /* X_UBIK */
 #ifndef AFS_NT40_ENV
 #include <afs/afsutil.h>
 #include <afs/netutils.h>
@@ -38,6 +41,9 @@
 int ubik_amSyncSite = 0;	    /* flag telling if I'm sync site */
 static nServers;		    /* total number of servers */
 static char amIMagic=0;		    /* is this host the magic host */
+#ifdef X_UBIK
+char amIClone=0;                    /* is this a clone which doesn't vote */
+#endif /* X_UBIK */
 extern struct rx_securityClass *rxnull_NewClientSecurityObject();
 int (*ubik_CRXSecurityProc)();
 char *ubik_CRXSecurityRock;
@@ -91,11 +97,19 @@
     register afs_int32 rcode;
     
     /* special case for fast startup */
+#ifdef X_UBIK
+    if (nServers == 1 && !amIClone) {
+#else /* X_UBIK */
     if (nServers == 1) {
+#endif /* X_UBIK */
 	return 1;	/* one guy is always the sync site */
     }
 
+#ifdef X_UBIK
+    if (ubik_amSyncSite == 0 || amIClone) rcode = 0;  /* if I don't think I'm the sync site, say so */
+#else /* X_UBIK */
     if (ubik_amSyncSite == 0) rcode = 0;  /* if I don't think I'm the sync site, say so */
+#endif /* X_UBIK */
     else {
 	now = FT_ApproxTime();
 	if (syncSiteUntil <= now) {	    /* if my votes have expired, say so */
@@ -127,17 +141,31 @@
  * is sync site.  Without the magic host hack, if anyone crashed in a 2
  * site system, we'd be out of business.
  */
+#ifdef X_UBIK
+ubeacon_InitServerList(ame, info)
+    struct afsconf_cell *info;
+#else /* X_UBIK */
 ubeacon_InitServerList(ame, aservers)
+    register afs_int32 aservers[];
+#endif /* X_UBIK */
     afs_int32 ame;
-    register afs_int32 aservers[]; {
+{
     register struct ubik_server *ts;
+#ifdef X_UBIK
+    afs_int32 me = -1;
+#else /* X_UBIK */
     register afs_int32 servAddr;
+#endif /* X_UBIK */
     register afs_int32 i, code;
     afs_int32 magicHost;
     struct ubik_server *magicServer;
 
     /* verify that the addresses passed in are correct */
+#ifdef X_UBIK
+    if ( code = verifyInterfaceAddress(&mhost, info))
+#else /* X_UBIK */
     if ( code = verifyInterfaceAddress(&ame, aservers ))
+#endif /* X_UBIK */
 	return code;
 
     /* get the security index to use, if we can */
@@ -150,28 +178,70 @@
 	ubikSecIndex = 0;
 	ubikSecClass = rxnull_NewClientSecurityObject();
     }
-    i = 0;
     magicHost =	ntohl(ame);	/* do comparisons in host order */
     magicServer = (struct ubik_server *) 0;
+
+#ifdef X_UBIK
+    for (i = 0; i < info->numServers; i++) {
+        if (ntohl((afs_uint32) info->hostAddr[i].sin_addr.s_addr) ==
+                                                ntohl((afs_uint32) ame)) {
+            me = i;
+            if (info->isClone[i]) {
+                amIClone = 1;
+                magicHost = 0;
+            }
+        }
+    }
+    nServers = 0;
+    for (i = 0; i < info->numServers; i++) {
+        if (i == me) continue;
+#else /* X_UBIK */
+    i = 0;
     while (servAddr = *aservers++) {
 	if (i >= MAXSERVERS) return UNHOSTS;	    /* too many hosts */
+#endif /* X_UBIK */
 	ts = (struct ubik_server *) malloc(sizeof(struct ubik_server));
 	bzero(ts, sizeof(struct ubik_server));
 	ts->next = ubik_servers;
 	ubik_servers = ts;
+#ifdef X_UBIK
+        ts->addr[0] = info->hostAddr[i].sin_addr.s_addr;
+        if (info->isClone[i]) {
+            ts->isClone = 1;
+        } else {
+            if (!magicHost || ntohl((afs_uint32) ts->addr[0]) < (afs_uint32) magicHost) {
+                magicHost = ntohl(ts->addr[0]);
+                magicServer = ts;
+            }
+            ++nServers;
+        }
+#else /* X_UBIK */
 	ts->addr[0] = servAddr;	/* primary address in  net byte order */
+#endif /* X_UBIK */
 	ts->vote_rxcid = rx_NewConnection(servAddr, ubik_callPortal, VOTE_SERVICE_ID, ubikSecClass, ubikSecIndex);	/* for vote reqs */
 	ts->disk_rxcid = rx_NewConnection(servAddr, ubik_callPortal, DISK_SERVICE_ID, ubikSecClass, ubikSecIndex);	/* for disk reqs */
 	ts->up = 1;
+#ifndef X_UBIK
 	if (ntohl((afs_uint32) servAddr) < (afs_uint32) magicHost) {
 	    magicHost = ntohl(servAddr);
 	    magicServer = ts;
 	}
 	i++;
+#endif /* X_UBIK */
     }
     if (magicServer) magicServer->magic	= 1;	/* remember for when counting votes */
+#ifndef X_UBIK
     else amIMagic = 1;
+#endif /* X_UBIK */
+
+#ifdef X_UBIK
+    if (!amIClone && !magicServer) amIMagic = 1;
+    if (!amIClone) {
+        ++nServers;     /* count this server as well as the remotes */
+    }
+#else /* X_UBIK */
     nServers = i+1;	/* count this server as well as the remotes */
+#endif /* X_UBIK */
     ubik_quorum	= (nServers>>1)+1;	/* compute the majority figure */
 					/* send addrs to all other servers */
     code = updateUbikNetworkAddress(ubik_host);
@@ -182,7 +252,11 @@
     r_retryInterval = 2;	
     r_nRetries = (RPCTIMEOUT/r_retryInterval);
 */
+#ifdef X_UBIK
+    if (!ubik_servers) {                /* special case 1 server */
+#else /* X_UBIK */
     if (nServers == 1) {    /* special case 1 server */
+#endif /* X_UBIK */
         if (!ubik_amSyncSite) ubik_dprint("Ubik: I am the sync site - 1 server\n");
 	ubik_amSyncSite = 1;
 	syncSiteUntil =	0x7fffffff; /* quite a while */
@@ -222,7 +296,11 @@
 
 	lastWakeupTime = FT_ApproxTime();   /* started a new collection phase */
 
+#ifdef X_UBIK
+        if (!ubik_servers) continue;    /* special-case 1 server for speedy startup */
+#else /* X_UBIK */
 	if (nServers ==	1) continue;	/* special-case 1 server for speedy startup */
+#endif /* X_UBIK */
 
 	if (!uvote_ShouldIRun()) continue;  /* if voter has heard from a better candidate than us, don't bother running */
 
@@ -233,7 +311,11 @@
 	    prepare to send them an r multi-call containing the beacon message */
 	i = 0;	    /* collect connections */
 	for(ts = ubik_servers; ts; ts=ts->next) {
-	    if (ts->up && ts->addr[0] != ubik_host[0]) {
+#ifdef X_UBIK
+            if (ts->up) {
+#else /* X_UBIK */
+            if (ts->up && ts->addr[0] != ubik_host[0]) {
+#endif /* X_UBIK */
 		servers[i] = ts;
 		connections[i++] = ts->vote_rxcid;
 	    }
@@ -279,6 +361,9 @@
 		    ts->lastVoteTime = code;
 		    if (code < oldestYesVote) oldestYesVote = code;
 		    ts->lastVote = 1;
+#ifdef X_UBIK
+                    if (!ts->isClone)
+#endif /* X_UBIK */
 		    yesVotes += 2;
 		    if (ts->magic) yesVotes++;  /* the extra epsilon */
 		    ts->up = 1; /* server is up (not really necessary: recovery does this for real) */
@@ -340,16 +425,25 @@
 *
 * Return Values : 0 on success, non-zero on failure
 */
+#ifdef X_UBIK
+verifyInterfaceAddress(ame, info)
+struct afsconf_cell *info;
+#else /* X_UBIK */
 verifyInterfaceAddress(ame, aservers)
-afs_uint32 *ame;		/* one of my interface addr in net byte order */
 afs_uint32 aservers[]; 	/* list of all possible server addresses */
+#endif /* X_UBIK */
+afs_uint32 *ame;		/* one of my interface addr in net byte order */
 {
     afs_uint32	myAddr[UBIK_MAX_INTERFACE_ADDR], *servList;
     int 	count, index, found, i, j, totalServers, start, end;
 
+#ifdef X_UBIK
+    totalServers = info->numServers;
+#else /* X_UBIK */
     /* count the number of servers */
     for ( totalServers=0, servList = aservers; *servList; servList++)
 	totalServers++;
+#endif /* X_UBIK */
 
 #ifdef AFS_NT40_ENV 
     /* for now use getaddr(). use getAllAddr when implemented */
@@ -408,16 +502,23 @@
     for ( j=0, found = 0; j < count; j++)
     {
 	for ( i=0; i < totalServers; i++)
+#ifdef X_UBIK
+            if ( myAddr[j] == ntohl((afs_uint32) info->hostAddr[i].sin_addr.s_addr))
+            {
+                *ame = ntohl((afs_uint32) info->hostAddr[i].sin_addr.s_addr);
+#else /* X_UBIK */
 	    if ( myAddr[j] == aservers[i] ) 	
 	    {
 		*ame = aservers[i];
 		aservers[i]  = 0 ; 
+#endif /* X_UBIK */
 		found = 1;
 	    }
     }
     if ( found )
 	ubik_print("Using %s as my primary address\n", afs_inet_ntoa(*ame) );
 
+#ifndef X_UBIK
     /* get rid of servers which were purged because all 
     ** those interface addresses are myself 
     */
@@ -436,6 +537,7 @@
 	aservers[start] = aservers[end];
 	aservers[end]   = 0;		/* this entry was moved */
     }
+#endif /* X_UBIK */
 	
     /* update all my addresses in ubik_host in such a way 
     ** that ubik_host[0] has the primary address 
diff -r -u src.orig/ubik/recovery.c src/ubik/recovery.c
--- src.orig/ubik/recovery.c	Sat Nov  4 11:05:53 2000
+++ src/ubik/recovery.c	Thu Jan 25 17:18:08 2001
@@ -425,6 +425,9 @@
 	    bestDBVersion.counter = 0;
 	    for(ts=ubik_servers; ts; ts=ts->next) {
 	        if (!ts->up) continue;  /* don't bother with these guys */
+#ifdef X_UBIK
+                if (ts->isClone) continue;
+#endif /* X_UBIK */
 		code = DISK_GetVersion(ts->disk_rxcid, &ts->version);
 		if (code == 0) {
 		    /* perhaps this is the best version */
diff -r -u src.orig/ubik/ubik.c src/ubik/ubik.c
--- src.orig/ubik/ubik.c	Sat Nov  4 11:05:53 2000
+++ src/ubik/ubik.c	Thu Jan 25 16:57:10 2001
@@ -20,6 +20,9 @@
 #include <lock.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
+#ifdef X_UBIK
+#include <afs/cellconfig.h>
+#endif /* X_UBIK */
 
 #define UBIK_INTERNALS
 #include "ubik.h"
@@ -145,6 +148,9 @@
 	    ts->beaconSinceDown = 0;
 	    urecovery_LostServer(); /* tell recovery to try to resend dbase later */
 	} else {            /* success */
+#ifdef X_UBIK
+            if (!ts->isClone)
+#endif /* X_UBIK */
 	    okcalls++;	    /* count up how many worked */
 	    if (aflags & CStampVersion) {
 		ts->version = atrans->dbase->version;
@@ -161,10 +167,15 @@
     Note that the host named by myHost should not also be listed in serverList.
 */
 
+#ifdef X_UBIK
+int ubik_ServerInit(myHost, myPort, info, pathName, dbase)
+    struct afsconf_cell *info;  /* in */
+#else /* X_UBIK */ 
 int ubik_ServerInit(myHost, myPort, serverList, pathName, dbase)
+    afs_int32 serverList[];    /* in */
+#endif /* X_UBIK */ 
     afs_int32 myHost;
     short myPort;
-    afs_int32 serverList[];    /* in */
     char *pathName;	/* in */
     struct ubik_dbase **dbase; /* out */ {
     register struct ubik_dbase *tdb;
@@ -245,7 +256,11 @@
     if (code) return code;
     code = urecovery_Initialize(tdb);
     if (code) return code;
+#ifdef X_UBIK
+    code = ubeacon_InitServerList(myHost, info);
+#else /* X_UBIK */
     code = ubeacon_InitServerList(myHost, serverList);
+#endif /* X_UBIK */
     if (code) return code;
 
     /* now start up async processes */
diff -r -u src.orig/ubik/ubik.p.h src/ubik/ubik.p.h
--- src.orig/ubik/ubik.p.h	Sat Nov  4 11:05:53 2000
+++ src/ubik/ubik.p.h	Thu Jan 25 17:19:23 2001
@@ -248,6 +248,9 @@
     char beaconSinceDown;		/* did beacon get through since last crash? */
     char currentDB;			/* is dbase up-to-date */
     char magic;				/* the one whose vote counts twice */
+#ifdef X_UBIK
+    char isClone;                       /* is only a clone, doesn't vote */
+#endif /* X_UBIK */
 };
 
 /* hold and release functions on a database */
@@ -258,6 +261,9 @@
 
 /* list of all servers in the system */
 extern struct ubik_server *ubik_servers;
+#ifdef X_UBIK
+extern char amIClone;
+#endif /* X_UBIK */
 
 /* network port info */
 extern short ubik_callPortal;
diff -r -u src.orig/ubik/udebug.c src/ubik/udebug.c
--- src.orig/ubik/udebug.c	Sat Nov  4 11:05:54 2000
+++ src/ubik/udebug.c	Thu Jan 25 17:29:37 2001
@@ -86,6 +86,9 @@
     struct ubik_debug udebug;
     struct ubik_sdebug usdebug;
     int		oldServer =0;	/* are we talking to a pre 3.5 server? */
+#ifdef X_UBIK
+    afs_int32 isClone = 0;
+#endif /* X_UBIK */
 
     int32p = (as->parms[2].items ? 1 : 0);
 
@@ -128,7 +131,12 @@
     tconn = rx_NewConnection(hostAddr, port, VOTE_SERVICE_ID, sc, 0);
     
     /* now do the main call */
+#ifdef X_UBIK
+    code = VOTE_XDebug(tconn, &udebug, &isClone);
+    if (code) code = VOTE_Debug(tconn, &udebug);
+#else /* X_UBIK */
     code = VOTE_Debug(tconn, &udebug);
+#endif /* X_UBIK */
     if ( code == RXGEN_OPCODE )	
     {
 	oldServer = 1;			/* talking to a pre 3.5 server */
@@ -205,6 +213,10 @@
 		   udebug.epochTime, udebug.tidCounter);
 	}
     } else {
+#ifdef X_UBIK
+        if (isClone) printf("I am a clone and never can become sync site\n");
+        else
+#endif /* X_UBIK */
 	printf("I am not sync site\n");
 	inhostAddr.s_addr = htonl(udebug.lowestHost);
 	diff = udebug.now - udebug.lowestTime;
@@ -239,6 +251,11 @@
     if (int32p || udebug.amSyncSite) {
 	/* now do the subcalls */
 	for(i=0;;i++) {
+#ifdef X_UBIK
+            isClone = 0;
+            code = VOTE_XSDebug(tconn, i, &usdebug, &isClone);
+            if (code < 0) code = VOTE_SDebug(tconn, i, &usdebug);
+#else /* X_UBIK */
 	    if ( oldServer )
 	    {				/* pre 3.5 server */
 		memset(&usdebug, 0, sizeof(usdebug)); 
@@ -246,6 +263,7 @@
 	    }
 	    else
 		code = VOTE_SDebug(tconn, i, &usdebug);
+#endif /* X_UBIK */ 
 	    if (code > 0) break;	/* done */
 	    if (code < 0) {
 		printf("error code %d from VOTE_SDebug\n", code);
@@ -253,6 +271,13 @@
 	    }
 	    inhostAddr.s_addr = htonl(usdebug.addr);
 	    /* otherwise print the structure */
+#ifdef X_UBIK
+            if (isClone)
+                printf("\nServer %s: (db %d.%d) is a clone\n",
+                   inet_ntoa(inhostAddr),
+                   usdebug.remoteVersion.epoch, usdebug.remoteVersion.counter);
+            else
+#endif /* X_UBIK */
 	    printf("\nServer( %s", afs_inet_ntoa(htonl(usdebug.addr))); 
 	    for ( j=0;((usdebug.altAddr[j]) && 
 				(j<UBIK_MAX_INTERFACE_ADDR-1)); j++)
diff -r -u src.orig/ubik/vote.c src/ubik/vote.c
--- src.orig/ubik/vote.c	Sat Nov  4 11:05:55 2000
+++ src/ubik/vote.c	Thu Jan 25 17:26:30 2001
@@ -172,6 +172,10 @@
     afs_int32 vote;
     struct rx_connection *aconn;
     struct rx_peer *rxp;
+#ifdef X_UBIK
+    struct ubik_server *ts;
+    int isClone = 0;
+#endif /* X_UBIK */
 
     now = FT_ApproxTime();			/* close to current time */
     if (rxcall)	{				/* caller's host */
@@ -188,8 +192,19 @@
 					afs_inet_ntoa(rx_HostOf(rxp)));
                 return 0; /* I don't know about you: vote no */
         }
-    } else
+#ifdef X_UBIK
+        for (ts = ubik_servers; ts; ts = ts->next) {
+            if (ts->addr[0] == otherHost) break;
+        }
+        if (!ts) ubik_dprint("Unknown host %x has sent a beacon\n", otherHost);
+        if (ts && ts->isClone) isClone = 1;
+#endif /* X_UBIK */
+    } else {
 	otherHost = ubik_host[0];			/* this host */
+#ifdef X_UBIK
+        isClone = amIClone;
+#endif /* X_UBIK */
+    }
 
     ubik_dprint("Received beacon type %d from host %s\n", astate, 
 				afs_inet_ntoa(otherHost));
@@ -211,8 +226,16 @@
        seconds, we ignore its presence in lowestHost: it may have crashed.
        Note that we don't ever let anyone appear in our lowestHost if we're
        lower than them, 'cause we know we're up. */
+#ifdef X_UBIK
+    /* But do not consider clones for lowesHost since they never may become
+       sync site */
+    if (!isClone &&
+        (ntohl((afs_uint32) otherHost) <= ntohl((afs_uint32) lowestHost)
+        || lowestTime + BIGTIME < now)) {
+#else /* X_UBIK */
     if (ntohl((afs_uint32) otherHost) <= ntohl((afs_uint32) lowestHost)
 	|| lowestTime + BIGTIME < now) {
+#endif /* X_UBIK */
 	lowestTime = now;
 	lowestHost = otherHost;
     }
@@ -223,8 +246,14 @@
        lowest.  Need to prove: if one guy in the system is lowest and knows
        he's lowest, these loops don't occur.  because if someone knows he's
        lowest, he will send out beacons telling others to vote for him. */
+#ifdef X_UBIK
+    if (!amIClone &&
+        (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost)
+        || lowestTime + BIGTIME < now)) {
+#else /* X_UBIK */
     if (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost)
 	|| lowestTime + BIGTIME < now) {
+#endif /* X_UBIK */
 	lowestTime = now;
 	lowestHost = ubik_host[0];
     }
@@ -265,7 +294,12 @@
 
     /* Don't promise sync site support to more than one host every BIGTIME
        seconds.  This is the heart of our invariants in this system. */
+#ifdef X_UBIK
+    if (!isClone &&
+        (ubik_lastYesTime + BIGTIME < now || otherHost == lastYesHost)) {
+#else /* X_UBIK */
     if (ubik_lastYesTime + BIGTIME < now || otherHost == lastYesHost) {
+#endif /* X_UBIK */
         if ((ubik_lastYesTime+BIGTIME < now) || 
 	    (otherHost != lastYesHost) ||
 	    (lastYesState != astate)) {
@@ -290,7 +324,12 @@
 
 /* handle per-server debug command, where 0 is the first server.  Basic network
    debugging hooks. */
+#ifdef X_UBIK
+SVOTE_XSDebug(rxcall, awhich, aparm, isclone)
+    afs_int32 *isclone;
+#else /* X_UBIK */
 SVOTE_SDebug(rxcall, awhich, aparm)
+#endif /* X_UBIK */
     struct rx_call *rxcall;
     afs_int32 awhich;
     register struct ubik_sdebug *aparm; {
@@ -309,12 +348,38 @@
 	    aparm->up = ts->up;
 	    aparm->beaconSinceDown = ts->beaconSinceDown;
 	    aparm->currentDB = ts->currentDB;
+#ifdef X_UBIK
+            *isclone = ts->isClone;
+#endif /* X_UBIK */ 
 	    return 0;
 	}
     }
     return 2;
 }
 
+#ifdef X_UBIK
+SVOTE_SDebug(rxcall, awhich, aparm)
+    struct rx_call *rxcall;
+    afs_int32 awhich;
+    register struct ubik_sdebug *aparm;
+{
+    afs_int32 code, isClone;
+    code = SVOTE_XSDebug(rxcall, awhich, aparm, &isClone);
+    return code;
+}
+
+SVOTE_XDebug(rxcall, aparm, isclone)
+    struct rx_call *rxcall;
+    register struct ubik_debug *aparm;
+    afs_int32 *isclone;
+{
+    afs_int32 code;
+
+    code = SVOTE_Debug(rxcall, aparm);
+    *isclone = amIClone;
+    return code;
+}
+#endif /* X_UBIK */
 
 /* handle basic network debug command.  This is the global state dumper */
 SVOTE_Debug(rxcall, aparm)
diff -r -u src.orig/vlserver/vlserver.c src/vlserver/vlserver.c
--- src.orig/vlserver/vlserver.c	Wed Dec 13 22:50:57 2000
+++ src/vlserver/vlserver.c	Thu Jan 25 17:46:22 2001
@@ -106,7 +106,9 @@
 char	**argv;
 {
     register afs_int32   code;
+#ifndef X_UBIK
     afs_int32	    serverList[MAXSERVERS];
+#endif /* X_UBIK */
     afs_int32		    myHost;
     struct rx_service	    *tservice;
     struct rx_securityClass *sc[3];
@@ -219,10 +221,12 @@
 	printf("vlserver: Couldn't get cell server list for 'afsvldb'.\n");
 	exit(2);
     }
+#ifndef X_UBIK
     for (index=0,i = 0;index<info.numServers;index++)
 	if (info.hostAddr[index].sin_addr.s_addr != myHost) /* ubik already tacks myHost onto list */
 	    serverList[i++] = info.hostAddr[index].sin_addr.s_addr;
      serverList[i] = 0;
+#endif /* X_UBIK */
 
     vldb_confdir = tdir;		/* Preserve our configuration dir */
     /* rxvab no longer supported */
@@ -237,7 +241,12 @@
     ubik_SRXSecurityRock = (char *) tdir;
     ubik_CheckRXSecurityProc = afsconf_CheckAuth;
     ubik_CheckRXSecurityRock = (char *) tdir;
+#ifdef X_UBIK
+    code = ubik_ServerInit(myHost, htons(AFSCONF_PROTPORT), &info,
+                           pr_dbaseName, &dbase);
+#else /* X_UBIK */
     code = ubik_ServerInit(myHost, htons(AFSCONF_VLDBPORT), serverList, vl_dbaseName, &VL_dbase);
+#endif /* X_UBIK */
     if (code) {
 	printf("vlserver: Ubik init failed with code %d\n",code);
 	exit(2);

--------------9ED0C27F2314BC0FCA3F6845
Content-Type: text/plain; charset=us-ascii;
 name="diffs.mrafs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diffs.mrafs"

diff -r -u src.orig/afs/afs_pioctl.c src/afs/afs_pioctl.c
--- src.orig/afs/afs_pioctl.c	Fri Jan 19 10:52:21 2001
+++ src/afs/afs_pioctl.c	Tue Jan 23 17:53:28 2001
@@ -61,6 +61,7 @@
 static int PGetCPrefs(), PSetCPrefs(); /* client network addresses */
 static int PGetInitParams(), PFlushMount(), PRxStatProc(), PRxStatPeer();
 static int PGetRxkcrypt(), PSetRxkcrypt();
+static int PPrefetchFromTape(), PResidencyCmd();
 int PExportAfs();
 
 static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCRED **acred, struct AFS_UCRED *credp);
@@ -134,6 +135,8 @@
   PNoop,			/* 63 -- arla: print xfs status */
   PNoop,			/* 64 -- arla: force cache check */
   PNoop,			/* 65 -- arla: break callback */
+  PPrefetchFromTape,            /* 66 - MR-AFS prefetch file from tape */
+  PResidencyCmd,                /* 67 - MR-AFS generic commnd interface */
 };
 
 #define PSetClientContext 99	/*  Special pioctl to setup caller's creds  */
@@ -3555,3 +3558,163 @@
     return code;
 }
 
+static PPrefetchFromTape(avc, afun, areq, ain, aout, ainSize, aoutSize)
+  struct vcache *avc;
+  int afun;
+  struct vrequest *areq;
+  char *ain, *aout;
+  afs_int32 ainSize;
+  afs_int32 *aoutSize;  /* set this */
+{
+    register afs_int32 code, code1;
+    afs_int32 bytes;
+    struct conn *tc;
+    struct rx_call *tcall;
+    struct AFSVolSync tsync;
+    struct AFSFetchStatus OutStatus;
+    struct AFSCallBack CallBack;
+    struct VenusFid tfid;
+    struct AFSFid *Fid;
+    struct vcache *tvc;
+    XSTATS_DECLS;
+
+    AFS_STATCNT(PSetAcl);
+    if (!avc)
+      return EINVAL;
+
+    if (ain && (ainSize == 3 * sizeof(afs_int32)))
+        Fid = (struct AFSFid *) ain;
+    else
+        Fid = &avc->fid.Fid;
+    tfid.Cell = avc->fid.Cell;
+    tfid.Fid.Volume = Fid->Volume;
+    tfid.Fid.Vnode = Fid->Vnode;
+    tfid.Fid.Unique = Fid->Unique;
+
+    tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache *)0,
+                                WRITE_LOCK);
+    if (!tvc) {
+        afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD,
+                ICL_TYPE_POINTER, tvc,
+                ICL_TYPE_FID, &tfid,
+                ICL_TYPE_FID, &avc->fid);
+        return ENOENT;
+    }
+    afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD,
+                ICL_TYPE_POINTER, tvc,
+                ICL_TYPE_FID, &tfid,
+                ICL_TYPE_FID, &tvc->fid);
+
+    do {
+        tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
+        if (tc) {
+
+#ifdef RX_ENABLE_LOCKS
+            AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+            tcall = rx_NewCall(tc->id);
+            code = StartRXAFS_FetchData(tcall,
+                                (struct AFSFid *) &tvc->fid.Fid, 0, 0);
+            if (!code) {
+                bytes = rx_Read(tcall, (char *) aout, sizeof(afs_int32));
+                code = EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync);
+            }
+            code1 = rx_EndCall(tcall, code);
+#ifdef RX_ENABLE_LOCKS
+            AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+        } else
+            code = -1;
+    } while
+        (afs_Analyze(tc, code, &tvc->fid, areq, 
+		AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, 
+		(struct cell *)0));
+    /* This call is done only to have the callback things handled correctly */
+    afs_FetchStatus(tvc, &tfid, areq, &OutStatus);
+    afs_PutVCache(tvc, WRITE_LOCK);
+
+    if (!code) {
+        *aoutSize = sizeof(afs_int32);
+    }
+    return code;
+}
+
+static PResidencyCmd(avc, afun, areq, ain, aout, ainSize, aoutSize)
+struct vcache *avc;
+int afun;
+struct vrequest *areq;
+char *ain, *aout;
+afs_int32 ainSize;
+afs_int32 *aoutSize;        /* set this */
+{
+    register afs_int32 code;
+    struct conn *tc;
+    struct vcache *tvc;
+    struct ResidencyCmdInputs *Inputs;
+    struct ResidencyCmdOutputs *Outputs;
+    struct VenusFid tfid;
+    struct AFSFid *Fid;
+
+    Inputs = (struct ResidencyCmdInputs *) ain;
+    Outputs = (struct ResidencyCmdOutputs *) aout;
+    if (!avc) return EINVAL;
+    if (!ain || ainSize != sizeof(struct ResidencyCmdInputs)) return EINVAL;
+
+    Fid = &Inputs->fid;
+    if (!Fid->Volume)
+        Fid = &avc->fid.Fid;
+
+    tfid.Cell = avc->fid.Cell;
+    tfid.Fid.Volume = Fid->Volume;
+    tfid.Fid.Vnode = Fid->Vnode;
+    tfid.Fid.Unique = Fid->Unique;
+
+    tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache *)0,
+                                WRITE_LOCK);
+    afs_Trace3(afs_iclSetp, CM_TRACE_RESIDCMD,
+                ICL_TYPE_POINTER, tvc,
+                ICL_TYPE_INT32, Inputs->command,
+                ICL_TYPE_FID, &tfid);
+    if (!tvc)
+        return ENOENT;
+
+    if (Inputs->command) {
+        do {
+            tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
+            if (tc) {
+#ifdef RX_ENABLE_LOCKS
+                AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+                code = RXAFS_ResidencyCmd(tc->id, Fid,
+                                 Inputs,
+                                 (struct ResidencyCmdOutputs *) aout);
+#ifdef RX_ENABLE_LOCKS
+                AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+            } else
+                code = -1;
+        } while
+          (afs_Analyze(tc, code, &tvc->fid, areq, 
+		AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK,
+                (struct cell *)0));
+       /* This call is done to have the callback things handled correctly */
+       afs_FetchStatus(tvc, &tfid, areq, &Outputs->status);
+    } else { /* just a status request, return also link data */
+        code = 0;
+        Outputs->code = afs_FetchStatus(tvc, &tfid, areq, &Outputs->status);
+        Outputs->chars[0] = 0;
+        if (vType(tvc) == VLNK) {
+            ObtainWriteLock(&tvc->lock,555);
+            if (afs_HandleLink(tvc, areq) == 0)
+                strncpy((char *) &Outputs->chars, tvc->linkData, MAXCMDCHARS);
+            ReleaseWriteLock(&tvc->lock);
+        }
+    }
+
+    afs_PutVCache(tvc, WRITE_LOCK);
+
+    if (!code) {
+        *aoutSize = sizeof(struct ResidencyCmdOutputs);
+    }
+    return code;
+}                                  
diff -r -u src.orig/afs/afs_stats.h src/afs/afs_stats.h
--- src.orig/afs/afs_stats.h	Sat Nov  4 11:03:14 2000
+++ src/afs/afs_stats.h	Mon Jan 22 19:16:32 2001
@@ -838,6 +838,7 @@
 #define AFS_STATS_FS_RPCIDX_XSTATSVERSION	26
 #define AFS_STATS_FS_RPCIDX_GETXSTATS		27
 #define AFS_STATS_FS_RPCIDX_XLOOKUP             28
+#define AFS_STATS_FS_RPCIDX_RESIDENCYRPCS       29
 
 #define AFS_STATS_NUM_FS_RPC_OPS		29
 
diff -r -u src.orig/afs/afs_trace.et src/afs/afs_trace.et
--- src.orig/afs/afs_trace.et	Sat Nov  4 11:03:14 2000
+++ src/afs/afs_trace.et	Mon Jan 22 19:18:20 2001
@@ -127,5 +127,7 @@
 	ec	CM_TRACE_READPAGE, "Ireadpage ip 0x%lx pp 0x%x count 0x%x code %x"
 	ec	CM_TRACE_UPDATEPAGE, "Iupdatepage ip 0x%lx pp 0x%x count 0x%x code %d"
 	ec	CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d"
+	ec      CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)"
+	ec      CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)"
 end
 
diff -r -u src.orig/config/param.i386_linux22.h src/config/param.i386_linux22.h
--- src.orig/config/param.i386_linux22.h	Sat Nov  4 11:04:23 2000
+++ src/config/param.i386_linux22.h	Tue Jan 23 15:09:54 2001
@@ -25,6 +25,7 @@
 
 #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
 #define AFS_SYSCALL 137
+#define AFS_64BIT_ENV
 #define AFS_64BIT_IOPS_ENV  1
 #define AFS_NAMEI_ENV     1   /* User space interface to file system */
 #include <afs/afs_sysnames.h>
diff -r -u src.orig/config/stds.h src/config/stds.h
--- src.orig/config/stds.h	Sat Nov  4 11:04:25 2000
+++ src/config/stds.h	Tue Jan 23 15:18:01 2001
@@ -55,10 +55,49 @@
 #ifdef  AFS_64BIT_ENV
 typedef int              afs_int32;
 typedef unsigned int     afs_uint32;
+typedef long long 	 afs_int64;
+typedef  unsigned long long afs_uint64;
+ #define ZeroInt64(a)       (a) = 0
+ #define AssignInt64(a, b)   *(a) = (b)
+ #define AddInt64(a,b,c) *(c) = (a) + (b)
+ #define SubtractInt64(a,b,c) *(c) = (a) - (b)
+ #define CompareInt64(a,b) (a) - (b)
+ #define NonZeroInt64(a)                (a)
+ #define Int64ToInt32(a)    (a) & 0xFFFFFFFFL
+ #define FillInt64(t,h,l) (t) = (h); (t) <<= 32; (t) |= (l);
+ #define SplitInt64(t,h,l) (h) = (t) >> 32; (l) = (t) & 0xFFFFFFFF;
 #else   /* AFS_64BIT_ENV */
 typedef long             afs_int32;
 typedef unsigned long    afs_uint32;
+
+ struct Int64 {
+    afs_int32 high;
+    afs_uint32 low;
+ };
+ typedef struct Int64 afs_int64;
+
+ struct u_Int64 {
+    afs_uint32 high;
+    afs_uint32 low;
+ };
+ typedef struct u_Int64 afs_uint64;
+ #define ZeroInt64(a) (a).high = (a).low = 0
+ #define AssignInt64(a, b) (b)->high = (a).high; (b)->low = (a).low
+ #define NonZeroInt64(a)   (a).low || (a).high
+ #define Int64ToInt32(a)    (a).low
+ #define FillInt64(t,h,l) (t).high = (h); (t).low = (l);
+ #define SplitInt64(t,h,l) (h) = (t).high; (l) = (t).low;
 #endif  /* AFS_64BIT_ENV */
+
+/* AFS_64BIT_CLIENT should presently be set only for AFS_64BIT_ENV systems */
+
+#ifdef AFS_64BIT_CLIENT
+typedef afs_int64 afs_size_t;
+typedef afs_uint64 afs_offs_t;
+#else /* AFS_64BIT_CLIENT */
+typedef afs_int32 afs_size_t;
+typedef afs_uint32 afs_offs_t;
+#endif /* AFS_64BIT_CLIENT */
 
 /* you still have to include <netinet/in.h> to make these work */
 
diff -r -u src.orig/config/venus.h src/config/venus.h
--- src.orig/config/venus.h	Fri Jan 19 10:55:45 2001
+++ src/config/venus.h	Mon Jan 22 18:06:24 2001
@@ -176,5 +176,6 @@
 #define VIOC_RXSTAT_PEER	_VICEIOCTL(54)	/* Control peer RX stats */
 #define VIOC_GETRXKCRYPT        _VICEIOCTL(55)  /* Set rxkad enc flag */
 #define VIOC_SETRXKCRYPT        _VICEIOCTL(56)  /* Set rxkad enc flag */
-
+#define VIOC_PREFETCHTAPE       _VICEIOCTL(66)  /* MR-AFS prefetch from tape */
+#define VIOC_RESIDENCY_CMD      _VICEIOCTL(67)  /* generic MR-AFS cmds */
 #endif /* AFS_VENUS_H */
diff -r -u src.orig/fsint/afsint.xg src/fsint/afsint.xg
--- src.orig/fsint/afsint.xg	Sat Nov  4 11:04:30 2000
+++ src/fsint/afsint.xg	Mon Jan 22 17:54:57 2001
@@ -298,6 +298,26 @@
 typedef afs_int32 ViceIds<FLUSHMAX>;
 typedef	afs_int32 IPAddrs<FLUSHMAX>;
 
+%#define MAXCMDINT64S                           3
+%#define MAXCMDINT32S                           200
+%#define MAXCMDCHARS                            256
+
+struct ResidencyCmdInputs {
+    afs_int32  command;
+    struct AFSFid fid;
+    afs_int64  int64s[MAXCMDINT64S];
+    afs_uint32 int32s[MAXCMDINT32S];
+    char       chars[MAXCMDCHARS];
+};
+
+struct ResidencyCmdOutputs {
+    afs_int32  code;
+    struct AFSFetchStatus status;
+    afs_int64  int64s[MAXCMDINT64S];
+    afs_uint32 int32s[MAXCMDINT32S];
+    char       chars[MAXCMDCHARS];
+}; 
+
 package RXAFS_
 prefix S
 statindex 7
@@ -544,3 +564,9 @@
   AFSCallBack *CallBack,
   AFSVolSync *Sync
 ) = 163;
+
+ResidencyCmd(
+  IN AFSFid *Fid,
+  IN struct ResidencyCmdInputs *Inputs,
+  OUT struct ResidencyCmdOutputs *Outputs
+) = 220; 
diff -r -u src.orig/libafs/MakefileProto.AIX src/libafs/MakefileProto.AIX
--- src.orig/libafs/MakefileProto.AIX	Sat Nov  4 11:05:04 2000
+++ src/libafs/MakefileProto.AIX	Fri Jan 26 09:52:27 2001
@@ -23,6 +23,7 @@
 	osi_timeout.o \
 	osi_vm.o \
 	xdr.o \
+	xdr_int64.o \
 	xdr_array.o
 
 AFSNOIAUTHOBJS = \
@@ -128,6 +129,8 @@
 # Object build rules:
 # Common objects
 xdr.o: $(RX)/xdr.c
+	$(CRULE1);
+xdr_int64.o: $(RX)/xdr_int64.c
 	$(CRULE1);
 
 xdr_array.o: $(RX)/xdr_array.c
diff -r -u src.orig/libafs/MakefileProto.LINUX src/libafs/MakefileProto.LINUX
--- src.orig/libafs/MakefileProto.LINUX	Fri Jan 19 10:53:12 2001
+++ src/libafs/MakefileProto.LINUX	Tue Jan 23 11:10:36 2001
@@ -25,6 +25,7 @@
 	osi_vm.o \
 	osi_vnodeops.o \
 	xdr.o \
+	xdr_int64.o \
 	xdr_array.o
 
 AFS_OS_NFSOBJS =
@@ -189,6 +190,8 @@
 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
 	$(CRULE1);
 xdr.o: $(RX)/xdr.c
+	$(CRULE1);
+xdr_int64.o: $(RX)/xdr_int64.c
 	$(CRULE1);
 xdr_array.o: $(RX)/xdr_array.c
 	$(CRULE1);
Only in src/libafs: sgi_master
diff -r -u src.orig/libafsrpc/Makefile src/libafsrpc/Makefile
--- src.orig/libafsrpc/Makefile	Fri Jan 19 10:12:17 2001
+++ src/libafsrpc/Makefile	Mon Jan 22 19:00:56 2001
@@ -41,6 +41,7 @@
 XDROBJS =\
 	xdr_arrayn.o \
 	xdr_rx.o \
+	xdr_int64.o \
 	xdr_afsuuid.o \
 	AFS_component_version_number.o
 
@@ -190,6 +191,9 @@
 	${CCRULE};
 
 xdr.o: ${RX}/xdr.c
+	${CCRULE};
+
+xdr_int64.o: ${RX}/xdr_int64.c
 	${CCRULE};
 
 xdr_array.o: ${RX}/xdr_array.c
diff -r -u src.orig/libuafs/Makefile.common src/libuafs/Makefile.common
--- src.orig/libuafs/Makefile.common	Sat Nov  4 11:05:06 2000
+++ src/libuafs/Makefile.common	Tue Jan 23 11:51:25 2001
@@ -155,7 +155,8 @@
 	$(UOBJ)/hostparse.o \
 	$(UOBJ)/Krxstat.ss.o \
 	$(UOBJ)/Krxstat.xdr.o \
-	$(UOBJ)/rxstat.o
+	$(UOBJ)/rxstat.o \
+	$(UOBJ)/xdr_int64.o
 
 AFSWEBOBJ = \
 	$(WEBOBJ)/afs_atomlist.o \
@@ -520,6 +521,8 @@
 $(UOBJ)/rx_conncache.o: $(RX)/rx_conncache.c
 	$(CRULE1);
 $(UOBJ)/xdr_rx.o: $(RX)/xdr_rx.c
+	$(CRULE1);
+$(UOBJ)/xdr_int64.o: $(RX)/xdr_int64.c
 	$(CRULE1);
 $(UOBJ)/afs_usrops.o: $(AFS)/afs_usrops.c
 	$(CRULE1);
diff -r -u src.orig/rx/Makefile src/rx/Makefile
--- src.orig/rx/Makefile	Mon Nov  6 04:36:43 2000
+++ src/rx/Makefile	Mon Jan 22 17:41:11 2001
@@ -24,7 +24,8 @@
 XDROBJS = xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
 
 RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
-	rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o
+	rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o \
+	xdr_int64.o
 
 MULTIOBJS = rx_multi.o
 
@@ -43,7 +44,7 @@
 	rx_null.c rx_null.h rx_queue.h rx_getaddr.c rx_packet.c rx_packet.h \
 	rx_multi.h rx_kcommon.h rx_kcommon.c \
 	xdr.c xdr.h xdr_array.c xdr_arrayn.c xdr_rx.c rx_misc.c rx_rdwr.c \
-	xdr_afsuuid.c rx_trace.h
+	xdr_afsuuid.c rx_trace.h xdr_int64.c
 UKSRCS = $(KSRCS) rx_conncache.c
 
 include ../config/Makefile.version
diff -r -u src.orig/rx/rx.c src/rx/rx.c
--- src.orig/rx/rx.c	Fri Jan 19 10:37:54 2001
+++ src/rx/rx.c	Wed Jan 31 10:51:51 2001
@@ -455,7 +455,7 @@
 #else
 	struct sockaddr_in addr;
 	int addrlen = sizeof(addr);
-	if (getsockname(rx_socket, (struct sockaddr *) &addr, &addrlen)) {
+	if (getsockname((int)rx_socket, (struct sockaddr *) &addr, &addrlen)) {
 	    rx_Finalize();
 	    return -1;
 	}
diff -r -u src.orig/rx/xdr.h src/rx/xdr.h
--- src.orig/rx/xdr.h	Sat Nov  4 03:29:03 2000
+++ src/rx/xdr.h	Mon Jan 22 18:41:05 2001
@@ -304,6 +304,8 @@
 extern bool_t	xdr_reference();
 extern bool_t	xdr_wrapstring();
 extern bool_t	xdr_vector();
+extern bool_t   xdr_int64();
+extern bool_t   xdr_uint64();
 
 /*
  * These are the public routines for the various implementations of
Only in src/rx: xdr_int64.c
diff -r -u src.orig/rxgen/rpc_main.c src/rxgen/rpc_main.c
--- src.orig/rxgen/rpc_main.c	Sat Nov  4 03:29:21 2000
+++ src/rxgen/rpc_main.c	Fri Jan 26 09:25:41 2001
@@ -251,6 +251,12 @@
 	f_print(fout, "#ifndef xdr_afs_uint32\n");
 	f_print(fout, "#define xdr_afs_uint32 xdr_u_int\n");
 	f_print(fout, "#endif\n");
+        f_print(fout, "#ifndef xdr_afs_int64\n");
+        f_print(fout, "#define xdr_afs_int64 xdr_int64\n");
+        f_print(fout, "#endif\n");
+        f_print(fout, "#ifndef xdr_afs_uint64\n");
+        f_print(fout, "#define xdr_afs_uint64 xdr_uint64\n");
+        f_print(fout, "#endif\n");
 #else
 #error Need to do some work here...
 #endif
@@ -560,6 +566,8 @@
 	f_print(fout, "#ifdef AFS_LINUX22_ENV\n");
 	f_print(fout, "#include \"../rx/xdr.h\"\n");
 	f_print(fout, "#else /* AFS_LINUX22_ENV */\n");
+	f_print(fout, "extern bool_t xdr_int64();\n");
+	f_print(fout, "extern bool_t xdr_uint64();\n");
 	f_print(fout, "#include \"../rpc/xdr.h\"\n");
 	f_print(fout, "#endif /* AFS_LINUX22_ENV */\n");
 	f_print(fout, "#endif /* XDR_GETLONG */\n");
diff -r -u src.orig/viced/afsfileprocs.c src/viced/afsfileprocs.c
--- src.orig/viced/afsfileprocs.c	Sat Nov  4 11:06:14 2000
+++ src/viced/afsfileprocs.c	Mon Jan 22 18:33:31 2001
@@ -6896,3 +6896,11 @@
     return EINVAL;
 }
 
+SRXAFS_ResidencyCmd (tcon, Fid, Inputs, Outputs)
+    struct rx_connection *tcon;
+    struct AFSFid *Fid;
+    struct ResidencyCmdInputs *Inputs;
+    struct ResidencyCmdOutputs *Outputs;
+{
+    return EINVAL;
+}

--------------9ED0C27F2314BC0FCA3F6845
Content-Type: text/plain; charset=us-ascii;
 name="xdr_int64.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="xdr_int64.c"


/*
 *  XDR routine for int64 (long long or struct)
 */

#if defined(KERNEL) && !defined(UKERNEL)
#include "afs/param.h"
#ifdef AFS_LINUX20_ENV
#include "../h/string.h"
#define bzero(A,C) memset((A), 0, (C))
#else
#include <sys/param.h>
#include <sys/systm.h>
#endif
#else
#include <stdio.h>
#endif
#include "xdr.h"
#if defined(KERNEL) && !defined(UKERNEL)
#ifdef        AFS_DEC_ENV
#include <afs/longc_procs.h>
#endif
#endif

#ifndef lint
static char sccsid[] = "@(#)xdr_array.c 1.1 86/02/03 Copyr 1984 Sun Micro";
#endif

#ifdef AFS_64BIT_ENV
/*
 * XDR afs_int64 integers
 */
bool_t
xdr_int64(xdrs, ulp)
        register XDR *xdrs;
        afs_int64 *ulp;
{
        static afs_int32 high;
        static afs_uint32 low;

        if (xdrs->x_op == XDR_DECODE) {
                if (!XDR_GETINT32(xdrs, (afs_int32 *) &high)) return (FALSE);
                if (!XDR_GETINT32(xdrs, (afs_int32 *) &low)) return (FALSE);
                *ulp = high;
                *ulp <<= 32;
                *ulp += low;
                return (TRUE);
        }
        if (xdrs->x_op == XDR_ENCODE) {
                high = (*ulp >> 32);
                low = *ulp & 0xFFFFFFFFL;
                if (!XDR_PUTINT32(xdrs, (afs_int32 *) &high)) return (FALSE);
                return (XDR_PUTINT32(xdrs, (afs_int32 *) &low));
        }
        if (xdrs->x_op == XDR_FREE)
                return (TRUE);
        return (FALSE);
}

/*
 * XDR afs_int64 integers
 */
bool_t
xdr_uint64(xdrs, ulp)
        register XDR *xdrs;
        afs_uint64 *ulp;
{
        static afs_uint32 high;
        static afs_uint32 low;

        if (xdrs->x_op == XDR_DECODE) {
                if (!XDR_GETINT32(xdrs, (afs_uint32 *) &high)) return (FALSE);
                if (!XDR_GETINT32(xdrs, (afs_uint32 *) &low)) return (FALSE);
                *ulp = high;
                *ulp <<= 32;
                *ulp += low;
                return (TRUE);
        }
        if (xdrs->x_op == XDR_ENCODE) {
                high = (*ulp >> 32);
                low = *ulp & 0xFFFFFFFFL;
                if (!XDR_PUTINT32(xdrs, (afs_uint32 *) &high)) return (FALSE);
                return (XDR_PUTINT32(xdrs, (afs_uint32 *) &low));
        }
        if (xdrs->x_op == XDR_FREE)
                return (TRUE);
        return (FALSE);
}
#else /* AFS_64BIT_ENV */
/*
 * XDR afs_int64 integers
 */
bool_t
xdr_int64(xdrs, ulp)
        register XDR *xdrs;
        afs_int64 *ulp;
{
        if (xdrs->x_op == XDR_DECODE) {
                if (!XDR_GETINT32(xdrs, (afs_int32 *) &ulp->high)) return (FALSE);
                return (XDR_GETINT32(xdrs, (afs_int32 *) &ulp->low));
        }
        if (xdrs->x_op == XDR_ENCODE) {
                if (!XDR_PUTINT32(xdrs, (afs_int32 *) &ulp->high)) return (FALSE);
                return (XDR_PUTINT32(xdrs, (afs_int32 *) &ulp->low));
        }
        if (xdrs->x_op == XDR_FREE)
                return (TRUE);
        return (FALSE);
}

/*
 * XDR afs_uint64 integers
 */
bool_t
xdr_uint64(xdrs, ulp)
        register XDR *xdrs;
        afs_uint64 *ulp;
{
        if (xdrs->x_op == XDR_DECODE) {
                if (!XDR_GETINT32(xdrs, (afs_uint32 *) &ulp->high)) return (FALSE);
                return (XDR_GETINT32(xdrs, (afs_uint32 *) &ulp->low));
        }
        if (xdrs->x_op == XDR_ENCODE) {
                if (!XDR_PUTINT32(xdrs, (afs_uint32 *) &ulp->high)) return (FALSE);
                return (XDR_PUTINT32(xdrs, (afs_uint32 *) &ulp->low));
        }
        if (xdrs->x_op == XDR_FREE)
                return (TRUE);
        return (FALSE);
}
#endif /* AFS_64BIT_ENV */

--------------9ED0C27F2314BC0FCA3F6845--