]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-resync-20041018 openafs-devel-1_3_73
authorDerrick Brashear <shadow@dementia.org>
Mon, 18 Oct 2004 18:43:44 +0000 (18:43 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 18 Oct 2004 18:43:44 +0000 (18:43 +0000)
cheat. pull in all the 1.3.72->head changes in one delta

40 files changed:
configure-libafs.in
configure.in
src/WINNT/pthread/pthread.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_dirops.c
src/afs/VNOPS/afs_vnop_link.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_readdir.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_rename.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/afs.h
src/afs/afs_dcache.c
src/afs/afs_pioctl.c
src/afs/afs_segments.c
src/afs/afs_vcache.c
src/bozo/bos.c
src/butc/tcmain.c
src/cf/osconf.m4
src/config/afs_sysnames.h
src/des/Makefile.in
src/des/des.c
src/libafs/MakefileProto.LINUX.in
src/rx/LINUX/rx_knet.c
src/rx/rx.c
src/rx/rx_packet.c
src/rx/rx_user.c
src/rx/rxdebug.c
src/rxkad/domestic/fcrypt.c
src/rxkad/rxkad.p.h
src/rxkad/rxkad_prototypes.h
src/sys/pioctl_nt.c
src/ubik/beacon.c
src/ubik/ubik.p.h
src/util/snprintf.c
src/vol/namei_ops.c
src/vol/nuke.c
src/vol/vol-salvage.c

index e2bc7a75b23c3a3f672de21fe49cc2c8e8bc0727..eaf1f0a5bb643a43c8072b6f7f7114e017f9093f 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,1.3.72)
+AM_INIT_AUTOMAKE(openafs-libafs,1.3.73)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
 define(OPENAFS_CONFIGURE_LIBAFS)
 
index 84067d4ff87fd8e7f7a0301b2e598e0452b92299..298ae18419ca0ef8606e7df9e447d81f3fca55af 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,1.3.72)
+AM_INIT_AUTOMAKE(openafs,1.3.73)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
 
 AC_PROG_CC
index 4c72ab6c17b1391029746a3d3856b59d5dd8a9a2..33a17a4a03e032b3063cb7a7fbdd92474af6437f 100644 (file)
@@ -590,11 +590,14 @@ static void pthread_sync_terminate_thread(void) {
     (pthread_cache_done || pthread_once(&pthread_cache_once, create_once));
 
     if (terminate_thread_handle == INVALID_HANDLE_VALUE) {
-       terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
-                               TRUE, FALSE, (LPCTSTR) 0);
-       terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, 
-                               terminate_thread_routine, (LPVOID) 0, 0, 
-                               &terminate_thread_id);
+        CHAR eventName[MAX_PATH];
+        static eventCount = 0;
+        sprintf(eventName, "terminate_thread_wakeup_event %d::%d", _getpid(), eventCount++);
+        terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
+                                                     TRUE, FALSE, (LPCTSTR) eventName);
+        terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, 
+                                                terminate_thread_routine, (LPVOID) 0, 0, 
+                                                &terminate_thread_id);
     } else {
        SetEvent (terminate_thread_wakeup_event);
     }
@@ -711,8 +714,11 @@ static cond_waiters_t *get_waiter() {
     if (queue_IsEmpty(&waiter_cache)) {
         new = (cond_waiters_t *) malloc(sizeof(cond_waiters_t));
        if (new != NULL) {
-           new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
-                                    FALSE, (LPCTSTR) 0);
+        CHAR eventName[MAX_PATH];
+        static eventCount = 0;
+        sprintf(eventName, "cond_waiters_t %d::%d", _getpid(), eventCount++);
+        new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
+                                  FALSE, (LPCTSTR) eventName);
            if (new->event == NULL) {
                free(new);
                new = NULL;
index dba52d59595ab1e1ca087a683bdbc09d7669bdc9..af2d9503ec9fd86c8aacc1dc37907b04b8fadab8 100644 (file)
@@ -223,11 +223,6 @@ asmlinkage int (*sys_setgroups32p) (int gidsetsize,
 #define SYSCALL2POINTER (void *)
 #endif
 
-#ifdef AFS_PPC64_LINUX20_ENV
-extern void *set_afs_syscall(void*);
-extern void *set_afs_xsetgroups_syscall(void*);
-extern void *set_afs_xsetgroups_syscall32(void*);
-#endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 int __init
@@ -525,11 +520,6 @@ init_module(void)
 #endif /* AFS_AMD64_LINUX20_ENV */
 #endif /* AFS_IA64_LINUX20_ENV */
 
-#ifdef AFS_PPC64_LINUX20_ENV
-    afs_ni_syscall = set_afs_syscall(afs_syscall);
-    sys_setgroupsp = set_afs_xsetgroups_syscall(afs_xsetgroups);
-    sys32_setgroupsp = set_afs_xsetgroups_syscall32(afs32_xsetgroups);
-#endif
     }
 
     osi_sysctl_init();
@@ -582,11 +572,6 @@ cleanup_module(void)
     }
 #endif
     }
-#ifdef AFS_PPC64_LINUX20_ENV
-    set_afs_syscall(afs_ni_syscall);
-    set_afs_xsetgroups_syscall(sys_setgroupsp);
-    set_afs_xsetgroups_syscall32(sys32_setgroupsp);
-#endif
     unregister_filesystem(&afs_fs_type);
 
     osi_linux_free_inode_pages();      /* Invalidate all pages using AFS inodes. */
index 4025b5a75b6c4154d8aa16f4b6dd0b363b00eb7e..8178d0bbe34587ebbb0890d70c74441858811a8b 100644 (file)
@@ -333,11 +333,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
     code = 0;
     offset = (int) fp->f_pos;
     while (1) {
-       dirpos = BlobScan(&tdc->f.inode, offset);
+       dirpos = BlobScan(&tdc->f, offset);
        if (!dirpos)
            break;
 
-       de = afs_dir_GetBlob(&tdc->f.inode, dirpos);
+       de = afs_dir_GetBlob(&tdc->f, dirpos);
        if (!de)
            break;
 
@@ -649,12 +649,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
     int code = 0;
     struct vcache *vcp = ITOAFS(FILE_INODE(fp));
     cred_t *credp = crref();
-#ifdef AFS_LINUX24_ENV
-    struct flock64 flock;
-#else
-    struct flock flock;
-#endif
-
+    struct AFS_FLOCK flock;
     /* Convert to a lock format afs_lockctl understands. */
     memset((char *)&flock, 0, sizeof(flock));
     flock.l_type = flp->fl_type;
@@ -1485,6 +1480,12 @@ afs_linux_writepage(struct page *pp)
     unsigned offset = PAGE_CACHE_SIZE;
     long status;
 
+#ifdef PageLaunder
+    if (PageLaunder(pp)) {
+       return(fail_writepage(pp));
+    }
+#endif
+
     inode = (struct inode *)mapping->host;
     end_index = inode->i_size >> PAGE_CACHE_SHIFT;
 
index ad0f0e0c8dcd8aaeb3d1891fe0a7309999dc8c94..c16f411b9129b47ef7376be5358f807bb0c45bc6 100644 (file)
@@ -154,7 +154,7 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
     if (tdc) {
        /* see if file already exists.  If it does, we only set 
         * the size attributes (to handle O_TRUNC) */
-       code = afs_dir_Lookup(&tdc->f.inode, aname, &newFid.Fid);       /* use dnlc first xxx */
+       code = afs_dir_Lookup(&tdc->f, aname, &newFid.Fid);     /* use dnlc first xxx */
        if (code == 0) {
            ReleaseSharedLock(&tdc->lock);
            afs_PutDCache(tdc);
@@ -368,10 +368,10 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
        UpgradeSToWLock(&tdc->lock, 631);
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+       code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
        if (code) {
            ZapDCE(tdc);
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
@@ -531,7 +531,7 @@ afs_LocalHero(register struct vcache *avc, register struct dcache *adc,
     } else {
        if (adc) {
            ZapDCE(adc);
-           DZap(&adc->f.inode);
+           DZap(&adc->f);
        }
        if (avc->states & CStatd) {
            osi_dnlc_purgedp(avc);
index 8f71cd13684993f40f08f211c91b533d2588abc4..0cd7cedd50fd6c3b5f21cef2b2b08a9b49d0340d 100644 (file)
@@ -147,10 +147,10 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
        ObtainWriteLock(&tdc->lock, 632);
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+       code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
        if (code) {
            ZapDCE(tdc);        /* surprise error -- use invalid value */
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
@@ -250,7 +250,7 @@ afs_rmdir(adp, aname, acred)
        struct VenusFid unlinkFid;
 
        unlinkFid.Fid.Vnode = 0;
-       code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid);
+       code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid);
        if (code == 0) {
            afs_int32 cached = 0;
 
@@ -304,10 +304,10 @@ afs_rmdir(adp, aname, acred)
        UpgradeSToWLock(&tdc->lock, 634);
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Delete(&tdc->f.inode, aname);
+       code = afs_dir_Delete(&tdc->f, aname);
        if (code) {
            ZapDCE(tdc);        /* surprise error -- invalid value */
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
index e48ca78316e0814add2c197016c92410fa32b32a..22ac2bc1cdd85bb72db3427556b92ccc1e715c5f 100644 (file)
@@ -137,10 +137,10 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred)
        ObtainWriteLock(&tdc->lock, 635);
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Create(&tdc->f.inode, aname, &avc->fid.Fid);
+       code = afs_dir_Create(&tdc->f, aname, &avc->fid.Fid);
        if (code) {
            ZapDCE(tdc);        /* surprise error -- invalid value */
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
index bb908163d6192b7ac4f2d3b156268bf3161b737d..8add8d8c778f276568ccb8c52f28a79717aa124d 100644 (file)
@@ -674,7 +674,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
        /* look for first safe entry to examine in the directory.  BlobScan
         * looks for a the 1st allocated dir after the dirCookie slot.
         */
-       newIndex = BlobScan(&dcp->f.inode, (dirCookie >> 5));
+       newIndex = BlobScan(&dcp->f, (dirCookie >> 5));
        if (newIndex == 0)
            break;
 
@@ -683,7 +683,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
 
        /* get a ptr to the dir entry */
        dirEntryp =
-           (struct DirEntry *)afs_dir_GetBlob(&dcp->f.inode, newIndex);
+           (struct DirEntry *)afs_dir_GetBlob(&dcp->f, newIndex);
        if (!dirEntryp)
            break;
 
@@ -1293,7 +1293,7 @@ afs_lookup(adp, aname, avcp, acred)
     {                          /* sub-block just to reduce stack usage */
        register struct dcache *tdc;
        afs_size_t dirOffset, dirLen;
-       ino_t theDir;
+       struct fcache *theDir;
        struct VenusFid tfid;
 
        /* now we have to lookup the next fid */
@@ -1351,15 +1351,15 @@ afs_lookup(adp, aname, avcp, acred)
 
        /* lookup the name in the appropriate dir, and return a cache entry
         * on the resulting fid */
-       theDir = tdc->f.inode;
+       theDir = &tdc->f;
        code =
-           afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid,
+           afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid,
                                 &dirCookie);
 
        /* If the first lookup doesn't succeed, maybe it's got @sys in the name */
        while (code == ENOENT && Next_AtSys(adp, &treq, &sysState))
            code =
-               afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid,
+               afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid,
                                     &dirCookie);
        tname = sysState.name;
 
index c681c136a54d6700783e5aad49408ae1ce30280e..d1d0330ae476796554ec96f0f0d81ed19fe66a0d 100644 (file)
@@ -66,24 +66,8 @@ extern struct DirEntry *afs_dir_GetBlob();
     BlobScan is used by the Linux port in a separate file, so it should not
     become static.
 */
-#if defined(AFS_SGI62_ENV) || defined(AFS_SUN57_64BIT_ENV)
 int
-BlobScan(ino64_t * afile, afs_int32 ablob)
-#else
-#if defined(AFS_HPUX1123_ENV)
-/*DEE should use afs_inode_t for all */
-int
-BlobScan(ino_t * afile, afs_int32 ablob)
-#else
-#ifdef AFS_LINUX_64BIT_KERNEL
-int
-BlobScan(long *afile, afs_int32 ablob)
-#else
-int
-BlobScan(afs_int32 * afile, afs_int32 ablob)
-#endif
-#endif
-#endif
+BlobScan(struct fcache * afile, afs_int32 ablob)
 {
     register afs_int32 relativeBlob;
     afs_int32 pageBlob;
@@ -657,8 +641,8 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred)
        origOffset = auio->afsio_offset;
        /* scan for the next interesting entry scan for in-use blob otherwise up point at
         * this blob note that ode, if non-zero, also represents a held dir page */
-       if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)))
-           || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) {
+       if (!(us = BlobScan(&tdc->f, (origOffset >> 5)))
+           || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) {
            /* failed to setup nde, return what we've got, and release ode */
            if (len) {
                /* something to hand over. */
@@ -948,8 +932,8 @@ afs1_readdir(avc, auio, acred)
 
        /* scan for the next interesting entry scan for in-use blob otherwise up point at
         * this blob note that ode, if non-zero, also represents a held dir page */
-       if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)))
-           || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) {
+       if (!(us = BlobScan(&tdc->f, (origOffset >> 5)))
+           || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) {
            /* failed to setup nde, return what we've got, and release ode */
            if (len) {
                /* something to hand over. */
index 7b25833102ea04bb7fca9b49f226eb52b60403b7..363bc22904b3afa6f6f0a07fcd43bab96908378f 100644 (file)
@@ -154,10 +154,10 @@ afsremove(register struct vcache *adp, register struct dcache *tdc,
        UpgradeSToWLock(&tdc->lock, 637);
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Delete(&tdc->f.inode, aname);
+       code = afs_dir_Delete(&tdc->f, aname);
        if (code) {
            ZapDCE(tdc);        /* surprise error -- invalid value */
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
@@ -357,7 +357,7 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
      * done the work */
     if (!tvc)
        if (tdc) {
-           code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid);
+           code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid);
            if (code == 0) {
                afs_int32 cached = 0;
 
index cd71a798fee8b18820c92afc31cc94f250ee9966..642c421e71262b8abeb81be6edfcbd57eb33848a 100644 (file)
@@ -146,7 +146,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp,
     }
 
     if (code == 0)
-       code = afs_dir_Lookup(&tdc1->f.inode, aname1, &fileFid.Fid);
+       code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid);
     if (code) {
        if (tdc1) {
            ReleaseWriteLock(&tdc1->lock);
@@ -205,38 +205,38 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp,
            if (!doLocally) {
                if (tdc1) {
                    ZapDCE(tdc1);
-                   DZap(&tdc1->f.inode);
+                   DZap(&tdc1->f);
                }
                if (tdc2) {
                    ZapDCE(tdc2);
-                   DZap(&tdc2->f.inode);
+                   DZap(&tdc2->f);
                }
            }
        }
        /* now really do the work */
        if (doLocally) {
            /* first lookup the fid of the dude we're moving */
-           code = afs_dir_Lookup(&tdc1->f.inode, aname1, &fileFid.Fid);
+           code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid);
            if (code == 0) {
                /* delete the source */
-               code = afs_dir_Delete(&tdc1->f.inode, aname1);
+               code = afs_dir_Delete(&tdc1->f, aname1);
            }
            /* first see if target is there */
            if (code == 0
-               && afs_dir_Lookup(&tdc2->f.inode, aname2,
+               && afs_dir_Lookup(&tdc2->f, aname2,
                                  &unlinkFid.Fid) == 0) {
                /* target already exists, and will be unlinked by server */
-               code = afs_dir_Delete(&tdc2->f.inode, aname2);
+               code = afs_dir_Delete(&tdc2->f, aname2);
            }
            if (code == 0) {
-               code = afs_dir_Create(&tdc2->f.inode, aname2, &fileFid.Fid);
+               code = afs_dir_Create(&tdc2->f, aname2, &fileFid.Fid);
            }
            if (code != 0) {
                ZapDCE(tdc1);
-               DZap(&tdc1->f.inode);
+               DZap(&tdc1->f);
                if (!oneDir) {
                    ZapDCE(tdc2);
-                   DZap(&tdc2->f.inode);
+                   DZap(&tdc2->f);
                }
            }
        }
@@ -339,7 +339,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp,
            if (tdc1) {
                ObtainWriteLock(&tdc1->lock, 648);
                ZapDCE(tdc1);   /* mark as unknown */
-               DZap(&tdc1->f.inode);
+               DZap(&tdc1->f);
                ReleaseWriteLock(&tdc1->lock);
                afs_PutDCache(tdc1);    /* put it back */
            }
index b33f970b4ba1ead572ae7e1d04b352111f17d5b2..cd5008d5c7df0079e26286e7b6a538c2ccc94dd0 100644 (file)
@@ -184,10 +184,10 @@ int afs_symlink
     /* otherwise, we should see if we can make the change to the dir locally */
     if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
        /* we can do it locally */
-       code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+       code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
        if (code) {
            ZapDCE(tdc);        /* surprise error -- use invalid value */
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        }
     }
     if (tdc) {
index 11e4843e5eb1d18f5fd18d58a657648ce7026e89..334277dd4aa96c8ca36a82cc225b8c196d27b99d 100644 (file)
@@ -43,7 +43,7 @@ extern int afs_shuttingdown;
 #if     defined(AFS_HPUX102_ENV)
 #define AFS_FLOCK       k_flock
 #else
-#if     defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV)
+#if     defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV))
 #define AFS_FLOCK       flock64
 #else
 #define AFS_FLOCK       flock
@@ -1195,7 +1195,7 @@ struct afs_fakestat_state {
 extern int afs_fakestat_enable;
 
 struct buffer {
-    ino_t fid[1];              /* Unique cache key + i/o addressing */
+    struct fcache *fid;
     afs_int32 page;
     afs_int32 accesstime;
     struct buffer *hashNext;
index f8f4b48452b49e0b7c9a79902777d79fa1b2006a..6124c273ffcf0e2d06316c07b75f7eccf1c3b523 100644 (file)
@@ -686,7 +686,7 @@ afs_HashOutDCache(struct dcache *adc)
     AFS_STATCNT(afs_glink);
 #endif
     /* we know this guy's in the LRUQ.  We'll move dude into DCQ below */
-    DZap(&adc->f.inode);
+    DZap(&adc->f);
     /* if this guy is in the hash table, pull him out */
     if (adc->f.fid.Fid.Volume != 0) {
        /* remove entry from first hash chains */
@@ -2038,7 +2038,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
         * Right now, we only have one tool, and it's a hammer.  So, we
         * fetch the whole file.
         */
-       DZap(&tdc->f.inode);    /* pages in cache may be old */
+       DZap(&tdc->f);  /* pages in cache may be old */
 #ifdef  IHINT
        if (file = tdc->ihint) {
            if (tdc->f.inode == file->inum)
@@ -2415,7 +2415,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
            afs_CFileClose(file);
            ZapDCE(tdc);        /* sets DFEntryMod */
            if (vType(avc) == VDIR) {
-               DZap(&tdc->f.inode);
+               DZap(&tdc->f);
            }
            ReleaseWriteLock(&tdc->lock);
            afs_PutDCache(tdc);
index 8ab51ac0240f8eebf8c15c17ed757776111655f7..a8c3a3b41bd1fd201055bd2dfdbec30f1bc0e693 100644 (file)
@@ -268,7 +268,11 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst)
 #elif defined(AFS_AMD64_LINUX20_ENV)
     if (current->thread.flags & THREAD_IA32)
 #elif defined(AFS_PPC64_LINUX20_ENV)
-    if (current->thread.flags & PPC_FLAG_32BIT)
+#ifdef AFS_PPC64_LINUX26_ENV
+      if (current->thread_info->flags & _TIF_32BIT)
+#else /*Linux 2.6*/
+    if (current->thread.flags & PPC_FLAG_32BIT) 
+#endif
 #elif defined(AFS_S390X_LINUX20_ENV)
     if (current->thread.flags & S390_FLAG_31BIT)
 #else
@@ -488,7 +492,7 @@ struct afs_ioctl_sys {
     unsigned int com;
     unsigned long arg;
 };
-asmlinkage int
+int
 afs_xioctl(struct inode *ip, struct file *fp, unsigned int com,
           unsigned long arg)
 {
@@ -1713,7 +1717,7 @@ DECL_PIOCTL(PNewStatMount)
     Check_AtSys(avc, ain, &sysState, areq);
     ObtainReadLock(&tdc->lock);
     do {
-       code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+       code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
     } while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
     ReleaseReadLock(&tdc->lock);
     afs_PutDCache(tdc);                /* we're done with the data */
@@ -2393,7 +2397,7 @@ DECL_PIOCTL(PRemoveMount)
     Check_AtSys(avc, ain, &sysState, areq);
     ObtainReadLock(&tdc->lock);
     do {
-       code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+       code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
     } while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
     ReleaseReadLock(&tdc->lock);
     bufp = sysState.name;
@@ -2464,10 +2468,10 @@ DECL_PIOCTL(PRemoveMount)
        ObtainWriteLock(&tdc->lock, 661);
        if (afs_LocalHero(avc, tdc, &OutDirStatus, 1)) {
            /* we can do it locally */
-           code = afs_dir_Delete(&tdc->f.inode, bufp);
+           code = afs_dir_Delete(&tdc->f, bufp);
            if (code) {
                ZapDCE(tdc);    /* surprise error -- invalid value */
-               DZap(&tdc->f.inode);
+               DZap(&tdc->f);
            }
        }
        ReleaseWriteLock(&tdc->lock);
@@ -3499,7 +3503,7 @@ DECL_PIOCTL(PFlushMount)
     Check_AtSys(avc, ain, &sysState, areq);
     ObtainReadLock(&tdc->lock);
     do {
-       code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+       code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
     } while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
     ReleaseReadLock(&tdc->lock);
     afs_PutDCache(tdc);                /* we're done with the data */
index f9d5b806804429de38ec4594ff100c43d700cefe..41c65cee2b16dc4b3d25c1bad1ccb9e344ea3d72 100644 (file)
@@ -898,7 +898,7 @@ afs_InvalidateAllSegments(struct vcache *avc)
        ObtainWriteLock(&tdc->lock, 679);
        ZapDCE(tdc);
        if (vType(avc) == VDIR)
-           DZap(&tdc->f.inode);
+           DZap(&tdc->f);
        ReleaseWriteLock(&tdc->lock);
        afs_PutDCache(tdc);
     }
@@ -1041,6 +1041,12 @@ afs_TruncateAllSegments(register struct vcache *avc, afs_size_t alen,
            afs_CFileTruncate(tfile, newSize);
            afs_CFileClose(tfile);
            afs_AdjustSize(tdc, newSize);
+           if (alen < tdc->validPos) {
+                if (alen < AFS_CHUNKTOBASE(tdc->f.chunk))
+                    tdc->validPos = 0;
+                else
+                    tdc->validPos = alen;
+            }
            ConvertWToSLock(&tdc->lock);
        }
        ReleaseSharedLock(&tdc->lock);
index 87c467f16b8efeaa70fbdd253cbe603a297909c6..249e27228f3fea7cf8b6b0dd8edf3a8b1f1cf052 100644 (file)
@@ -840,9 +840,18 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp)
 #elif defined(AFS_LINUX22_ENV)
            if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0) {
 #if defined(AFS_LINUX26_ENV)
-               AFS_GUNLOCK();
-               d_prune_aliases(AFSTOI(tvc));
-               AFS_GLOCK();
+                struct dentry *dentry;
+                struct list_head *cur, *head = &(AFSTOI(tvc))->i_dentry;
+                AFS_GUNLOCK();
+                cur=head;
+                while ((cur = cur->next) != head) {
+                    dentry = list_entry(cur, struct dentry, d_alias);
+                    if (!d_unhashed(dentry) &&
+                        !list_empty(&dentry->d_subdirs))
+                       shrink_dcache_parent(dentry);
+                }
+                d_prune_aliases(AFSTOI(tvc));
+                AFS_GLOCK();
 #else
                afs_TryFlushDcacheChildren(tvc);
 #endif
index d5ced10e369544971373cb156c340e8f9036983b..ad5a00f4f8e1f82e8537a2508cfd833207654478 100644 (file)
@@ -239,7 +239,7 @@ GetConn(as, aencrypt)
            code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
            if (code == 0) {
                /* have tickets, will travel */
-               if (ttoken.kvno >= 0 && ttoken.kvno <= 255);
+               if (ttoken.kvno >= 0 && ttoken.kvno <= 256);
                else {
                    fprintf(stderr,
                            "bos: funny kvno (%d) in ticket, proceeding\n",
index d804794f69bb8f74079b0eeb696b97fa02440bb7..787fa8da394455decf62f64b604125c544c07d37 100644 (file)
@@ -856,6 +856,7 @@ WorkerBee(as, arock)
 #else
     PROCESS dbWatcherPid;
 #endif
+    time_t t;
 
     debugLevel = 0;
 
@@ -1131,7 +1132,8 @@ WorkerBee(as, arock)
 
     TLog(0, "Starting Tape Coordinator: Port offset %u   Debug level %u\n",
         portOffset, debugLevel);
-    TLog(0, "Token expires: %s\n", cTIME(&ttoken.endTime));
+    t = ttoken.endTime;
+    TLog(0, "Token expires: %s\n", cTIME(&t));
 
     rx_StartServer(1);         /* Donate this process to the server process pool */
     TLog(0, "Error: StartServer returned");
index 688b752c3d82eff7d841e35853b2448a3639834f..5712e488cebda7ea317619aed0331974070d832c 100644 (file)
@@ -229,12 +229,14 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
-       amd64_linux24)
+       amd64_linux*)
+               CCOBJ="${CC} -fPIC"
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
                MT_LIBS="-lpthread"
                PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
                TXLIBS="-lncurses"
                XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
index db042c3b18d43f242d823de9b066dd8b0cfaffe5..ac6d74cf10eaf476000334b9bc4b9d0b531c540a 100644 (file)
 #define SYS_NAME_ID_amd64_linux2        2700
 #define SYS_NAME_ID_amd64_linux22       2701
 #define SYS_NAME_ID_amd64_linux24       2702
+#define SYS_NAME_ID_amd64_linux26       2703
 
 #define SYS_NAME_ID_i386_umlinux2      2800
 #define SYS_NAME_ID_i386_umlinux22     2801
 #define SYS_NAME_ID_ppc64_linux2       2900
 #define SYS_NAME_ID_ppc64_linux22      2901
 #define SYS_NAME_ID_ppc64_linux24      2902
+#define SYS_NAME_ID_ppc64_linux26      2903
 
 /*
  * Placeholder to keep system-wide standard flags since this file is included by all 
index 8f8d08ba906972059affa6dd0aea9c163b113388..a415f1470f926ccf651c421468b764b6a647f8cd 100644 (file)
@@ -88,9 +88,9 @@ make_s:       make_s.o misc.o main.o
 crypt.o: crypt.c
        case ${SYS_NAME} in \
        rs_aix*)\
-               ${CC} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
+               ${CCOBJ} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
        *)\
-               ${CC} -c ${CFLAGS} -o crypt.o crypt.c ;;\
+               ${CCOBJ} -c ${CFLAGS} -o crypt.o crypt.c ;;\
        esac
 #
 # Table/code generation targets
index 732e266bb7f80b4985cdc9fc4b2d96fe3c450d56..5536066c6ebe99423d73c62f928007c311e64969 100644 (file)
@@ -72,12 +72,13 @@ pthread_mutex_t rxkad_stats_mutex;
 /* encrypt == 0  ==> decrypt, else encrypt */
 
 afs_int32
-des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+des_ecb_encrypt(void * clear, void * cipher,
                register des_key_schedule schedule, int encrypt)
 {
     /* better pass 8 bytes, length not checked here */
 
-    register afs_uint32 R1 = 0, L1 = 0;        /* R1 = r10, L1 = r9 */
+    register afs_uint32 R1 = 0;
+    register afs_uint32 L1 = 0;        /* R1 = r10, L1 = r9 */
     register afs_uint32 R2 = 0, L2 = 0;        /* R2 = r8, L2 = r7 */
     afs_int32 i;
     /* one more registers left on VAX, see below P_temp_p */
@@ -128,20 +129,22 @@ des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
        abort();
     }
 #endif
-    if ((afs_int32) clear & 3) {
-       memcpy((char *)&L_save, (char *)clear++, sizeof(L_save));
-       memcpy((char *)&R_save, (char *)clear, sizeof(R_save));
+    if ((afs_uint32) clear & 3) {
+       memcpy((char *)(&L_save), (char *)clear, sizeof(L_save));
+       clear=((afs_uint32*)clear)+1;
+       memcpy((char *)(&R_save), (char *)clear, sizeof(R_save));
        L1 = L_save;
        R1 = R_save;
     } else
 #endif
     {
-       if (clear)
-           L1 = *clear++;
-       else
+       if (clear) {
+           L1 = *((afs_uint32 *)clear);
+            clear=((afs_uint32*)clear)+1;
+       } else
            L1 = 0;
        if (clear)
-           R1 = *clear;
+           R1 = *((afs_uint32 *)clear);
        else
            R1 = 0;
     }
@@ -441,13 +444,15 @@ des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
     if ((afs_int32) cipher & 3) {
        L_save = L2;            /* cant bcopy a reg */
        R_save = R2;
-       memcpy((char *)cipher++, (char *)&L_save, sizeof(L_save));
+       memcpy((char *)cipher, (char *)&L_save, sizeof(L_save));
+       cipher=((afs_uint32*)cipher)+1;
        memcpy((char *)cipher, (char *)&R_save, sizeof(R_save));
     } else
 #endif
     {
-       *cipher++ = L2;
-       *cipher = R2;
+        *((afs_uint32*)cipher)= L2;    
+       cipher = ((afs_int32 *)cipher)+1;
+       *((afs_uint32 *)cipher) = R2;
     }
 
 #ifdef DEBUG
index 3527948cdb28bafa08e86aa5b1668d446c1bfcba..6d6673834ee327fc0dae3d1b728d850d70735b7f 100644 (file)
@@ -144,29 +144,29 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        $(RM) -f asm-generic
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
        $(RM) -f asm
-<parisc_linux22 parisc_linux24>
+<parisc_linux22 parisc_linux24 parisc_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-parisc asm
-<alpha_linux_22 alpha_linux_24>
+<alpha_linux_22 alpha_linux_24 alpha_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
-<i386_linux22 i386_linux24>
+<i386_linux22 i386_linux24 i386_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
-<i386_umlinux22 i386_umlinux24>
+<i386_umlinux22 i386_umlinux24 i386_umlinux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-um asm
-<amd64_linux24>
+<amd64_linux24 amd64_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
-<s390_linux22 s390_linux24>
+<s390_linux22 s390_linux24 s390_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
-<s390x_linux22 s390x_linux24>
+<s390x_linux22 s390x_linux24 s390x_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
-<ppc_linux22 ppc_linux24>
+<ppc_linux22 ppc_linux24 ppc_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm 
-<ppc64_linux24>
+<ppc64_linux24 ppc64_linux26>
        ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc64 asm 
-<sparc_linux22 sparc_linux24>
+<sparc_linux22 sparc_linux24 sparc_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
-<sparc64_linux22 sparc64_linux24>
+<sparc64_linux22 sparc64_linux24 sparc64_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
-<ia64_linux24>
+<ia64_linux24 ia64_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
 <all>
        for m in ${MPS} ; do \
index 46d93a625cd68f1a8b19aa89a400ce92e851d508..d03f485ef66424a92dd39eee20bcc06ee32539bf 100644 (file)
@@ -35,6 +35,8 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
     struct socket *sockp;
     struct sockaddr_in myaddr;
     int code;
+    KERNEL_SPACE_DECL;
+    int pmtu = IP_PMTUDISC_DONT;
 
 
     /* We need a better test for this. if you need it back, tell us
@@ -64,6 +66,9 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
        return NULL;
     }
 
+    TO_USER_SPACE();
+    sockp->ops->setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+    TO_KERNEL_SPACE();
     return (struct osi_socket *)sockp;
 }
 
index 2ae09e0ef8962796a2577f94cf88362bb534fbbe..c7299d8b65287844d019b50ffbc1b87abc46ee8c 100644 (file)
@@ -662,7 +662,7 @@ void
 rx_StartServer(int donateMe)
 {
     register struct rx_service *service;
-    register int i, nProcs = 0;
+    register int i;
     SPLVAR;
     clock_NewTime();
 
@@ -701,6 +701,7 @@ rx_StartServer(int donateMe)
 #ifndef AFS_NT40_ENV
 #ifndef KERNEL
        char name[32];
+       static int nProcs;
 #ifdef AFS_PTHREAD_ENV
        pid_t pid;
        pid = (pid_t) pthread_self();
@@ -816,15 +817,16 @@ rxi_CleanupConnection(struct rx_connection *conn)
      * idle (refCount == 0) after rx_idlePeerTime (60 seconds) have passed.
      */
     MUTEX_ENTER(&rx_peerHashTable_lock);
-    if (--conn->peer->refCount <= 0) {
+    if (conn->peer->refCount < 2) {
        conn->peer->idleWhen = clock_Sec();
-       if (conn->peer->refCount < 0) {
-           conn->peer->refCount = 0;
+       if (conn->peer->refCount < 1) {
+           conn->peer->refCount = 1;
            MUTEX_ENTER(&rx_stats_mutex);
            rxi_lowPeerRefCount++;
            MUTEX_EXIT(&rx_stats_mutex);
        }
     }
+    conn->peer->refCount--;
     MUTEX_EXIT(&rx_peerHashTable_lock);
 
     MUTEX_ENTER(&rx_stats_mutex);
@@ -1014,6 +1016,20 @@ rx_DestroyConnection(register struct rx_connection *conn)
     USERPRI;
 }
 
+void
+rx_GetConnection(register struct rx_connection *conn)
+{
+    SPLVAR;
+
+    NETPRI;
+    AFS_RXGLOCK();
+    MUTEX_ENTER(&conn->conn_data_lock);
+    conn->refCount++;
+    MUTEX_EXIT(&conn->conn_data_lock);
+    AFS_RXGUNLOCK();
+    USERPRI;
+}
+
 /* Start a new rx remote procedure call, on the specified connection.
  * If wait is set to 1, wait for a free call channel; otherwise return
  * 0.  Maxtime gives the maximum number of seconds this call may take,
@@ -3984,6 +4000,7 @@ rxi_AttachServerProc(register struct rx_call *call,
            call->flags |= RX_CALL_WAIT_PROC;
            MUTEX_ENTER(&rx_stats_mutex);
            rx_nWaiting++;
+           rx_nWaited++;
            MUTEX_EXIT(&rx_stats_mutex);
            rxi_calltrace(RX_CALL_ARRIVAL, call);
            SET_CALL_QUEUE_LOCK(call, &rx_serverPool_lock);
@@ -5747,7 +5764,7 @@ rxi_ReapConnections(void)
                    MUTEX_ENTER(&rx_stats_mutex);
                    rx_stats.nPeerStructs--;
                    MUTEX_EXIT(&rx_stats_mutex);
-                   if (prev == *peer_ptr) {
+                   if (peer == *peer_ptr) {
                        *peer_ptr = next;
                        prev = next;
                    } else
@@ -6218,6 +6235,9 @@ rx_GetServerDebug(osi_socket socket, afs_uint32 remoteAddr,
        if (stat->version >= RX_DEBUGI_VERSION_W_GETPEER) {
            *supportedValues |= RX_SERVER_DEBUG_ALL_PEER;
        }
+       if (stat->version >= RX_DEBUGI_VERSION_W_WAITED) {
+           *supportedValues |= RX_SERVER_DEBUG_WAITED_CNT;
+       }
 
        stat->nFreePackets = ntohl(stat->nFreePackets);
        stat->packetReclaims = ntohl(stat->packetReclaims);
index 749777429c44d111fc5adbd81fbefdec9b44ecb2..2185d43e9654b2190745a40ee8b88b441b7452ba 100644 (file)
@@ -865,7 +865,11 @@ rxi_ReadPacket(int socket, register struct rx_packet *p, afs_uint32 * host,
             * never be cleaned up.
             */
            peer = rxi_FindPeer(*host, *port, 0, 0);
-           if (peer) {
+           /* Since this may not be associated with a connection,
+            * it may have no refCount, meaning we could race with
+            * ReapConnections
+            */
+           if (peer && (peer->refCount > 0)) {
                MUTEX_ENTER(&peer->peer_lock);
                hadd32(peer->bytesReceived, p->length);
                MUTEX_EXIT(&peer->peer_lock);
@@ -1160,6 +1164,7 @@ rxi_ReceiveDebugPacket(register struct rx_packet *ap, osi_socket asocket,
            tstat.packetReclaims = htonl(rx_packetReclaims);
            tstat.usedFDs = CountFDs(64);
            tstat.nWaiting = htonl(rx_nWaiting);
+           tstat.nWaited = htonl(rx_nWaited);
            queue_Count(&rx_idleServerQueue, np, nqe, rx_serverQueueEntry,
                        tstat.idleThreads);
            MUTEX_EXIT(&rx_serverPool_lock);
index a3c6324791e8646850c0263dcee9874466938d08..e4c7f9ca0951bae410abd5898da5d15ddfd58049 100644 (file)
@@ -100,7 +100,9 @@ rxi_GetHostUDPSocket(u_int ahost, u_short port)
     osi_socket socketFd = OSI_NULLSOCKET;
     struct sockaddr_in taddr;
     char *name = "rxi_GetUDPSocket: ";
-    int greedy = 0;
+#ifdef AFS_LINUX22_ENV
+    int pmtu=IP_PMTUDISC_DONT;
+#endif
 
 #if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) {
@@ -147,15 +149,16 @@ rxi_GetHostUDPSocket(u_int ahost, u_short port)
     fcntl(socketFd, F_SETFD, 1);
 #endif
 
+#ifndef AFS_DJGPP_ENV
     /* Use one of three different ways of getting a socket buffer expanded to
      * a reasonable size.
      */
     {
+       int greedy = 0;
        int len1, len2;
 
        len1 = 32766;
        len2 = rx_UdpBufSize;
-#ifndef AFS_DJGPP_ENV
        greedy =
            (setsockopt
             (socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
@@ -172,14 +175,19 @@ rxi_GetHostUDPSocket(u_int ahost, u_short port)
            (setsockopt
             (socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
              sizeof(len2)) >= 0);
-#endif /* AFS_DJGPP_ENV */
+       if (!greedy)
+           (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n",
+            name);
+       MUTEX_ENTER(&rx_stats_mutex);
+       rx_stats.socketGreedy = greedy;
+       MUTEX_EXIT(&rx_stats_mutex);
     }
-
-#ifndef AFS_DJGPP_ENV
-    if (!greedy)
-       (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n",
-        name);
 #endif /* AFS_DJGPP_ENV */
+
+#ifdef AFS_LINUX22_ENV
+    setsockopt(socketFd, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+#endif
+
     if (rxi_Listen(socketFd) < 0) {
        goto error;
     }
@@ -195,9 +203,6 @@ rxi_GetHostUDPSocket(u_int ahost, u_short port)
        close(socketFd);
 #endif
 
-    MUTEX_ENTER(&rx_stats_mutex);
-    rx_stats.socketGreedy = greedy;
-    MUTEX_EXIT(&rx_stats_mutex);
     return OSI_NULLSOCKET;
 }
 
index db94347e1d8d7e6a8fc21d30b8c427cfa54ef863..587e80c84b11c7d54c5da0b9796d8d4042d7c148 100644 (file)
@@ -109,6 +109,7 @@ MainCommand(as, arock)
     int withRxStats;
     int withWaiters;
     int withIdleThreads;
+    int withWaited;
     int withPeers;
     struct rx_debugStats tstats;
     char *portName, *hostName;
@@ -253,6 +254,7 @@ MainCommand(as, arock)
     withRxStats = (supportedDebugValues & RX_SERVER_DEBUG_RX_STATS);
     withWaiters = (supportedDebugValues & RX_SERVER_DEBUG_WAITER_CNT);
     withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_IDLE_THREADS);
+    withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_WAITED_CNT);
     withPeers = (supportedDebugValues & RX_SERVER_DEBUG_ALL_PEER);
 
     printf("Free packets: %d, packet reclaims: %d, calls: %d, used FDs: %d\n",
@@ -265,6 +267,8 @@ MainCommand(as, arock)
        printf("%d calls waiting for a thread\n", tstats.nWaiting);
     if (withIdleThreads)
        printf("%d threads are idle\n", tstats.idleThreads);
+    if (withWaited)
+       printf("%d calls have waited for a thread\n", tstats.nWaited);
 
     if (rxstats) {
        if (!withRxStats) {
index b395f79029702fe9721fecc5760db58453802ee6..b7c959ea6d2cf1609e426c8400d7aca6ae27c987 100644 (file)
@@ -110,7 +110,7 @@ fc_keysched(struct ktc_encryptionKey *key, fc_KeySchedule schedule)
 
 /* IN int encrypt; * 0 ==> decrypt, else encrypt */
 afs_int32
-fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+fc_ecb_encrypt(void * clear, void * cipher,
               fc_KeySchedule schedule, int encrypt)
 {
     afs_uint32 L, R;
@@ -135,8 +135,8 @@ fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
     memcpy(&L, clear, sizeof(afs_int32));
     memcpy(&R, clear + 1, sizeof(afs_int32));
 #else
-    L = ntohl(*clear);
-    R = ntohl(*(clear + 1));
+    L = ntohl(*((afs_uint32 *)clear));
+    R = ntohl(*((afs_uint32 *)clear + 1));
 #endif
 
     if (encrypt) {
@@ -185,8 +185,8 @@ fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
     memcpy(cipher, &L, sizeof(afs_int32));
     memcpy(cipher + 1, &R, sizeof(afs_int32));
 #else
-    *cipher = htonl(L);
-    *(cipher + 1) = htonl(R);
+    *((afs_int32 *)cipher) = htonl(L);
+    *((afs_int32 *)cipher + 1) = htonl(R);
 #endif
     return 0;
 }
@@ -203,7 +203,7 @@ fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
   afs_uint32 *xor; * 8 bytes of initialization vector *
 */
 afs_int32
-fc_cbc_encrypt(char *input, char *output, afs_int32 length,
+fc_cbc_encrypt(void *input, void *output, afs_int32 length,
               fc_KeySchedule key, afs_uint32 * xor, int encrypt)
 {
     afs_uint32 i, j;
@@ -215,7 +215,7 @@ fc_cbc_encrypt(char *input, char *output, afs_int32 length,
        for (i = 0; length > 0; i++, length -= 8) {
            /* get input */
            memcpy(t_input, input, sizeof(t_input));
-           input += sizeof(t_input);
+           input=((char *)input) + sizeof(t_input);
 
            /* zero pad */
            for (j = length; j <= 7; j++)
@@ -229,7 +229,7 @@ fc_cbc_encrypt(char *input, char *output, afs_int32 length,
 
            /* copy temp output and save it for cbc */
            memcpy(output, t_output, sizeof(t_output));
-           output += sizeof(t_output);
+           output=(char *)output + sizeof(t_output);
 
            /* calculate xor value for next round from plain & cipher text */
            xor[0] = t_input[0] ^ t_output[0];
@@ -244,7 +244,7 @@ fc_cbc_encrypt(char *input, char *output, afs_int32 length,
        for (i = 0; length > 0; i++, length -= 8) {
            /* get input */
            memcpy(t_input, input, sizeof(t_input));
-           input += sizeof(t_input);
+           input=((char *)input) + sizeof(t_input);
 
            /* no padding for decrypt */
            fc_ecb_encrypt(t_input, t_output, key, encrypt);
@@ -255,7 +255,7 @@ fc_cbc_encrypt(char *input, char *output, afs_int32 length,
 
            /* copy temp output */
            memcpy(output, t_output, sizeof(t_output));
-           output += sizeof(t_output);
+           output=((char *)output) + sizeof(t_output);
 
            /* calculate xor value for next round from plain & cipher text */
            xor[0] = t_input[0] ^ t_output[0];
index 83a4f53fb51e7769f0ad0493173d1a5bbe5ce1fc..5887d23cf40c7516ab033605fdd4fd2fecf288fe 100644 (file)
                /* no ticket good for longer than 30 days */
 #define MAXKTCTICKETLIFETIME (30*24*3600)
 #define MINKTCTICKETLEN              32
-#ifdef AFS_AIX_ENV
-#define MAXKTCTICKETLEN 344 /* XXX why must this be small? */
-#else
 #define        MAXKTCTICKETLEN       12000     /* was 344 */
-#endif
-
 #define        MAXKTCNAMELEN         64        /* name & inst should be 256 */
 #define MAXKTCREALMLEN       64        /* should be 256 */
 #define KTC_TIME_UNCERTAINTY (15*60)   /* max skew bet. machines' clocks */
index adffe54faa80e553092da9814b8413fff4978616..471b8ac13c1c70deb3f257365ea519d8d0bbe61c 100644 (file)
@@ -28,9 +28,9 @@ extern afs_int32 rxkad_EncryptPacket(const struct rx_connection *conn,
 /* domestic/fcrypt.c */
 extern int fc_keysched(struct ktc_encryptionKey *key,
                       fc_KeySchedule schedule);
-extern afs_int32 fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+extern afs_int32 fc_ecb_encrypt(void * clear, void * cipher,
                                fc_KeySchedule schedule, int encrypt);
-extern afs_int32 fc_cbc_encrypt(char *input, char *output, afs_int32 length,
+extern afs_int32 fc_cbc_encrypt(void *input, void *output, afs_int32 length,
                                fc_KeySchedule key, afs_uint32 * xor,
                                int encrypt);
 
index 8eb938e7aba758f29767b8e3e37ccac8a42353bb..2441a450fde5f1de1437b4fd5c9a3ee4913b6d62 100644 (file)
@@ -98,6 +98,30 @@ InitFSRequest(fs_ioctlRequest_t * rp)
     rp->nbytes = 0;
 }
 
+static BOOL
+IoctlDebug(void)
+{
+    static int init = 0;
+    static BOOL debug = 0;
+
+    if ( !init ) {
+        HKEY hk;
+
+        if (RegOpenKey (HKEY_LOCAL_MACHINE, 
+                         TEXT("Software\\OpenAFS\\Client"), &hk) == 0)
+        {
+            DWORD dwSize = sizeof(BOOL);
+            DWORD dwType = REG_DWORD;
+            RegQueryValueEx (hk, TEXT("IoctlDebug"), NULL, &dwType, (PBYTE)&debug, &dwSize);
+            RegCloseKey (hk);
+        }
+
+        init = 1;
+    }
+
+    return debug;
+}
+
 static long
 GetIoctlHandle(char *fileNamep, HANDLE * handlep)
 {
@@ -170,18 +194,9 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
         char szPath[MAX_PATH] = "";
         NETRESOURCE nr;
         DWORD res;
-        DWORD ioctlDebug = 0;
+        DWORD ioctlDebug = IoctlDebug();
         DWORD gle;
 
-        if (RegOpenKey (HKEY_LOCAL_MACHINE, 
-                        TEXT("Software\\OpenAFS\\Client"), &hk) == 0)
-        {
-            DWORD dwSize = sizeof(DWORD);
-            DWORD dwType = REG_DWORD;
-            RegQueryValueEx (hk, TEXT("IoctlDebug"), NULL, &dwType, (PBYTE)&ioctlDebug, &dwSize);
-            RegCloseKey (hk);
-        }
-
         gle = GetLastError();
         if (gle && ioctlDebug ) {
             char buf[4096];
@@ -264,19 +279,31 @@ Transceive(HANDLE handle, fs_ioctlRequest_t * reqp)
 {
     long rcount;
     long ioCount;
+    DWORD gle;
 
     rcount = reqp->mp - reqp->data;
-    if (rcount <= 0)
+    if (rcount <= 0) {
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl Transceive rcount <= 0: %d\r\n",rcount);
        return EINVAL;          /* not supposed to happen */
+    }
 
     if (!WriteFile(handle, reqp->data, rcount, &ioCount, NULL)) {
        /* failed to write */
-       return GetLastError();
+       gle = GetLastError();
+
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl Transceive WriteFile failed: 0x%X\r\n",gle);
+        return gle;
     }
 
     if (!ReadFile(handle, reqp->data, sizeof(reqp->data), &ioCount, NULL)) {
        /* failed to read */
-       return GetLastError();
+       gle = GetLastError();
+
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl Transceive ReadFile failed: 0x%X\r\n",gle);
+        return gle;
     }
 
     reqp->nbytes = ioCount;    /* set # of bytes available */
@@ -299,6 +326,9 @@ UnmarshallLong(fs_ioctlRequest_t * reqp, long *valp)
 {
     /* not enough data left */
     if (reqp->nbytes < 4) {
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl UnmarshallLong reqp->nbytes < 4: %d\r\n",
+                     reqp->nbytes);
        return -1;
     }
 
@@ -320,8 +350,11 @@ MarshallString(fs_ioctlRequest_t * reqp, char *stringp)
        count = 1;
 
     /* watch for buffer overflow */
-    if ((reqp->mp - reqp->data) + count > sizeof(reqp->data))
+    if ((reqp->mp - reqp->data) + count > sizeof(reqp->data)) {
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl MarshallString buffer overflow\r\n");
        return -1;
+    }
 
     if (stringp)
        memcpy(reqp->mp, stringp, count);
@@ -389,15 +422,19 @@ fs_GetFullPath(char *pathp, char *outPathp, long outSize)
        newPath[2] = 0;
        if (!SetCurrentDirectory(newPath)) {
            code = GetLastError();
+
+            if ( IoctlDebug() )
+                fprintf(stderr, "pioctl fs_GetFullPath SetCurrentDirectory(%s) failed: 0x%X\r\n",
+                         newPath, code);
            return code;
        }
     }
 
     /* now get the absolute path to the current wdir in this drive */
     GetCurrentDirectory(sizeof(tpath), tpath);
-       if (tpath[1] == ':')
-           strcpy(outPathp, tpath + 2);        /* skip drive letter */
-       else if ( tpath[0] == '\\' && tpath[1] == '\\') {
+    if (tpath[1] == ':')
+        strcpy(outPathp, tpath + 2);   /* skip drive letter */
+    else if ( tpath[0] == '\\' && tpath[1] == '\\') {
         /* UNC path - strip off the server and sharename */
         int i, count;
         for ( i=2,count=2; count < 4 && tpath[i]; i++ ) {
@@ -417,10 +454,10 @@ fs_GetFullPath(char *pathp, char *outPathp, long outSize)
 
     /* if there is a non-null name after the drive, append it */
     if (*firstp != 0) {
-               int len = strlen(outPathp);
-               if (outPathp[len-1] != '\\' && outPathp[len-1] != '/') 
-                       strcat(outPathp, "\\");
-               strcat(outPathp, firstp);
+        int len = strlen(outPathp);
+        if (outPathp[len-1] != '\\' && outPathp[len-1] != '/') 
+            strcat(outPathp, "\\");
+        strcat(outPathp, firstp);
     }
 
     /* finally, if necessary, switch back to our home drive letter */
@@ -484,10 +521,16 @@ pioctl(char *pathp, long opcode, struct ViceIoctl *blobp, int follow)
     }
 
     /* now unmarshall the return value */
-    UnmarshallLong(&preq, &temp);
+    if (UnmarshallLong(&preq, &temp) != 0) {
+        CloseHandle(reqHandle);
+        return -1;
+    }
+
     if (temp != 0) {
        CloseHandle(reqHandle);
        errno = CMtoUNIXerror(temp);
+        if ( IoctlDebug() )
+            fprintf(stderr, "pioctl temp != 0: %d\r\n",temp);
        return -1;
     }
 
index e4f6bddb6c35e57141f206a68ca94d9709dd7f26..d5b152640875c61292a1e0cd0545fbaaac633a46 100644 (file)
@@ -569,8 +569,7 @@ verifyInterfaceAddress(ame, info, aservers)
     for (j = 0, found = 0; j < count; j++) {
        for (i = 0; i < totalServers; i++) {
            if (info)
-               tmpAddr =
-                   (afs_uint32) info->hostAddr[i].sin_addr.s_addr;
+               tmpAddr = (afs_uint32) info->hostAddr[i].sin_addr.s_addr;
            else
                tmpAddr = aservers[i];
            if (myAddr[j] == tmpAddr) {
index b72a8223272e0abf84e20ba0579d7749e82822bf..b69a66fe405154bf99b4c5c4a5eee1b850f5a397 100644 (file)
@@ -359,4 +359,15 @@ extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
                           afs_int32 transMode, struct ubik_trans **transPtr);
 extern int ubik_EndTrans(register struct ubik_trans *transPtr);
 
+/* uinit.c */
+
+extern afs_int32 ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName,
+                                afs_int32 sauth, 
+                                struct ubik_client **uclientp,
+                                int (*secproc) (), char *funcName, 
+                                afs_int32 gen_rxkad_level, 
+                                afs_int32 maxservers, afs_int32 serviceid, 
+                                afs_int32 deadtime, afs_uint32 server, 
+                                afs_uint32 port, afs_int32 usrvid);
+
 #endif /* UBIK_H */
index 0d804083e3e52d5cadb9836b5a4e841101b76007..603d174d6e172dbc5370dd442c2a4d8b4028ee38 100644 (file)
@@ -436,9 +436,11 @@ afs_vsnprintf(char *p, size_t avail, const char *fmt, va_list ap)
                } else {
                    x = "%u.%u.%u.%u";
                }
-               sprintf(xbuf, x, (UVAL & 0xff000000) >> 24,
-                       (UVAL & 0x00ff0000) >> 16, (UVAL & 0x0000ff00) >> 8,
-                       (UVAL & 0x000000ff));
+               /* typecast to whatever '%u' is! */
+               sprintf(xbuf, x, (unsigned int)((UVAL & 0xff000000) >> 24),
+                       (unsigned int)((UVAL & 0x00ff0000) >> 16), 
+                       (unsigned int)((UVAL & 0x0000ff00) >> 8),
+                       (unsigned int)(UVAL & 0x000000ff));
                x = xbuf;
                len = strlen(xbuf);
            }
index 1cad3f1c6f7175bd4913b9b11cd88c6cba86b6b2..3bd5167a5a74630abb94b0e5a6d156b7f97db9d7 100644 (file)
@@ -1041,8 +1041,8 @@ static int namei_ListAFSSubDirs(IHandle_t * dirIH,
                                                  struct ViceInodeInfo *,
                                                  char *, char *), FILE * fp,
                                int (*judgeFun) (struct ViceInodeInfo *,
-                                                int vid),
-                               int singleVolumeNumber);
+                                                int vid, void *),
+                               int singleVolumeNumber, void *rock);
 
 
 /* WriteInodeInfo
@@ -1093,8 +1093,9 @@ VerifyDirPerms(char *path)
  */
 int
 ListViceInodes(char *devname, char *mountedOn, char *resultFile,
-              int (*judgeInode) (struct ViceInodeInfo * info, int vid),
-              int singleVolumeNumber, int *forcep, int forceR, char *wpath)
+              int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
+              int singleVolumeNumber, int *forcep, int forceR, char *wpath, 
+              void *rock)
 {
     FILE *fp = (FILE *) - 1;
     int ninodes;
@@ -1114,7 +1115,7 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile,
 
     ninodes =
        namei_ListAFSFiles(mountedOn, WriteInodeInfo, fp, judgeInode,
-                          singleVolumeNumber);
+                          singleVolumeNumber, rock);
 
     if (!resultFile)
        return ninodes;
@@ -1167,8 +1168,8 @@ int
 namei_ListAFSFiles(char *dev,
                   int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
                                    char *), FILE * fp,
-                  int (*judgeFun) (struct ViceInodeInfo *, int),
-                  int singleVolumeNumber)
+                  int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+                  int singleVolumeNumber, void *rock)
 {
     IHandle_t ih;
     namei_t name;
@@ -1188,7 +1189,7 @@ namei_ListAFSFiles(char *dev,
        namei_HandleToVolDir(&name, &ih);
        ninodes =
            namei_ListAFSSubDirs(&ih, writeFun, fp, judgeFun,
-                                singleVolumeNumber);
+                                singleVolumeNumber, rock);
        if (ninodes < 0)
            return ninodes;
     } else {
@@ -1212,7 +1213,7 @@ namei_ListAFSFiles(char *dev,
                    if (!DecodeVolumeName(dp2->d_name, &ih.ih_vid)) {
                        ninodes +=
                            namei_ListAFSSubDirs(&ih, writeFun, fp, judgeFun,
-                                                0);
+                                                0, rock);
                    }
                }
                closedir(dirp2);
@@ -1239,8 +1240,8 @@ static int
 namei_ListAFSSubDirs(IHandle_t * dirIH,
                     int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
                                      char *), FILE * fp,
-                    int (*judgeFun) (struct ViceInodeInfo *, int),
-                    int singleVolumeNumber)
+                    int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+                    int singleVolumeNumber, void *rock)
 {
     IHandle_t myIH = *dirIH;
     namei_t name;
@@ -1283,7 +1284,7 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
                info.linkCount =
                    namei_GetLinkCount(&linkHandle, (Inode) 0, 0);
            }
-           if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber))
+           if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber, rock))
                continue;
 
            if ((*writeFun) (fp, &info, path1, dp1->d_name) < 0) {
@@ -1345,7 +1346,7 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
                                continue;
                            }
                            if (judgeFun
-                               && !(*judgeFun) (&info, singleVolumeNumber))
+                               && !(*judgeFun) (&info, singleVolumeNumber, rock))
                                continue;
 
                            if ((*writeFun) (fp, &info, path3, dp3->d_name) <
index 7194503e6b0e0b536767a92e7c356576f9fee66e..f787b5ae39783419d2b1daf11cf959735e6bd5f5 100644 (file)
@@ -65,14 +65,14 @@ struct ilist {
     afs_int32 freePtr;         /* first free index in this table */
     Inode inode[MAXATONCE];    /* inode # */
     afs_int32 count[MAXATONCE];        /* link count */
-} *allInodes = 0;
+};
 
 /* called with a structure specifying info about the inode, and our rock (which
  * is the volume ID.  Returns true if we should keep this inode, otherwise false.
  * Note that ainfo->u.param[0] is always the volume ID, for any vice inode.
  */
 static int
-NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid)
+NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist *allInodes)
 {
     struct ilist *ti;
     register afs_int32 i;
@@ -113,7 +113,7 @@ nuke(char *aname, afs_int32 avolid)
 {
     /* first process the partition containing this junk */
     struct afs_stat tstat;
-    struct ilist *ti, *ni;
+    struct ilist *ti, *ni, *li=NULL;
     register afs_int32 code;
     int i, forceSal;
     char devName[64], wpath[100];
@@ -127,6 +127,7 @@ nuke(char *aname, afs_int32 avolid)
 #endif
 #endif /* AFS_NAMEI_ENV */
     IHandle_t *fileH;
+    struct ilist *allInodes = 0;
 
     if (avolid == 0)
        return EINVAL;
@@ -169,11 +170,11 @@ nuke(char *aname, afs_int32 avolid)
 #ifdef AFS_NAMEI_ENV
     code =
        ListViceInodes(lastDevComp, aname, NULL, NukeProc, avolid, &forceSal,
-                      0, wpath);
+                      0, wpath, allInodes);
 #else
     code =
        ListViceInodes(lastDevComp, aname, "/tmp/vNukeXX", NukeProc, avolid,
-                      &forceSal, 0, wpath);
+                      &forceSal, 0, wpath, allInodes);
     unlink("/tmp/vNukeXX");    /* clean it up now */
 #endif
     if (code == 0) {
@@ -211,8 +212,10 @@ nuke(char *aname, afs_int32 avolid)
 #endif /* AFS_NAMEI_ENV */
            }
            ni = ti->next;
-           free(ti);
+           if (li) free(li);
+           li = ti;
        }
+       if (li) free(li);
        code = 0;               /* we really don't care about it except for debugging */
        allInodes = NULL;
 
@@ -236,8 +239,10 @@ nuke(char *aname, afs_int32 avolid)
        /* just free things */
        for (ti = allInodes; ti; ti = ni) {
            ni = ti->next;
-           free(ti);
+           if (li) free(li);
+           li = ti;
        }
+       if (li) free(li);
        allInodes = NULL;
     }
     ReleaseWriteLock(&localLock);
index f7d931d4b2e67ca0605e6ea0c8cf3ecd656b3191..0e673b0cb831736550b8b4a2753df721ddafce93 100644 (file)
@@ -1520,7 +1520,7 @@ CountVolumeInodes(register struct ViceInodeInfo *ip, int maxInodes,
 }
 
 int
-OnlyOneVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber)
+OnlyOneVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber, void *rock)
 {
     if (inodeinfo->u.vnode.vnodeNumber == INODESPECIAL)
        return (inodeinfo->u.special.parentId == singleVolumeNumber);
@@ -1556,7 +1556,7 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber)
     if ((err =
         ListViceInodes(dev, fileSysPath, path,
                        singleVolumeNumber ? OnlyOneVolume : 0,
-                       singleVolumeNumber, &forceSal, forceR, wpath)) < 0) {
+                       singleVolumeNumber, &forceSal, forceR, wpath, NULL)) < 0) {
        if (err == -2) {
            Log("*** I/O error %d when writing a tmp inode file %s; Not salvaged %s ***\nIncrease space on partition or use '-tmpdir'\n", errno, path, dev);
            return -1;