]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r500,
authorSam Hartman <hartmans@debian.org>
Fri, 2 Aug 2002 04:37:58 +0000 (04:37 +0000)
committerSam Hartman <hartmans@debian.org>
Fri, 2 Aug 2002 04:37:58 +0000 (04:37 +0000)
which included commits to RCS files with non-trunk default branches.

71 files changed:
acconfig.h
acinclude.m4
configure-libafs.in
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c
src/afs/DARWIN/osi_vm.c
src/afs/DUX/osi_vfsops.c
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_prototypes.h
src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_sysctl.c
src/afs/LINUX/osi_vfsops.c
src/afs/SOLARIS/osi_machdep.h
src/afs/SOLARIS/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_access.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_dirops.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_link.c
src/afs/VNOPS/afs_vnop_open.c
src/afs/VNOPS/afs_vnop_read.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_rename.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_cell.c
src/afs/afs_dynroot.c
src/afs/afs_nfsdisp.c
src/afs/afs_osi.c
src/afs/afs_prototypes.h
src/afs/afs_stats.h
src/afs/afs_trace.et
src/afs/afs_vcache.c
src/afsd/afsd.c
src/cf/linux-test2.m4
src/config/afs_args.h
src/config/param.alpha_linux_22.h
src/config/param.alpha_linux_24.h
src/config/param.ia64_linux24.h
src/config/param.parisc_linux24.h
src/config/param.s390_linux22.h
src/config/param.s390_linux24.h
src/config/param.sparc64_linux24.h
src/config/param.sparc_linux24.h
src/kauth/krb_udp.c
src/libafsrpc/Makefile.in
src/login/Makefile.in
src/pam/Makefile.in
src/rx/LINUX/rx_kmutex.h
src/rx/Makefile.in
src/rx/rx_clock.c
src/rx/rx_event.c
src/rx/rx_lwp.c
src/rx/rx_pthread.c
src/rxkad/rxkad_common.c
src/tbutc/Makefile.in
src/tools/install/RPM.README
src/tools/install/afs_uninstall
src/tools/install/install_afs
src/tools/install/make_rpm_source
src/tools/install/unpack_cmd
src/tools/openafs-tools-cmd.README
src/util/dirpath_nt.h
src/util/uuid.c
src/venus/Makefile.in
src/vol/fssync.c
src/vol/partition.h
src/volser/vos.c
src/xstat/xstat_cm_test.c

index f2d08791707183f723e4c48bb9611f0e4460eedd..5b182b46ac3bf47269ac8662fb5c6444c1df1327 100644 (file)
@@ -29,6 +29,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef FULL_LISTVOL_SWITCH
 
 #undef INODE_SETATTR_NOT_VOID
+#undef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
 #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
 #undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
 #undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
index 66568869215800f6c9ade05cce56bc2a863384d1..171bbd30c19a3f0091df14c4ec70620b4385278e 100644 (file)
@@ -138,6 +138,7 @@ case $system in
                   [LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs/LINUX)]
                 )
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
                 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
@@ -150,6 +151,9 @@ case $system in
                 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
                  AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
                 fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK)
+                fi
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
                 fi
@@ -269,6 +273,15 @@ else
                sparc-sun-solaris2.9)
                        AFS_SYSNAME="sun4x_59"
                        ;;
+               i386-pc-solaris2.7)
+                       AFS_SYSNAME="sunx86_57"
+                       ;;
+               i386-pc-solaris2.8)
+                       AFS_SYSNAME="sunx86_58"
+                       ;;
+               i386-pc-solaris2.9)
+                       AFS_SYSNAME="sunx86_59"
+                       ;;
                alpha*-dec-osf4.0*)
                        AFS_SYSNAME="alpha_dux40"
                        ;;
index f707876575210a57539ff6d2b2c236a153e5c152..fe9f1102d5da42fca8def0a079f9cbd57c714e8c 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(Makefile.common)
-AM_INIT_AUTOMAKE(openafs-libafs,1.2.5)
+AM_INIT_AUTOMAKE(openafs-libafs,1.2.6)
 AC_CONFIG_HEADER(config/afsconfig.h)
 define(OPENAFS_CONFIGURE_LIBAFS)
 
index e8d7665a131a90ae65307121f8fa50346db80b84..c01099cc2e0a102cdf26f18425b359853de27e76 100644 (file)
@@ -435,14 +435,14 @@ int SRXAFSCB_GetCellServDB(
     struct rx_call *a_call,
     afs_int32 a_index,
     char **a_name,
-    afs_int32 *a_hosts)
+    serverList *a_hosts)
 {
     char *t_name;
 
     t_name = (char *)malloc(AFSNAMEMAX);
     t_name[0] = '\0';
     *a_name = t_name;
-    memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
+    a_hosts->serverList_len = 0;
     return 0;
 }
 
@@ -472,10 +472,11 @@ int SRXAFSCB_GetLocalCell(
 {
     char *t_name;
 
-    t_name = (char *)malloc(AFSNAMEMAX);
     if (cm_rootCellp) {
+       t_name = (char *)malloc(strlen(cm_rootCellp->namep)+1);
         strcpy(t_name, cm_rootCellp->namep);
     } else {
+       t_name = (char *)malloc(1);
        t_name[0] = '\0';
     }
     *a_name = t_name;
index e1c8c85d998cbe2c788de52ee8c6eb27a6484456..e32a57d47772b145252c0d800e4974de457f690a 100644 (file)
@@ -9,6 +9,8 @@
 
 //#define NOSERVICE 1
 
+#define NOMOREFILESFIX 1
+
 #include <afs/param.h>
 #include <afs/stds.h>
 
@@ -2276,6 +2278,7 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                 namep += entryLength;
                 tcounter++;            /* which proto entry we're looking at */
         }
+#ifndef NOMOREFILESFIX
        /* 
         * NOTE: We can determine what OS (NT4.0, W2K, W9X, etc)
         * the client is running by reading the protocol signature.
@@ -2310,6 +2313,8 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                       */
               }
        }
+       // NOMOREFILESFIX
+#endif
 
         if (NTProtoIndex != -1) {
                protoIndex = NTProtoIndex;
index fad864de709584c9bbf595d4477be8ff5b7ce7d2..ef4e7e2b8fff83bb8393de4eb004dcca6131cabc 100644 (file)
@@ -1148,7 +1148,9 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                spacep = cm_GetSpace();
                smb_StripLastComponent(spacep->data, &lastComp,
                                        (char *)(&p->parmsp[3]));
-               if (strcmp(lastComp, "\\desktop.ini") == 0) {
+               /* Make sure that lastComp is not NULL */
+               if (lastComp)
+                   if (strcmp(lastComp, "\\desktop.ini") == 0) {
                        code = cm_NameI(cm_rootSCachep, spacep->data,
                                        CM_FLAG_CASEFOLD
                                          | CM_FLAG_DIRSEARCH
index 915b775e7d4cc5d0ff61e57a0b94832ec0c51da8..7c133b81f296299916994a80026628c0e221aa15 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.5 2002/05/10 23:43:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.6 2002/08/02 04:28:49 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /* Standard vendor system headers */
 #include "../afs/afsincludes.h" /* Afs-based standard headers */
@@ -193,7 +193,7 @@ void osi_VM_TryReclaim(avc, slept)
         return;
     }
 #ifdef AFS_DARWIN14_ENV
-    if (vp->v_ubcinfo->ui_refcount > 1) {
+    if (vp->v_ubcinfo->ui_refcount > 1 || vp->v_ubcinfo->ui_mapped) {
         simple_unlock(&vp->v_interlock);
         AFS_RELE(vp);
         return;
index d076c2434db11147f0585a582bcbca7e6ea5382e..f66430cee2c3f87c19237782915afced725025ea 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vfsops.c,v 1.1.1.7 2002/05/10 23:43:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vfsops.c,v 1.1.1.8 2002/08/02 04:28:50 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -484,14 +484,16 @@ int mp_Afs_init(void)
     extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall();
     
     AFS_GLOCK();
-    sysent[AFS_SYSCALL].sy_call = afs3_syscall;
+    ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_call = afs3_syscall;
 #ifdef SY_NARG
-    sysent[AFS_SYSCALL].sy_info = 6;
+    ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_info = 6;
 #else
-    sysent[AFS_SYSCALL].sy_parallel = 0;
-    sysent[AFS_SYSCALL].sy_narg = 6;
+    ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_parallel = 0;
+    ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_narg = 6;
 #endif
-    sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
+
+    ((struct sysent *) (&sysent[SYS_setgroups]))->sy_call =
+      Afs_xsetgroups;
     afs_xioctl_func = afsxioctl;    
     afs_xsetgroups_func = afsxsetgroups;
     afs_syscall_func = afssyscall;
index 7e79a07f5c571db8193d78212d05116ac311b384..c374a3575322f0f62ab11469430ac27109733e46 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.10 2002/05/10 23:44:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.11 2002/08/02 04:28:55 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
@@ -24,7 +24,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.10 2002/0
 #include "../afs/afs_atomlist.h"
 #include "../afs/afs_lhash.h"
 
-#define MAX_KMALLOC_SIZE (131072-16) /* Max we can alloc in physmem */
+#define MAX_KMALLOC_SIZE PAGE_SIZE /* Max we should alloc with kmalloc */
 #define MAX_BUCKET_LEN 30 /* max. no. of entries per buckets we expect to see */
 #define STAT_INTERVAL 8192 /* we collect stats once every STAT_INTERVAL allocs*/
 
@@ -76,17 +76,16 @@ static int hash_equal(const void *a, const void *b)
  *  returns NULL if we failed to allocate memory.
  *  or pointer to memory if we succeeded.
  */
-static void *linux_alloc(unsigned int asize)
+static void *linux_alloc(unsigned int asize, int drop_glock)
 {
     void *new = NULL;
-    int has_afs_glock = ISAFS_GLOCK();
-
-    /* if global lock has been held save this info and unlock it. */
-    if (has_afs_glock)
-        AFS_GUNLOCK();
+    int max_retry = 10;
+    int haveGlock = ISAFS_GLOCK();
 
     /*  if we can use kmalloc use it to allocate the required memory. */
-    if (asize <  MAX_KMALLOC_SIZE) {
+    while(!new && max_retry)
+    {
+        if (asize <=  MAX_KMALLOC_SIZE) {
         new = (void *)(unsigned long)kmalloc(asize, 
 #ifdef GFP_NOFS
                                             GFP_NOFS
@@ -96,30 +95,32 @@ static void *linux_alloc(unsigned int asize)
                                             );
         if (new) /* piggy back alloc type */
             (unsigned long)new |= KM_TYPE;
-    }
-    if (!new) { /* otherwise use vmalloc  */
-       int max_wait = 10;
-        while (!(new = (void *)vmalloc(asize))) {
-            if (--max_wait <=0) {
-               break;
+        } else {
+            new = (void *)vmalloc(asize);
+           if (new) /* piggy back alloc type */
+               (unsigned long)new |= VM_TYPE;
             }
+
+       if (!new) {
 #ifdef set_current_state
            set_current_state(TASK_INTERRUPTIBLE);
 #else
            current->state = TASK_INTERRUPTIBLE;
 #endif
+           if (drop_glock && haveGlock) AFS_GUNLOCK();
            schedule_timeout(HZ);
+           if (drop_glock && haveGlock) AFS_GLOCK();
+#ifdef set_current_state
+            set_current_state(TASK_RUNNING);
+#else
+            current->state = TASK_RUNNING;
+#endif
+            --max_retry;
         }
-       if (new) /* piggy back alloc type */
-           (unsigned long)new |= VM_TYPE;
     }
     if (new)
        memset(MEMADDR(new), 0, asize);
 
-    /* if the global lock had been held, lock it again. */
-    if (has_afs_glock)
-        AFS_GLOCK();
-
     return new;
 }
 
@@ -282,27 +283,27 @@ DECLARE_MUTEX(afs_linux_alloc_sem);
 struct semaphore afs_linux_alloc_sem = MUTEX;
 #endif
 
-void *osi_linux_alloc(unsigned int asize)
+void *osi_linux_alloc(unsigned int asize, int drop_glock)
 {
     void *new = NULL;
     struct osi_linux_mem *lmem;
 
+    new = linux_alloc(asize, drop_glock); /* get a chunk of memory of size asize */
+
+    if (!new) {
+       printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
+       return new;
+    }
+
     down(&afs_linux_alloc_sem);
 
-    if (allocator_init == 0) { /* allocator hasn't been initialized yet */
+    /* allocator hasn't been initialized yet */
+    if (allocator_init == 0) {
        if (linux_alloc_init() == 0) {
            goto error;
         }
        allocator_init = 1; /* initialization complete */
     }
-
-    up(&afs_linux_alloc_sem);
-    new = linux_alloc(asize); /* get a chunk of memory of size asize */
-    down(&afs_linux_alloc_sem);
-    if (!new) {
-       printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
-       goto error;
-    }
     
     /* get an atom to store the pointer to the chunk */
     lmem = (struct osi_linux_mem *)afs_atomlist_get(al_mem_pool);
index e2b30ee84e23ea165ed10a5091a14f407ca91a81..615fb453c9466f4baf2030fe4e02b9567361b3b3 100644 (file)
@@ -14,7 +14,7 @@
 #define _OSI_PROTO_H_
 
 /* osi_alloc.c */
-extern void *osi_linux_alloc(unsigned int size);
+extern void *osi_linux_alloc(unsigned int size, int drop_glock);
 extern void osi_linux_free(void *addr);
 extern void osi_linux_free_afs_memory(void);
 /* Debugging aid */
index 57f84a704d94ca0d6135cf98720054011408ceef..edf1e6dfaa4bf40b45058da2fe1deea5f9c85410 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.8 2002/01/30 14:01:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.9 2002/08/02 04:28:56 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -18,51 +18,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.8 2002/01
 
 
 
-#if defined(AFS_GLOBAL_SUNLOCK)
 static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
-#endif
-
 void afs_osi_Wakeup(char *event);
 void afs_osi_Sleep(char *event);
 
 static char waitV, dummyV;
 
-#if ! defined(AFS_GLOBAL_SUNLOCK)
-
-/* call procedure aproc with arock as an argument, in ams milliseconds */
-static struct timer_list *afs_osi_CallProc(void *aproc, void *arock, int ams)
-{
-    struct timer_list *timer = NULL;
-    
-    timer = (struct timer_list*)osi_Alloc(sizeof(struct timer_list));
-    if (timer) {
-       init_timer(timer);
-       timer->expires = (ams*afs_hz)/1000 + 1;
-       timer->data = (unsigned long)arock;
-       timer->function = aproc;
-       add_timer(timer);
-    }
-    return timer;
-}
-
-/* cancel a timeout, whether or not it has already occurred */
-static int afs_osi_CancelProc(struct timer_list *timer)
-{
-    if (timer) {
-       del_timer(timer);
-       osi_Free(timer, sizeof(struct timer_list));
-    }
-    return 0;
-}
-
-static AfsWaitHack()
-{
-    AFS_STATCNT(WaitHack);
-    wakeup(&waitV);
-}
-
-#endif
-
 void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle)
 {
     AFS_STATCNT(osi_InitWaitHandle);
@@ -96,25 +57,18 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
     if (ahandle)
        ahandle->proc = (caddr_t) current;
 
-    AFS_ASSERT_GLOCK();
     do {
-#if    defined(AFS_GLOBAL_SUNLOCK)
-        code = osi_TimedSleep(&waitV, ams, 1);
-        if (code == EINTR) {
-                if (aintok) 
-                   return EINTR;
-        }
-#else
-       timer = afs_osi_CallProc(AfsWaitHack, (char *) current, ams);
-       afs_osi_Sleep(&waitV);
-       afs_osi_CancelProc(timer);
-#endif /* AFS_GLOBAL_SUNLOCK */
+        AFS_ASSERT_GLOCK();
+        code = 0;
+        code = osi_TimedSleep(&waitV, ams, aintok);
+
+        if (code) break;
        if (ahandle && (ahandle->proc == (caddr_t) 0)) {
            /* we've been signalled */
-           return EINTR;
+           break;
        }
     } while (osi_Time() < endTime);
-    return 0;
+    return code;
 }
 
 
@@ -185,7 +139,7 @@ static void afs_addevent(char *event)
     
     AFS_ASSERT_GLOCK();
     hashcode = afs_evhash(event);
-    newp = osi_AllocSmallSpace(sizeof(afs_event_t));
+    newp = osi_linux_alloc(sizeof(afs_event_t), 0);
     afs_evhashcnt++;
     newp->next = afs_evhasht[hashcode];
     afs_evhasht[hashcode] = newp;
@@ -199,32 +153,43 @@ static void afs_addevent(char *event)
     newp->refcount = 0;
 }
 
+#ifndef set_current_state
+#define set_current_state(x)            current->state = (x);
+#endif
 
 /* Release the specified event */
 #define relevent(evp) ((evp)->refcount--)
 
-/* afs_osi_Sleep -- waits for an event to be notified. */
-
+/* afs_osi_Sleep -- waits for an event to be notified, ignoring signals.
+ * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE
+ *   can wake up, even if all signals are blocked
+ * - TODO: handle signals correctly by passing an indication back to the
+ *   caller that the wait has been interrupted and the stack should be cleaned
+ *   up preparatory to signal delivery
+ */
 void afs_osi_Sleep(char *event)
 {
     struct afs_event *evp;
     int seq;
+#ifdef DECLARE_WAITQUEUE
+    DECLARE_WAITQUEUE(wait, current);
+#else
+    struct wait_queue wait = { current, NULL };
+#endif
 
     evp = afs_getevent(event);
     if (!evp) {
-       /* Can't block because allocating a new event would require dropping
-         * the GLOCK, which may cause us to miss the wakeup.  So call the
-         * allocator then return immediately.  We'll find the new event next
-         * time around without dropping the GLOCK. */
         afs_addevent(event);
-        return;
+       evp = afs_getevent(event);
     }
 
     seq = evp->seq;
 
+    add_wait_queue(&evp->cond, &wait);
     while (seq == evp->seq) {
        sigset_t saved_set;
 
+       set_current_state(TASK_INTERRUPTIBLE);
        AFS_ASSERT_GLOCK();
        AFS_GUNLOCK();
        spin_lock_irq(&current->sigmask_lock);
@@ -233,7 +198,7 @@ void afs_osi_Sleep(char *event)
        recalc_sigpending(current);
        spin_unlock_irq(&current->sigmask_lock);
 
-       interruptible_sleep_on(&evp->cond);
+       schedule();
 
        spin_lock_irq(&current->sigmask_lock);
        current->blocked = saved_set;
@@ -241,6 +206,9 @@ void afs_osi_Sleep(char *event)
        spin_unlock_irq(&current->sigmask_lock);
        AFS_GLOCK();
     }
+    remove_wait_queue(&evp->cond, &wait);
+    set_current_state(TASK_RUNNING);
+
     relevent(evp);
 }
 
@@ -256,29 +224,40 @@ void afs_osi_Sleep(char *event)
  */
 static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
 {
-    long t = ams * HZ / 1000;
+    int code = 0;
+    long ticks = (ams * HZ / 1000) + 1;
     struct afs_event *evp;
+#ifdef DECLARE_WAITQUEUE
+    DECLARE_WAITQUEUE(wait, current);
+#else
+    struct wait_queue wait = { current, NULL };
+#endif
 
     evp = afs_getevent(event);
     if (!evp) {
-        /* Can't block because allocating a new event would require dropping
-         * the GLOCK, which may cause us to miss the wakeup.  So call the
-         * allocator then return immediately.  We'll find the new event next
-         * time around without dropping the GLOCK. */
         afs_addevent(event);
-        return EAGAIN;
+       evp = afs_getevent(event);
     }
 
+    add_wait_queue(&evp->cond, &wait);
+    set_current_state(TASK_INTERRUPTIBLE);
+    /* always sleep TASK_INTERRUPTIBLE to keep load average
+       from artifically increasing. */
+
     AFS_GUNLOCK();
-    if (aintok)
-       t = interruptible_sleep_on_timeout(&evp->cond, t);
-    else
-       t = sleep_on_timeout(&evp->cond, t);
+    if (aintok) {
+        if (schedule_timeout(ticks))
+            code = EINTR;
+    } else
+        schedule_timeout(ticks);
     AFS_GLOCK();
 
+    remove_wait_queue(&evp->cond, &wait);
+    set_current_state(TASK_RUNNING);
+
     relevent(evp);
 
-    return t ? EINTR : 0;
+    return code;
 }
 
 
index f8c3383467f16c013e8375c29a0c88cb47be98c9..eabc309157507738c856e12e26b7bfc92c6978fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * osi_sysctl.c: Linux sysctl interface to OpenAFS
  *
- * $Id: osi_sysctl.c,v 1.1 2002/05/10 23:44:08 hartmans Exp $
+ * $Id: osi_sysctl.c,v 1.1.1.2 2002/08/02 04:28:56 hartmans Exp $
  *
  * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
  */
@@ -34,6 +34,9 @@ static ctl_table afs_sysctl_table[] = {
         {3, "hm_retry_int",
          &hm_retry_int, sizeof(afs_int32), 0644, NULL,
          &proc_dointvec},
+        {4, "GCPAGs",
+         &afs_gcpags, sizeof(afs_int32), 0644, NULL,
+         &proc_dointvec},
        {0}
 };
 
index 69dda6464e46c2ac01341e4fd96821d6adc5c989..dbc5ce85c9767d6fc5e2d13078127270a27f8dfa 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.12 2002/05/10 23:44:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.13 2002/08/02 04:28:57 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
@@ -463,3 +463,13 @@ void vcache2inode(struct vcache *avc)
     VATTR_NULL(&vattr);
     afs_CopyOutAttrs(avc, &vattr); /* calls vattr2inode */
 }
+
+/* Yet another one for fakestat'ed mountpoints */
+void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp)
+{
+    struct vattr vattr;
+
+    VATTR_NULL(&vattr);
+    afs_CopyOutAttrs(rootvp, &vattr);
+    vattr2inode(AFSTOV(mpvp), &vattr);
+}
index ef27ae5169e33d7357e3518ec2683983cb4ccf78..09403c6b8b2ef754e3acfc0645e92bb50e5fb0ad 100644 (file)
  * Time related macros
  */
 #define        afs_hz      hz
+#ifdef AFS_SUN59_ENV
+#define osi_Time() local_osi_Time()
+extern void gethrestime(timespec_t *);
+static int
+local_osi_Time()
+{
+   timespec_t start;
+   gethrestime(&start);
+   return start.tv_sec;
+}
+#else
 #define osi_Time() (hrestime.tv_sec)
+#endif
 
 #undef afs_osi_Alloc_NoSleep
 extern void *afs_osi_Alloc_NoSleep(size_t size);
@@ -90,7 +102,7 @@ extern kmutex_t afs_rxglobal_lock;
 #undef AfsLargeFileUio
 #define AfsLargeFileUio(uio)       ( (uio)->_uio_offset._p._u ? 1 : 0 )
 #undef AfsLargeFileSize
-#define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)MAXOFF_T)?1:0)
+#define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)0x7fffffff)?1:0)
 #endif
 
 #endif /* _OSI_MACHDEP_H_ */
index 0d07e4ea116744c51f1e3ccbaf8dbd0daede335d..b38c01571fa1158834849e9967c62b14b3daabe1 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.9 2002/05/10 23:44:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.10 2002/08/02 04:28:59 hartmans Exp $");
 
 #if    defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
 /*
@@ -81,6 +81,25 @@ AFS_TRYUP(lock)
 #endif
 
 
+/* Translate a faultcode_t as returned by some of the vm routines
+ * into a suitable errno value.
+ */
+static int
+afs_fc2errno(faultcode_t fc)
+{
+    switch (FC_CODE(fc)) {
+    case 0:
+       return 0;
+
+    case FC_OBJERR:
+       return FC_ERRNO(fc);
+
+    default:
+       return EIO;
+    }
+}
+
+
 extern struct as kas;  /* kernel addr space */
 extern unsigned char *afs_indexFlags;         
 extern afs_lock_t afs_xdcache;         
@@ -1070,7 +1089,8 @@ struct AFS_UCRED *acred;
        data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
 #endif
 #ifndef        AFS_SUN5_ENV
-       code = as_fault(&kas, data+pageOffset, tsize, F_SOFTLOCK, mode);
+       code = afs_fc2errno(as_fault(&kas, data+pageOffset, tsize,
+                                    F_SOFTLOCK, mode));
        if (code == 0) {
            AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
            as_fault(&kas, data+pageOffset, tsize, F_SOFTUNLOCK, mode);
@@ -1131,7 +1151,8 @@ struct AFS_UCRED *acred;
                AFS_GUNLOCK();
            }
            if (!created)
-               code = segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTLOCK, mode);
+               code = afs_fc2errno(segmap_fault(kas.a_hat, segkmap, raddr,
+                                                rsize, F_SOFTLOCK, mode));
        }
        if (code == 0) {
            AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
index 75dcff943ebdde2ebb8fd32bb0687dec3eb9ec46..5a19f3dcbdc7388a511c668aa0e038cd18193642 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.1.1.5 2001/07/14 22:19:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.1.1.6 2002/08/02 04:29:00 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -188,21 +188,31 @@ afs_access(OSI_VC_ARG(avc), amode, acred)
     struct AFS_UCRED *acred; {
     register afs_int32 code;
     struct vrequest treq;
+    struct afs_fakestat_state fakestate;
     OSI_VC_CONVERT(avc)
 
     AFS_STATCNT(afs_access);
     afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc, 
               ICL_TYPE_INT32, amode, ICL_TYPE_INT32, avc->m.Length);
+    afs_InitFakeStat(&fakestate);
     if (code = afs_InitReq(&treq, acred)) return code;
 
+    code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+    if (code) {
+      afs_PutFakeStat(&fakestate);
+      return code;
+    }
+
     code = afs_VerifyVCache(avc, &treq);
     if (code) {
+      afs_PutFakeStat(&fakestate);
       code = afs_CheckCode(code, &treq, 16);
       return code; 
     }
 
     /* if we're looking for write access and we have a read-only file system, report it */
     if ((amode & VWRITE) && (avc->states & CRO)) {
+        afs_PutFakeStat(&fakestate);
        return EROFS;
     }
     code = 1;          /* Default from here on in is access ok. */
@@ -269,11 +279,12 @@ afs_access(OSI_VC_ARG(avc), amode, acred)
               code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS);
        }
     }
-    if (code)
+    afs_PutFakeStat(&fakestate);
+    if (code) {
        return 0;               /* if access is ok */
-    else {
-      code = afs_CheckCode(EACCES, &treq, 17);      /* failure code */
-      return code;
+    else {
+       code = afs_CheckCode(EACCES, &treq, 17);             /* failure code */
+       return code;
     }
 }
 
index f19091435d698dd3e68da2dd7048cdc1e5ee2271..3b2a3160aed363bb05a0058bfb533f44bda4deb6 100644 (file)
@@ -21,7 +21,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.1.1.9 2002/06/10 11:40:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.1.1.10 2002/08/02 04:29:00 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -37,20 +37,24 @@ extern struct vcache *afs_globalVp;
 /* copy out attributes from cache entry */
 afs_CopyOutAttrs(avc, attrs)
     register struct vattr *attrs;
-    register struct vcache *avc; {
+    register struct vcache *avc;
+{
     register struct volume *tvp;
     register struct cell *tcell;
     register afs_int32 i;
+    int fakedir = 0;
 
     AFS_STATCNT(afs_CopyOutAttrs);
+    if (afs_fakestat_enable && avc->mvstat == 1)
+       fakedir = 1;
 #if    defined(AFS_MACH_ENV )
-    attrs->va_mode = vType(avc) | (avc->m.Mode&~VFMT);
+    attrs->va_mode = fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode&~VFMT);
 #else /* AFS_MACH_ENV */
-    attrs->va_type = vType(avc);
+    attrs->va_type = fakedir ? VDIR : vType(avc);
 #if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
-    attrs->va_mode = (mode_t)(avc->m.Mode & 0xffff);
+    attrs->va_mode = fakedir ? 0755 : (mode_t)(avc->m.Mode & 0xffff);
 #else
-    attrs->va_mode = avc->m.Mode;
+    attrs->va_mode = fakedir ? VDIR | 0755 : avc->m.Mode;
 #endif
 #endif /* AFS_MACH_ENV */
 
@@ -60,8 +64,8 @@ afs_CopyOutAttrs(avc, attrs)
        if (tcell && (tcell->states & CNoSUID))
            attrs->va_mode &= ~(VSUID|VSGID);
     }
-    attrs->va_uid = avc->m.Owner;
-    attrs->va_gid = avc->m.Group;   /* yeah! */
+    attrs->va_uid = fakedir ? 0 : avc->m.Owner;
+    attrs->va_gid = fakedir ? 0 : avc->m.Group;   /* yeah! */
 #if    defined(AFS_SUN56_ENV)
     attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
 #else
@@ -90,10 +94,10 @@ afs_CopyOutAttrs(avc, attrs)
     }
     else attrs->va_nodeid = avc->fid.Fid.Vnode + (avc->fid.Fid.Volume << 16);
     attrs->va_nodeid &= 0x7fffffff;    /* Saber C hates negative inode #s! */
-    attrs->va_nlink = avc->m.LinkCount;
-    attrs->va_size = avc->m.Length;
+    attrs->va_nlink = fakedir ? 100 : avc->m.LinkCount;
+    attrs->va_size = fakedir ? 4096 : avc->m.Length;
     attrs->va_atime.tv_sec = attrs->va_mtime.tv_sec = attrs->va_ctime.tv_sec =
-       (int)avc->m.Date;
+       fakedir ? 0 : (int)avc->m.Date;
     /* set microseconds to be dataversion # so that we approximate NFS-style
      * use of mtime as a dataversion #.  We take it mod 512K because
      * microseconds *must* be less than a million, and 512K is the biggest
@@ -192,6 +196,23 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred)
     afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, 
               ICL_TYPE_INT32, avc->m.Length);
 
+    if (afs_fakestat_enable && avc->mvstat == 1) {
+       struct afs_fakestat_state fakestat;
+
+       code = afs_InitReq(&treq, acred);
+       if (code) return code;
+       afs_InitFakeStat(&fakestat);
+       code = afs_TryEvalFakeStat(&avc, &fakestat, &treq);
+       if (code) {
+           afs_PutFakeStat(&fakestat);
+           return code;
+       }
+
+       code = afs_CopyOutAttrs(avc, attrs);
+       afs_PutFakeStat(&fakestat);
+       return code;
+    }
+
 #if defined(AFS_SUN5_ENV)
     if (flags & ATTR_HINT) {
        code = afs_CopyOutAttrs(avc, attrs);
@@ -392,12 +413,19 @@ afs_setattr(avc, attrs, acred)
     struct vrequest treq;
     struct AFSStoreStatus astat;
     register afs_int32 code;
+    struct afs_fakestat_state fakestate;
     OSI_VC_CONVERT(avc)
 
     AFS_STATCNT(afs_setattr);
     afs_Trace2(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc, 
               ICL_TYPE_INT32, avc->m.Length);
     if (code = afs_InitReq(&treq, acred)) return code;
+
+    afs_InitFakeStat(&fakestate);
+    code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+    if (code)
+      goto done;
+
     if (avc->states & CRO) {
        code=EROFS;
        goto done;
@@ -516,6 +544,7 @@ afs_setattr(avc, attrs, acred)
     AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE);
 #endif
 done:
+    afs_PutFakeStat(&fakestate);
     code = afs_CheckCode(code, &treq, 15);
     return code;
 }
index 54202d3c94f129e69e44eb3ba63a4cc3d96dedb4..6622455c4378a3a03091c35e5fcca60391ed566f 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.1.1.7 2002/05/10 23:44:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.1.1.8 2002/08/02 04:29:01 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -72,6 +72,7 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred)
     struct server *hostp=0;
     struct vcache *tvc;
     struct volume*     volp = 0;
+    struct afs_fakestat_state fakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
 
@@ -83,6 +84,8 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred)
     afs_Trace3(afs_iclSetp, CM_TRACE_CREATE, ICL_TYPE_POINTER, adp,
               ICL_TYPE_STRING, aname, ICL_TYPE_INT32, amode);
 
+    afs_InitFakeStat(&fakestate);
+
 #ifdef AFS_SGI65_ENV
     /* If avcp is passed not null, it's the old reference to this file.
      * We can use this to avoid create races. For now, just decrement
@@ -112,6 +115,8 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred)
        code = EINVAL;          
        goto done;
     }
+    code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+    if (code) goto done;
 tagain:
     code = afs_VerifyVCache(adp, &treq);
     if (code) goto done;
@@ -454,6 +459,7 @@ done:
        tvc->states |= CCore1;
 #endif
 
+    afs_PutFakeStat(&fakestate);
     code = afs_CheckCode(code, &treq, 20);
 
 done2:
index 334d450e1b3b002eb275a1f11efb35af68eb8504..cb473ff471ff0a41a1f9bdb7afaf42e93351979f 100644 (file)
@@ -20,7 +20,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.1.1.5 2002/05/10 23:44:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.1.1.6 2002/08/02 04:29:01 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -62,6 +62,7 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
     struct AFSCallBack CallBack;
     struct AFSVolSync tsync;
     afs_int32 now;
+    struct afs_fakestat_state fakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
 
@@ -71,6 +72,7 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
 
     if (code = afs_InitReq(&treq, acred)) 
        goto done2;
+    afs_InitFakeStat(&fakestate);
 
     if (strlen(aname) > AFSNAMEMAX) {
        code = ENAMETOOLONG;
@@ -81,6 +83,8 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
        code = EINVAL;
        goto done;
     }
+    code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+    if (code) goto done;
     code = afs_VerifyVCache(adp, &treq);
     if (code) goto done;
 
@@ -157,6 +161,7 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
     }
     else code = ENOENT;
 done:
+    afs_PutFakeStat(&fakestate);
     code = afs_CheckCode(code, &treq, 26);
 done2:
 #ifdef AFS_OSF_ENV
@@ -192,6 +197,7 @@ afs_rmdir(adp, aname, acred)
     afs_int32 offset, len;
     struct AFSFetchStatus OutDirStatus;
     struct AFSVolSync tsync;
+    struct afs_fakestat_state fakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
 
@@ -202,12 +208,16 @@ afs_rmdir(adp, aname, acred)
 
     if (code = afs_InitReq(&treq, acred)) 
        goto done2;
+    afs_InitFakeStat(&fakestate);
 
     if (strlen(aname) > AFSNAMEMAX) {
        code = ENAMETOOLONG;
        goto done;
     }
 
+    code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+    if (code)
+       goto done;
     code = afs_VerifyVCache(adp, &treq);
     if (code) goto done;
 
@@ -306,6 +316,7 @@ afs_rmdir(adp, aname, acred)
     code = 0;
 
 done:
+    afs_PutFakeStat(&fakestate);
     code = afs_CheckCode(code, &treq, 27); 
 done2:
 #ifdef AFS_OSF_ENV
index e3f40f04ddbc25ad19b6737f449b017e30ac6e84..09e7f390b213117635473ebac169b695d02af8fc 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.9 2002/05/10 23:44:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.10 2002/08/02 04:29:01 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -502,11 +502,21 @@ struct AFS_UCRED *acred; {
 #ifdef AFS_OSF_ENV
     int acmd = 0;
 #endif
+    struct afs_fakestat_state fakestate;
 
     AFS_STATCNT(afs_lockctl);
     if (code = afs_InitReq(&treq, acred)) return code;
+    afs_InitFakeStat(&fakestate);
+    code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+    if (code) {
+       afs_PutFakeStat(&fakestate);
+       return code;
+    }
 #ifdef AFS_OSF_ENV
-    if (flag & VNOFLCK)        return 0;
+    if (flag & VNOFLCK)        {
+       afs_PutFakeStat(&fakestate);
+       return 0;
+    }
     if (flag & CLNFLCK) {
        acmd = LOCK_UN;
     } else if ((flag & GETFLCK) || (flag & RGETFLCK)) {
@@ -520,12 +530,15 @@ struct AFS_UCRED *acred; {
 #else
     if (acmd == F_GETLK) {
 #endif
-       if (af->l_type == F_UNLCK)
+       if (af->l_type == F_UNLCK) {
+           afs_PutFakeStat(&fakestate);
            return 0;
+       }
 #ifndef        AFS_OSF_ENV     /* getlock is a no-op for osf (for now) */
        code = HandleGetLock(avc, af, &treq, clid);
 #endif
        code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */
+       afs_PutFakeStat(&fakestate);
        return code;
     }
     else if ((acmd == F_SETLK) || (acmd == F_SETLKW) 
@@ -553,13 +566,17 @@ struct AFS_UCRED *acred; {
           even when they should block */
        if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {
            DoLockWarning();
+           afs_PutFakeStat(&fakestate);
            return 0;
        }
        /* otherwise we can turn this into a whole-file flock */
        if (af->l_type == F_RDLCK) code = LOCK_SH;
        else if (af->l_type == F_WRLCK) code = LOCK_EX;
        else if (af->l_type == F_UNLCK) code = LOCK_UN;
-       else return EINVAL; /* unknown lock type */
+       else {
+           afs_PutFakeStat(&fakestate);
+           return EINVAL; /* unknown lock type */
+       }
        if (((acmd == F_SETLK) 
 #if    (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV)
        || (acmd == F_RSETLK) 
@@ -578,8 +595,10 @@ struct AFS_UCRED *acred; {
 #endif
 #endif
        code = afs_CheckCode(code, &treq, 3); /* defeat AIX -O bug */
+       afs_PutFakeStat(&fakestate);
        return code;
     }
+    afs_PutFakeStat(&fakestate);
     return EINVAL;
 }
 
@@ -858,7 +877,9 @@ afs_xflock () {
     struct vrequest treq;
     struct vcache *tvc;
     int flockDone;
+    struct afs_fakestat_state fakestate;
 
+    afs_InitFakeStat(&fakestate);
     AFS_STATCNT(afs_xflock);
     flockDone = 0;
 #ifdef AFS_OSF_ENV
@@ -872,9 +893,15 @@ afs_xflock () {
 #endif /* AFS_FBSD_ENV */
     fd = getf(uap->fd);
 #endif
-    if (!fd) return;
+    if (!fd) {
+       afs_PutFakeStat(&fakestate);
+       return;
+    }
 
-    if (flockDone = afs_InitReq(&treq, u.u_cred)) return flockDone;
+    if (flockDone = afs_InitReq(&treq, u.u_cred)) {
+       afs_PutFakeStat(&fakestate);
+       return flockDone;
+    }
     /* first determine whether this is any sort of vnode */
     if (fd->f_type == DTYPE_VNODE) {
        /* good, this is a vnode; next see if it is an AFS vnode */
@@ -888,9 +915,15 @@ afs_xflock () {
            tvc = VTOAFS(afs_gntovn)(tvc);
            if (!tvc) {
                u.u_error = ENOENT;
+               afs_PutFakeStat(&fakestate);
                return;
            }
 #endif
+           code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
+           if (code) {
+               afs_PutFakeStat(&fakestate);
+               return code;
+           }
            if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) {
                /* First, if fd already has lock, release it for relock path */
 #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
@@ -938,6 +971,7 @@ afs_xflock () {
 #else
     FP_UNREF(fd);
 #endif
+    afs_PutFakeStat(&fakestate);
     return code;
 #else  /* AFS_OSF_ENV */
     if (!flockDone)
@@ -946,6 +980,7 @@ afs_xflock () {
 #else
        flock();
 #endif
+    afs_PutFakeStat(&fakestate);
     return;
 #endif
 }
index 1ba9f19b1bee5dfdef243e5e04b8f9628bf40804..c6602dfbed4988d4f61c55b2045bf7a552bb1fd5 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.1.1.5 2002/05/10 23:44:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.1.1.6 2002/08/02 04:29:02 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -32,9 +32,9 @@ extern afs_rwlock_t afs_xcbhash;
 
 #ifdef AFS_OSF_ENV
 afs_link(avc, ndp)
-    register struct vcache *avc;
+    struct vcache *avc;
     struct nameidata *ndp; {
-    register struct vcache *adp = VTOAFS(ndp->ni_dvp);
+    struct vcache *adp = VTOAFS(ndp->ni_dvp);
     char *aname = ndp->ni_dent.d_name;
     struct ucred *acred = ndp->ni_cred;
 #else  /* AFS_OSF_ENV */
@@ -44,7 +44,7 @@ afs_link(OSI_VC_ARG(adp), avc, aname, acred)
 afs_link(avc, OSI_VC_ARG(adp), aname, acred)
 #endif
     OSI_VC_DECL(adp);
-    register struct vcache *avc;
+    struct vcache *avc;
     char *aname;
     struct AFS_UCRED *acred;
 {
@@ -56,6 +56,7 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred)
     afs_int32 offset, len;
     struct AFSFetchStatus OutFidStatus, OutDirStatus;
     struct AFSVolSync tsync;
+    struct afs_fakestat_state vfakestate, dfakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
 
@@ -66,6 +67,13 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred)
     if (code = afs_InitReq(&treq, acred)) 
        goto done2;
 
+    afs_InitFakeStat(&vfakestate);
+    afs_InitFakeStat(&dfakestate);
+    code = afs_EvalFakeStat(&avc, &vfakestate, &treq);
+    if (code) goto done;
+    code = afs_EvalFakeStat(&adp, &dfakestate, &treq);
+    if (code) goto done;
+
     if (avc->fid.Cell != adp->fid.Cell || avc->fid.Fid.Volume != adp->fid.Fid.Volume) {
        code = EXDEV;
        goto done;
@@ -151,6 +159,8 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred)
     code = 0;
 done:
     code = afs_CheckCode(code, &treq, 24);
+    afs_PutFakeStat(&vfakestate);
+    afs_PutFakeStat(&dfakestate);
 done2:
 #ifdef AFS_OSF_ENV
     afs_PutVCache(adp, WRITE_LOCK);
index f349443727d74ea72c635c52482e2f806f93c44c..30b0de0eba8dbda0b5ceffe3f445cb028a271f5c 100644 (file)
@@ -17,7 +17,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.1.1.5 2002/05/10 23:44:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.1.1.6 2002/08/02 04:29:02 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -44,8 +44,9 @@ afs_open(avcp, aflags, acred)
 {
     register afs_int32 code;
     struct vrequest treq;
-    register struct vcache *tvc;
+    struct vcache *tvc;
     int writing;
+    struct afs_fakestat_state fakestate;
     
     AFS_STATCNT(afs_open);
     if (code = afs_InitReq(&treq, acred)) return code;
@@ -57,6 +58,9 @@ afs_open(avcp, aflags, acred)
 #endif
     afs_Trace2(afs_iclSetp, CM_TRACE_OPEN, ICL_TYPE_POINTER, tvc,
               ICL_TYPE_INT32, aflags);
+    afs_InitFakeStat(&fakestate);
+    code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
+    if (code) goto done;
     code = afs_VerifyVCache(tvc, &treq);
     if (code) goto done;
     if (aflags & (FWRITE | FTRUNC)) writing = 1;
@@ -143,6 +147,7 @@ afs_open(avcp, aflags, acred)
 #endif
     ReleaseReadLock(&tvc->lock);
 done:
+    afs_PutFakeStat(&fakestate);
     code = afs_CheckCode(code, &treq, 4); /* avoid AIX -O bug */
 
     afs_Trace2(afs_iclSetp, CM_TRACE_OPEN, ICL_TYPE_POINTER, tvc,
index 021f981e2541d1d5ac502bc12352e87c036ec493..13b686c61d516204617a0a6517d5a21f043670b9 100644 (file)
@@ -19,7 +19,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.1.1.5 2001/07/14 22:19:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.1.1.6 2002/08/02 04:29:03 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -490,7 +490,7 @@ afs_UFSRead(avc, auio, acred, albn, abpp, noLock)
     struct vrequest treq;
 
     AFS_STATCNT(afs_UFSRead);
-    if (avc->vc_error)
+    if (avc && avc->vc_error)
        return EIO;
 
     /* check that we have the latest status info in the vnode cache */
index 467083c5da17dcdf3e51498107621818b07b1230..39e680eb3cfd93b4c1d91c0059bd098099c6e464 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.8 2002/06/10 11:40:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.9 2002/08/02 04:29:03 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -226,6 +226,7 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
     afs_int32 offset, len;
     struct AFSFetchStatus OutDirStatus;
     struct AFSVolSync tsync;
+    struct afs_fakestat_state fakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
 
@@ -237,23 +238,37 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
     tvc = (struct vcache *)ndp->ni_vp;  /* should never be null */
 #endif
 
-    /* Check if this is dynroot */
-    if (afs_IsDynroot(adp)) {
+    if (code = afs_InitReq(&treq, acred)) {
 #ifdef  AFS_OSF_ENV
         afs_PutVCache(adp, 0);
         afs_PutVCache(tvc, 0);
 #endif
-       return afs_DynrootVOPRemove(adp, acred, aname);
+      return code;
     }
 
-    if (code = afs_InitReq(&treq, acred)) {
+    afs_InitFakeStat(&fakestate);
+    code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+    if (code) {
+       afs_PutFakeStat(&fakestate);
 #ifdef  AFS_OSF_ENV
-        afs_PutVCache(adp, 0);
-        afs_PutVCache(tvc, 0);
+       afs_PutVCache(adp, 0);
+       afs_PutVCache(tvc, 0);
 #endif
-      return code;
+       return code;
+    }
+
+    /* Check if this is dynroot */
+    if (afs_IsDynroot(adp)) {
+       code = afs_DynrootVOPRemove(adp, acred, aname);
+       afs_PutFakeStat(&fakestate);
+#ifdef  AFS_OSF_ENV
+       afs_PutVCache(adp, 0);
+       afs_PutVCache(tvc, 0);
+#endif
+       return code;
     }
     if (strlen(aname) > AFSNAMEMAX) {
+       afs_PutFakeStat(&fakestate);
 #ifdef  AFS_OSF_ENV
        afs_PutVCache(adp, 0);
        afs_PutVCache(tvc, 0);
@@ -267,13 +282,15 @@ tagain:
     if (code) {
        afs_PutVCache(adp, 0);
        afs_PutVCache(tvc, 0);
+       afs_PutFakeStat(&fakestate);
        return afs_CheckCode(code, &treq, 22);
     }
 #else  /* AFS_OSF_ENV */
     tvc = (struct vcache *) 0;
     if (code) {
-      code = afs_CheckCode(code, &treq, 23);
-      return code;
+       code = afs_CheckCode(code, &treq, 23);
+       afs_PutFakeStat(&fakestate);
+       return code;
     }
 #endif
 
@@ -286,6 +303,7 @@ tagain:
         afs_PutVCache(tvc, 0);
 #endif
         code = EROFS;
+       afs_PutFakeStat(&fakestate);
        return code;
     }
 
@@ -378,6 +396,7 @@ tagain:
 #ifdef AFS_OSF_ENV
     afs_PutVCache(adp, WRITE_LOCK);
 #endif /* AFS_OSF_ENV */
+    afs_PutFakeStat(&fakestate);
     return code;
 }
 
index 47a678f394de1d4a757255625f3436025313fde3..90b5fd14eec427b3ae145862bd797d351b6c063f 100644 (file)
@@ -17,7 +17,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.1.1.5 2002/05/10 23:44:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.1.1.6 2002/08/02 04:29:03 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -31,11 +31,12 @@ extern afs_rwlock_t afs_xcbhash;
 /* Note that we don't set CDirty here, this is OK because the rename
  * RPC is called synchronously. */
 
-afsrename(aodp, aname1, andp, aname2, acred)
-    register struct vcache *aodp, *andp;
+afsrename(aodp, aname1, andp, aname2, acred, areq)
+    struct vcache *aodp, *andp;
     char *aname1, *aname2;
-    struct AFS_UCRED *acred; {
-    struct vrequest treq;
+    struct AFS_UCRED *acred;
+    struct vrequest *areq;
+{
     register struct conn *tc;
     register afs_int32 code;
     afs_int32 returnCode;
@@ -53,8 +54,6 @@ afsrename(aodp, aname1, andp, aname2, acred)
               ICL_TYPE_STRING, aname1, ICL_TYPE_POINTER, andp,
               ICL_TYPE_STRING, aname2);
 
-    if (code = afs_InitReq(&treq, acred)) return code;
-
     if (strlen(aname1) > AFSNAMEMAX || strlen(aname2) > AFSNAMEMAX) {
        code = ENAMETOOLONG;
        goto done;
@@ -62,9 +61,9 @@ afsrename(aodp, aname1, andp, aname2, acred)
 
     /* verify the latest versions of the stat cache entries */
 tagain:
-    code = afs_VerifyVCache(aodp, &treq);
+    code = afs_VerifyVCache(aodp, areq);
     if (code) goto done;
-    code = afs_VerifyVCache(andp, &treq);
+    code = afs_VerifyVCache(andp, areq);
     if (code) goto done;
     
     /* lock in appropriate order, after some checks */
@@ -107,7 +106,7 @@ tagain:
      * fileFid in order to handle ".." invalidation at the very end.
      */
     code = 0;
-    tdc1 = afs_GetDCache(aodp, 0, &treq, &offset, &len, 0);
+    tdc1 = afs_GetDCache(aodp, 0, areq, &offset, &len, 0);
     if (!tdc1) {
        code = ENOENT;
     }
@@ -135,7 +134,7 @@ tagain:
 
     /* locks are now set, proceed to do the real work */
     do {
-       tc = afs_Conn(&aodp->fid, &treq, SHARED_LOCK);
+       tc = afs_Conn(&aodp->fid, areq, SHARED_LOCK);
        if (tc) {
           XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME);
 #ifdef RX_ENABLE_LOCKS
@@ -151,7 +150,7 @@ tagain:
        } else code = -1;
 
     } while
-       (afs_Analyze(tc, code, &andp->fid, &treq,
+       (afs_Analyze(tc, code, &andp->fid, areq,
                     AFS_STATS_FS_RPCIDX_RENAME, SHARED_LOCK, (struct cell *)0));
 
     returnCode = code;     /* remember for later */
@@ -265,11 +264,11 @@ tagain:
        unlinkFid.Cell = aodp->fid.Cell;
        tvc = (struct vcache *)0;
        if (!unlinkFid.Fid.Unique) {
-           tvc = afs_LookupVCache(&unlinkFid, &treq, (afs_int32 *)0, WRITE_LOCK,
+           tvc = afs_LookupVCache(&unlinkFid, areq, (afs_int32 *)0, WRITE_LOCK,
                                   aodp, aname1);
        }
        if (!tvc) /* lookup failed or wasn't called */
-          tvc = afs_GetVCache(&unlinkFid, &treq, (afs_int32 *)0,
+          tvc = afs_GetVCache(&unlinkFid, areq, (afs_int32 *)0,
                               (struct vcache*)0, WRITE_LOCK);
 
        if (tvc) {
@@ -303,9 +302,9 @@ tagain:
        fileFid.Fid.Volume = aodp->fid.Fid.Volume;
        fileFid.Cell = aodp->fid.Cell;
        if (!fileFid.Fid.Unique)
-           tvc = afs_LookupVCache(&fileFid, &treq, (afs_int32 *)0, WRITE_LOCK, andp, aname2);
+           tvc = afs_LookupVCache(&fileFid, areq, (afs_int32 *)0, WRITE_LOCK, andp, aname2);
        else
-           tvc = afs_GetVCache(&fileFid, &treq, (afs_int32 *)0,
+           tvc = afs_GetVCache(&fileFid, areq, (afs_int32 *)0,
                                (struct vcache*)0, WRITE_LOCK);
        if (tvc && (vType(tvc) == VDIR)) {
            ObtainWriteLock(&tvc->lock,152);
@@ -327,16 +326,15 @@ tagain:
     }
     code = returnCode;
 done:
-    code = afs_CheckCode(code, &treq, 25);
     return code;
 }
 
 #ifdef AFS_OSF_ENV
 afs_rename(fndp, tndp)
     struct nameidata *fndp, *tndp; {
-    register struct vcache *aodp = VTOAFS(fndp->ni_dvp);
+    struct vcache *aodp = VTOAFS(fndp->ni_dvp);
     char *aname1 = fndp->ni_dent.d_name;
-    register struct vcache *andp = VTOAFS(tndp->ni_dvp);
+    struct vcache *andp = VTOAFS(tndp->ni_dvp);
     char *aname2 = tndp->ni_dent.d_name;
     struct ucred *acred = tndp->ni_cred;
 #else  /* AFS_OSF_ENV */
@@ -347,14 +345,28 @@ afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, npnp, acred)
 afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred)
 #endif
     OSI_VC_DECL(aodp);
-    register struct vcache *andp;
+    struct vcache *andp;
     char *aname1, *aname2;
     struct AFS_UCRED *acred; {
 #endif
     register afs_int32 code;
+    struct afs_fakestat_state ofakestate;
+    struct afs_fakestat_state nfakestate;
+    struct vrequest treq;
     OSI_VC_CONVERT(aodp)
 
-    code = afsrename(aodp, aname1, andp, aname2, acred);
+    code = afs_InitReq(&treq, acred);
+    if (code) return code;
+    afs_InitFakeStat(&ofakestate);
+    afs_InitFakeStat(&nfakestate);
+    code = afs_EvalFakeStat(&aodp, &ofakestate, &treq);
+    if (code) goto done;
+    code = afs_EvalFakeStat(&andp, &nfakestate, &treq);
+    if (code) goto done;
+    code = afsrename(aodp, aname1, andp, aname2, acred, &treq);
+done:
+    afs_PutFakeStat(&ofakestate);
+    afs_PutFakeStat(&nfakestate);
 #ifdef AFS_OSF_ENV
     AFS_RELE(tndp->ni_dvp);
     if (tndp->ni_vp != NULL) {
@@ -363,5 +375,6 @@ afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred)
     AFS_RELE(fndp->ni_dvp);
     AFS_RELE(fndp->ni_vp);
 #endif /* AFS_OSF_ENV */
+    code = afs_CheckCode(code, &treq, 25);
     return code;
 }
index 242aab9e6df3fb168d29a6e612db921ea514fda4..1fd305117dfddf8f9c4937233a7734bff7884668 100644 (file)
@@ -21,7 +21,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.1.1.6 2002/05/10 23:44:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.1.1.7 2002/08/02 04:29:04 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -71,6 +71,7 @@ afs_symlink
     struct AFSCallBack CallBack;
     struct AFSVolSync tsync;
     struct volume*    volp=0;
+    struct afs_fakestat_state fakestate;
     XSTATS_DECLS
     OSI_VC_CONVERT(adp)
     
@@ -78,6 +79,14 @@ afs_symlink
     afs_Trace2(afs_iclSetp, CM_TRACE_SYMLINK, ICL_TYPE_POINTER, adp,
                 ICL_TYPE_STRING, aname);
 
+    if (code = afs_InitReq(&treq, acred))
+       goto done2;
+
+    afs_InitFakeStat(&fakestate);
+    code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+    if (code)
+       goto done;
+
     if (strlen(aname) > AFSNAMEMAX || strlen(atargetName) > AFSPATHMAX) {
        code = ENAMETOOLONG;
        goto done2;
@@ -88,9 +97,6 @@ afs_symlink
        goto done2;
     }
 
-    if (code = afs_InitReq(&treq, acred))
-       goto done2;
-
     code = afs_VerifyVCache(adp, &treq);
     if (code) { 
       code = afs_CheckCode(code, &treq, 30);
@@ -217,6 +223,7 @@ afs_symlink
     afs_PutVCache(tvc, WRITE_LOCK);
     code = 0;
 done:
+    afs_PutFakeStat(&fakestate);
     if ( volp ) 
        afs_PutVolume(volp, READ_LOCK);
     code = afs_CheckCode(code, &treq, 31);
@@ -322,11 +329,15 @@ afs_readlink(OSI_VC_ARG(avc), auio, acred)
     register afs_int32 code;
     struct vrequest treq;
     register char *tp;
+    struct afs_fakestat_state fakestat;
     OSI_VC_CONVERT(avc)
 
     AFS_STATCNT(afs_readlink);
     afs_Trace1(afs_iclSetp, CM_TRACE_READLINK, ICL_TYPE_POINTER, avc);
     if (code = afs_InitReq(&treq, acred)) return code;
+    afs_InitFakeStat(&fakestat);
+    code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+    if (code) goto done;
     code = afs_VerifyVCache(avc, &treq);
     if (code) goto done;
     if (vType(avc) != VLNK) {
@@ -345,6 +356,7 @@ afs_readlink(OSI_VC_ARG(avc), auio, acred)
     }
     ReleaseWriteLock(&avc->lock);
 done:
+    afs_PutFakeStat(&fakestat);
     code = afs_CheckCode(code, &treq, 32);
     return code;
 }
index 8ecb2cbdf17e97dac65c5896da1f5f2e93c606a2..cdfbca7260c0ef186328c1642e878d38c82a25ba 100644 (file)
@@ -20,7 +20,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.10 2002/05/10 23:44:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.11 2002/08/02 04:29:04 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -283,7 +283,7 @@ afs_MemWrite(avc, auio, aio, acred, noLock)
        if (filePos > avc->m.Length)
            avc->m.Length = filePos;
 #endif
-#ifndef AFS_VM_RDWR_ENV
+#if !defined(AFS_VM_RDWR_ENV)
        /*
         * If write is implemented via VM, afs_DoPartialWrite() is called from
         * the high-level write op.
@@ -580,7 +580,7 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
        }
 #endif
        osi_UFSClose(tfile);
-#ifndef        AFS_VM_RDWR_ENV
+#if !defined(AFS_VM_RDWR_ENV)
        /*
         * If write is implemented via VM, afs_DoPartialWrite() is called from
         * the high-level write op.
@@ -685,10 +685,12 @@ afs_closex(afd)
     afs_int32 flags;
     int closeDone;
     afs_int32 code = 0;
+    struct afs_fakestat_state fakestat;
 
     AFS_STATCNT(afs_closex);
     /* setup the credentials */
     if (code = afs_InitReq(&treq, u.u_cred)) return code;
+    afs_InitFakeStat(&fakestat);
 
     closeDone = 0;
     /* we're the last one.  If we're an AFS vnode, clear the flags,
@@ -697,6 +699,11 @@ afs_closex(afd)
     if (afd->f_type == DTYPE_VNODE) {
        tvc = VTOAFS(afd->f_data);
        if (IsAfsVnode(AFSTOV(tvc))) {
+           code = afs_EvalFakeStat(&tvc, &fakestat, &treq);
+           if (code) {
+             afs_PutFakeStat(&fakestat);
+             return code;
+           }
            VN_HOLD(AFSTOV(tvc));
            flags = afd->f_flag & (FSHLOCK | FEXLOCK);
            afd->f_flag &= ~(FSHLOCK | FEXLOCK);
@@ -720,6 +727,7 @@ afs_closex(afd)
     if (!closeDone) {
        code = vno_close(afd);
     }
+    afs_PutFakeStat(&fakestat);
     return code;       /* return code from vnode layer */
 }
 #endif
@@ -760,41 +768,44 @@ afs_close(OSI_VC_ARG(avc), aflags, acred)
     afs_int32 aflags;
     struct AFS_UCRED *acred; 
 {
-    register afs_int32 code, initreq=0;
+    register afs_int32 code;
     register struct brequest *tb;
     struct vrequest treq;
 #ifdef AFS_SGI65_ENV
     struct flid flid;
 #endif
+    struct afs_fakestat_state fakestat;
     OSI_VC_CONVERT(avc)
 
     AFS_STATCNT(afs_close);
     afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc,
               ICL_TYPE_INT32, aflags);
+    code = afs_InitReq(&treq, acred);
+    if (code) return code;
+    afs_InitFakeStat(&fakestat);
+    code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+    if (code) {
+       afs_PutFakeStat(&fakestat);
+       return code;
+    }
 #ifdef AFS_SUN5_ENV
     if (avc->flockCount) {
-       if (code = afs_InitReq(&treq, acred)) return code;
-       initreq = 1;
        HandleFlock(avc, LOCK_UN, &treq, 0, 1/*onlymine*/);
     }
 #endif
 #if defined(AFS_SGI_ENV)
-    if (!lastclose)
+    if (!lastclose) {
+       afs_PutFakeStat(&fakestat);
        return 0;
+    }
 #else
 #if    defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
     if (count > 1) {
        /* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
+       afs_PutFakeStat(&fakestat);
        return 0;
     }
 #endif
-#ifdef AFS_SUN5_ENV
-    if (!initreq) {
-#endif
-#endif
-       if (code = afs_InitReq(&treq, acred)) return code;
-#ifdef AFS_SUN5_ENV
-    }
 #endif
 #ifndef        AFS_SUN5_ENV
 #if defined(AFS_SGI_ENV)
@@ -916,6 +927,7 @@ afs_close(OSI_VC_ARG(avc), aflags, acred)
        afs_remunlink(avc, 1);  /* ignore any return code */
     }
 #endif
+    afs_PutFakeStat(&fakestat);
     code = afs_CheckCode(code, &treq, 5);
     return code;
 }
index 17e52be91f6f2eec7af74990aa2c56a24260bf71..ec8bb1870a0893c3597e468f072807d227c222d5 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.9 2002/01/22 19:47:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.10 2002/08/02 04:28:38 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -46,9 +46,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.9 2002/01/22 19:
 afs_rwlock_t afs_xcell;                        /* allocation lock for cells */
 struct afs_q CellLRU;
 afs_int32 afs_cellindex=0;
+afs_int32 afs_realcellindex=0;
 afs_uint32 afs_nextCellNum = 0x100;
 
-
 /* Local variables. */
 struct cell *afs_rootcell = 0;
 
@@ -417,6 +417,31 @@ struct cell *afs_GetCellByIndex(cellindex, locktype, refresh)
 } /*afs_GetCellByIndex*/
 
 
+struct cell *afs_GetRealCellByIndex(cellindex, locktype, refresh)
+    register afs_int32 cellindex;
+    afs_int32 locktype;
+    afs_int32 refresh;
+{
+    register struct cell *tc;
+    register struct afs_q *cq, *tq;
+
+    AFS_STATCNT(afs_GetCellByIndex);
+    ObtainWriteLock(&afs_xcell,102);
+    for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
+       tc = QTOC(cq); tq = QNext(cq);
+       if (tc->realcellIndex == cellindex) {
+           QRemove(&tc->lruq);
+           QAdd(&CellLRU, &tc->lruq);
+           ReleaseWriteLock(&afs_xcell);
+           if (refresh) afs_RefreshCell(tc);
+           return tc;
+       }
+    }
+    ReleaseWriteLock(&afs_xcell);
+    return (struct cell *) 0;
+} /*afs_GetRealCellByIndex*/
+
+
 afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport, timeout, aliasFor)
     int aflags;
     char *acellName;
@@ -484,6 +509,11 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
        tc->vlport = (vlport ? vlport : AFS_VLPORT);
        afs_stats_cmperf.numCellsVisible++;
        newc++;
+       if (!aflags & CAlias) {
+           tc->realcellIndex = afs_realcellindex++;
+       } else {
+           tc->realcellIndex = -1;
+       }
     }
 
     if (aflags & CLinkedCell) {
@@ -513,7 +543,10 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     tc->timeout = timeout;
 
     /* Allow converting an alias into a real cell */
-    if (!(aflags & CAlias)) tc->states &= ~CAlias;
+    if (!(aflags & CAlias)) {
+       tc->states &= ~CAlias;
+       tc->realcellIndex = afs_realcellindex++;
+    }
  
     memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
     if (aflags & CAlias) {
index 7ca29aa428c04f09dd4731673fba6850eb3f1162..e42714b2cb8de24d9d4657e4e0a01f7a9b5b8a7e 100644 (file)
@@ -299,12 +299,13 @@ afs_RefreshDynroot()
 
     for (cellidx = 0; cellidx < maxcellidx; cellidx++) {
        c = afs_GetCellByIndex(cellidx, READ_LOCK, 0 /* don't refresh */);
-       afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
-                             c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0));
+       if (!c) continue;
 
        dotCell = afs_osi_Alloc(strlen(c->cellName) + 2);
        strcpy(dotCell, ".");
        strcat(dotCell, c->cellName);
+       afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
+                             c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0));
        afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
                              dotCell, VNUM_FROM_CIDX_RW(cellidx, 1));
 
index d25d3538eea2c6c1a4b1e4589c0a7fedc22db4d8..a9141f300865899521757880039ef6a101bfc6cf 100644 (file)
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsdisp.c,v 1.1.1.3 2002/05/10 23:43:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsdisp.c,v 1.1.1.4 2002/08/02 04:28:40 hartmans Exp $");
 
+/* Ugly Ugly Ugly  but precludes conflicting XDR macros; We want kernel xdr */
+#define __XDR_INCLUDE__
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h" /* Standard vendor system headers */
 #if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) 
index 6377e582b8b118f44274d5e399238fad5aec899d..a7b1f7f28dccb0a76566da3d8fb750e802f9e327 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.10 2002/05/10 23:43:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.11 2002/08/02 04:28:40 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -420,7 +420,7 @@ void *afs_osi_Alloc(size_t x)
     AFS_STATS(afs_stats_cmperf.OutStandingAllocs++);
     AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x);
 #ifdef AFS_LINUX20_ENV
-    return osi_linux_alloc(x);
+    return osi_linux_alloc(x, 1);
 #else
     size = x;
     tm = (struct osimem *) AFS_KALLOC(size);
@@ -775,6 +775,22 @@ void afs_osi_TraverseProcTable()
 }   
 #endif
 
+#if defined(AFS_LINUX22_ENV)
+void afs_osi_TraverseProcTable()
+{   
+    struct task_struct *p;
+    for_each_task(p) if (p->pid) {
+        if (p->state & TASK_ZOMBIE)
+            continue;
+#if 0
+        if (p->flags & )
+            continue;
+#endif
+       afs_GCPAGs_perproc_func(p);
+    }
+}   
+#endif
+
 /* return a pointer (sometimes a static copy ) to the cred for a
  * given AFS_PROC.
  * subsequent calls may overwrite the previously returned value.
@@ -956,6 +972,31 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
     
     return rv;
 }  
+#elif defined(AFS_LINUX22_ENV)
+const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
+{   
+    struct AFS_UCRED *rv=NULL;
+    static struct AFS_UCRED cr;
+
+    if(pr == NULL) {
+       return NULL;
+    }
+   
+    if ((pr->state == TASK_RUNNING) ||
+       (pr->state == TASK_INTERRUPTIBLE) ||
+       (pr->state == TASK_UNINTERRUPTIBLE) ||
+       (pr->state == TASK_STOPPED)) {
+       read_lock(&tasklist_lock);
+       cr.cr_ref=1;
+       cr.cr_uid=pr->uid;
+       cr.cr_ngroups=pr->ngroups;
+       memcpy(cr.cr_groups, pr->groups, NGROUPS * sizeof(gid_t));
+       read_unlock(&tasklist_lock);  
+       rv = &cr;
+    }
+    
+    return rv;
+}  
 #else
 const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
 {
index bd100abd8f7d79df8669e2d9eca832b5513ece3c..8c7fb39c49bbece39fb5f02b6278390d61a8fae0 100644 (file)
@@ -17,6 +17,11 @@ extern int afs_Analyze(struct conn *aconn, afs_int32 acode, struct VenusFid *afi
                        register struct vrequest *areq, int op, afs_int32 locktype,
                        struct cell *cellp);
 
+/* afs_cell.c */
+extern struct cell *afs_GetRealCellByIndex(register afs_int32 cellindex,
+                                          afs_int32 locktype,
+                                          afs_int32 refresh);
+
 /* afs_conn.c */
 extern struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
                          afs_int32 acell, struct unixuser *tu,
index a0919dc8b419e99f877d6b5fb5c42a118c1ea541..d595c0c203cd1603414e95a793a8ab6b134e8f5a 100644 (file)
@@ -455,6 +455,7 @@ struct afs_CMCallStats {
     afs_int32 C_afs_GetCell;   /* afs_resource.c*/
     afs_int32 C_afs_GetCellByIndex;    /* afs_resource.c*/
     afs_int32 C_afs_GetCellByName;     /* afs_resource.c*/
+    afs_int32 C_afs_GetRealCellByIndex;        /* afs_resource.c*/
     afs_int32 C_afs_NewCell;   /* afs_resource.c*/
     afs_int32 C_afs_GetUser;   /* afs_resource.c*/
     afs_int32 C_afs_PutUser;   /* afs_resource.c*/
index 42dd715470054ca8998b18c3d58bac3efd1df6ad..2b9658304e302de717dfc9ce082125138e002e57 100644 (file)
@@ -129,5 +129,8 @@ error_table 2 ZCM
        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)"
+       ec      CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s"
+       ec      CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s"
+       ec      CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x"
 end
 
index 850af164994f20f32188cb910e7ca78482f8374e..5e461cab4eb93f3f14c34c672f88299fc6a97dcd 100644 (file)
@@ -38,7 +38,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.12 2002/05/10 23:43:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.13 2002/08/02 04:28:44 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -495,7 +495,7 @@ restart:
        repeat:
            next = this_parent->d_subdirs.next;
        resume:
-           while (next != &this_parent->d_subdirs) {
+           while (next && next != &this_parent->d_subdirs) {
                struct list_head *tmp = next;
                struct dentry *dchld = list_entry(tmp, struct dentry, d_child);
                
@@ -977,6 +977,9 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
        INIT_LIST_HEAD(&ip->i_devices);
 #endif
        ip->i_data.host = (void*) ip;
+#ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+       ip->i_data.gfp_mask = GFP_HIGHUSER;
+#endif
        ip->i_mapping = &ip->i_data;
 #ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
        init_rwsem(&ip->i_truncate_sem);
@@ -1486,9 +1489,16 @@ afs_ProcessFS(avc, astat, areq)
        avc->m.Mode |= S_IFDIR;
     }
     else if (astat->FileType == SymbolicLink) {
-       vSetType(avc, VLNK);
-       avc->m.Mode |= S_IFLNK;
-       if ((avc->m.Mode & 0111) == 0) avc->mvstat = 1;
+       if (afs_fakestat_enable && (avc->m.Mode & 0111) == 0) {
+           vSetType(avc, VDIR);
+           avc->m.Mode |= S_IFDIR;
+       } else {
+           vSetType(avc, VLNK);
+           avc->m.Mode |= S_IFLNK;
+       }
+       if ((avc->m.Mode & 0111) == 0) {
+           avc->mvstat = 1;
+       }
     }
     avc->anyAccess = astat->AnonymousAccess;
 #ifdef badidea
index 247fe25c2a99d5b725cc0a60707052798c887058..814bef8263034c9ba45d39d5b5299061531fb685 100644 (file)
@@ -55,7 +55,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.13 2002/06/10 11:44:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.14 2002/08/02 04:33:53 hartmans Exp $");
 
 #define VFS 1
 
@@ -240,6 +240,7 @@ static int enable_process_stats = 0;        /* enable rx stats */
 static int enable_afsdb = 0;           /* enable AFSDB support */
 #endif
 static int enable_dynroot = 0;         /* enable dynroot support */
+static int enable_fakestat = 0;                /* enable fakestat support */
 #ifdef notdef
 static int inodes = 60;                        /* VERY conservative, but has to be */
 #endif
@@ -341,8 +342,6 @@ int ParseCacheInfoFile()
            printf("\t%d out of 3 fields successfully parsed.\n",
                   parseResult);
 
-       printf("\tcacheMountDir: '%s'\n\tcacheBaseDir: '%s'\n\tcacheBlocks: %d\n",
-              cacheMountDir, cacheBaseDir, cacheBlocks);
        return(1);
     }
 
@@ -1330,6 +1329,10 @@ mainproc(as, arock)
        /* -dynroot */
        enable_dynroot = 1;
     }
+    if (as->parms[27].items) {
+       /* -fakestat */
+       enable_fakestat = 1;
+    }
 
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
@@ -1569,6 +1572,14 @@ mainproc(as, arock)
            printf("%s: Error enabling dynroot support.\n", rn);
     }
 
+    if (enable_fakestat) {
+       if (afsd_verbose)
+           printf("%s: Enabling fakestat support in kernel.\n", rn);
+       code = call_syscall(AFSOP_SET_FAKESTAT, 1);
+       if (code)
+           printf("%s: Error enabling fakestat support.\n", rn);
+    }
+
     /* Initialize AFS daemon threads. */
     if (afsd_verbose)
        printf("%s: Forking AFS daemon.\n", rn);
@@ -1922,6 +1933,7 @@ char **argv; {
                ), "Enable AFSDB support");
     cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, "log(2) of the number of cache files per cache subdirectory");
     cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, "Enable dynroot support");
+    cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support");
     return (cmd_Dispatch(argc, argv));
 }
 
index 22047a5a757913406b5efd0b9d4c57f97dd97711..17b34bf6b1125c35a74f39c67cf41505c9cdd43a 100644 (file)
@@ -1,3 +1,18 @@
+AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [
+AC_MSG_CHECKING(for gfp_mask in struct address_space)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, 
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct address_space _a;
+printf("%d\n", _a.gfp_mask);], 
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)
+CPPFLAGS="$save_CPPFLAGS"])
+
 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [
 AC_MSG_CHECKING(for i_bytes in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
index 14644a269f6c4514a7d2af3dd81e9da212515dfd..ab8d095eed5b1c6d977a3744531774d8ab9ac6c9 100644 (file)
@@ -41,6 +41,7 @@
 #define        AFSOP_AFSDB_HANDLER      30     /* userspace AFSDB lookup handler */
 #define        AFSOP_SET_DYNROOT        31     /* enable/disable dynroot support */
 #define        AFSOP_ADDCELLALIAS       32     /* create alias for existing cell */
+#define        AFSOP_SET_FAKESTAT       33     /* enable/disable fakestat support */
 
 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
 #define        AFSCALL_PIOCTL          20
index 4f9ea914fc92a153ab557143033abd62096c8c69..252d68fb9864c263951639d10102cec9322d19d9 100644 (file)
@@ -35,7 +35,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef __SMP__
 #define __SMP__
 #endif
@@ -51,7 +51,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "alpha_linux_22"
index ebb4e2e9bd639b3495f356ce5aef52a97581cdd3..2bf32a9a170c2fb27f3d7ac73258c4aeff71cbcb 100644 (file)
@@ -37,7 +37,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef __SMP__
 #define __SMP__
 #endif
@@ -53,7 +53,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "alpha_linux_24"
index 7d9254c9b4286d0a3ccecaca0adb238e850a11da..63e5f45a84f40a1d1feeb587667cee8d83515bc5 100644 (file)
@@ -38,7 +38,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef __SMP__
 #define __SMP__
 #endif
@@ -56,7 +56,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "ia64_linux24"
index af619cc796ce0ad481e96b9abee40b7da7bdc84d..1c181bff6857ba6dc4eebf00f72b74b4aded2f92 100644 (file)
@@ -28,7 +28,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef __SMP__
 #define __SMP__
 #endif
@@ -45,8 +45,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
-
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "parisc_linux24"
index 9614398cfbaf345756f7cba506de988aa172b488..1dcb8fed4c324d25f76440920e93ae8355231665 100644 (file)
@@ -31,7 +31,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef CONFIG_S390_LOCAL_APIC
 #define CONFIG_S390_LOCAL_APIC
 #endif
@@ -52,7 +52,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "s390_linux22"
index 66c335eb0a69c6890cb5adddf062e77da324c339..c80aebb6494d3717839d3caa31814fded566d00b 100644 (file)
@@ -33,7 +33,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef CONFIG_S390_LOCAL_APIC
 #define CONFIG_S390_LOCAL_APIC
 #endif
@@ -52,7 +52,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "s390_linux24"
index e63497dce7143dde99cbc7560d556e665c9ddee7..1406385264046da537e89905f3121250ec6af044 100644 (file)
@@ -42,7 +42,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #define __SMP__
 #define AFS_GLOBAL_SUNLOCK
 #endif
index 2bff46edc84603ba8c3338f002e52015369fab0b..3dcdc5362111cf11e1c3e398695d37cc8e0a4428 100644 (file)
@@ -33,7 +33,7 @@
  * MP to compile for Linux
  */
 #ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
 #ifndef __SMP__
 #define __SMP__
 #endif
@@ -50,7 +50,7 @@
 
 #define AFS_USERSPACE_IP_ADDR 1
 #define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "sparc_linux24"
index 1c08816573c280dfadc55ca649a001a45e664a44..6fc3de348eda3d0ecc1f26544484570c0c080dc2 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.11 2001/10/14 18:05:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.12 2002/08/02 04:35:18 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
+#include <errno.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
+#include <afs/errmap_nt.h>
 #define snprintf _snprintf
 #else
 #include <sys/socket.h>
@@ -778,6 +780,8 @@ static SocketListener ()
            code = recvfrom(sock_kerb, packet.data, sizeof(packet.data), 0,
                            (struct sockaddr *) &packet.from, &fromLen);
            if (code < 0) {
+               if (errno == EAGAIN || errno == ECONNREFUSED) 
+                   goto try_kerb5;
                perror ("calling recvfrom");
                break;
            }
@@ -792,10 +796,13 @@ static SocketListener ()
            packet.time = 0;
            process_udp_request (sock_kerb, &packet);
        } 
+try_kerb5:
        if ((sock_kerb5 >= 0) && FD_ISSET(sock_kerb5, &rfds)) {
            code = recvfrom(sock_kerb5, packet.data, sizeof(packet.data), 0,
                            (struct sockaddr *) &packet.from, &fromLen);
            if (code < 0) {
+               if (errno == EAGAIN || errno == ECONNREFUSED) 
+                   continue;
                perror ("calling recvfrom");
                break;
            }
@@ -811,6 +818,15 @@ static SocketListener ()
            process_udp_request (sock_kerb5, &packet);
        } 
     }
+    if (sock_kerb >= 0) {
+       close(sock_kerb);
+       sock_kerb = -1;
+    }
+    if (sock_kerb5 >= 0) {
+       close(sock_kerb5);
+       sock_kerb5 = -1;
+    }
+    printf("UDP SocketListener exiting due to error\n");
 }
 
 #if MAIN
index 006e666faf8068cbc9a98eea43d14b896b17d27a..c8eb620c283f88d316d77be30c4fa4a1a51a1ff4 100644 (file)
@@ -256,7 +256,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.2 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
@@ -331,7 +331,7 @@ base64.o: ${UTIL}/base64.c
 
 syscall.o: ${SYS}/syscall.s
        case "$(SYS_NAME)" in \
-            sun4x_5*) \
+            sun4x_5*|sunx86_5*) \
                /usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                $(RM) syscall.ss;;                              \
index be2903a9eaf9959243a3c4038fc89fc93237d8ab..cfaa3dff31b04022041754ea2335405905cb0e95 100644 (file)
@@ -71,13 +71,13 @@ all: login login.krb
 
 login: ${OBJS} ${LIBS}
        case ${SYS_NAME} in \
-       sun4x_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${LIBS} ${XLIBS} -lcmd;;\
+       sun4x_5? | sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${LIBS} ${XLIBS} -lcmd;;\
        *) ${CC} -g -o $@ ${CFLAGS} ${OBJS} ${LIBS} ${XLIBS} ;;\
        esac 
 
 login.krb: ${KOBJS} ${KLIBS}
        case ${SYS_NAME} in \
-       sun4x_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KLIBS} ${XLIBS} -lcmd;;\
+       sun4x_5? | sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KLIBS} ${XLIBS} -lcmd;;\
        *) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} ${KLIBS} ${XLIBS} ;;\
        esac 
 
index f840d9d4d42d67f8e7f8be0eefc8884e915d9a8e..521a8ca9f349b30f3f487ea4398d38a3a72a5aae 100644 (file)
@@ -40,8 +40,8 @@ LDFLAGS = ${SHARE_LDFLAGS}
          ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
   KLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${LIBSA} ${TOP_LIBDIR}/libauth.krb.a \
          ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
- SHOBJS = afs_auth.o afs_account.o afs_session.o afs_password.o \
-         afs_pam_msg.o afs_message.o afs_util.o AFS_component_version_number.o
+ SHOBJS = afs_account.o afs_session.o afs_password.o \
+         afs_pam_msg.o afs_message.o AFS_component_version_number.o
    OBJS = $(SHOBJS) test_pam.o
 INCLUDES=-I${TOP_SRCDIR}/config -I${TOP_INCDIR} \
        -I/usr/include -I/usr/include/sys
@@ -55,36 +55,48 @@ afs_setcred.o: afs_setcred.c afs_pam_msg.h afs_message.h afs_util.h
 afs_setcred_krb.o: afs_setcred.c afs_pam_msg.h afs_message.h afs_util.h
        ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c afs_setcred.c -o afs_setcred_krb.o
 
-pam_afs.so.1: $(SHOBJS) afs_setcred.o
+afs_auth.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h
+       ${CC} ${CFLAGS}  -c afs_auth.c -o afs_auth.o
+
+afs_auth_krb.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h
+       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV  -c afs_auth.c -o afs_auth_krb.o
+
+afs_util.o: afs_util.c afs_util.h
+       ${CC} ${CFLAGS} -c afs_util.c -o afs_util.o
+
+afs_util_krb.o: afs_util.c afs_util.h
+       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c afs_util.c -o afs_util_krb.o
+
+pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o
        set -x; \
        case "$(SYS_NAME)" in \
        hp_ux*) \
-               $(LD) $(LDFLAGS) -c mapfile.hp -o $@ afs_setcred.o \
+               $(LD) $(LDFLAGS) -c mapfile.hp -o $@ afs_setcred.o afs_auth.o afs_util.o\
                        $(SHOBJS) $(LIBS) ;; \
        sun*_5*) \
-               $(LD) $(LDFLAGS) -M mapfile -o $@ afs_setcred.o \
+               $(LD) $(LDFLAGS) -M mapfile -o $@ afs_setcred.o afs_auth.o afs_util.o\
                        $(SHOBJS) $(LIBS) ;; \
        *linux*) \
-               $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
+               $(CC) $(LDFLAGS) -o $@ afs_setcred.o afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
        *fbsd*) \
-               $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
+               $(CC) $(LDFLAGS) -o $@ afs_setcred.o afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
        * ) \
                echo No link line for system $(SYS_NAME). ;; \
        esac
 
-pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o
+pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o
        set -x; \
        case "$(SYS_NAME)" in \
        hp_ux*) \
                $(LD) $(LDFLAGS) -c mapfile.hp -o $@ \
-                       afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
+                       afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
        sun*_5*) \
                $(LD) $(LDFLAGS) -M mapfile -o $@ \
-                       afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
+                       afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
        *linux*) \
-               $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
+               $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\
        *fbsd*) \
-               $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
+               $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\
        * ) \
                echo No link line for system $(SYS_NAME). ;; \
        esac
index 8b492132fa4d2ac66287a824c2836fef697c9d8d..783280f662279d1ce92de37202eaad00cd9a3326 100644 (file)
@@ -75,12 +75,10 @@ static inline void MUTEX_ENTER(afs_kmutex_t *l)
 /* And how to do a good tryenter? */
 static inline int MUTEX_TRYENTER(afs_kmutex_t *l)
 {
-    if (!l->owner) {
-       MUTEX_ENTER(l);
-       return 1;
-    }
-    else
-       return 0;
+    if (down_trylock(&l->sem))
+        return 0;
+    l->owner = current->pid;
+    return 1;
 }
 
 static inline void MUTEX_EXIT(afs_kmutex_t *l)
@@ -99,14 +97,26 @@ static inline void MUTEX_EXIT(afs_kmutex_t *l)
 #endif
 #define CV_DESTROY(cv)
 
-/* CV_WAIT and CV_TIMEDWAIT rely on the fact that the Linux kernel has
- * a global lock. Thus we can safely drop our locks before calling the
- * kernel sleep services.
+/* CV_WAIT and CV_TIMEDWAIT sleep until the specified event occurs, or, in the
+ * case of CV_TIMEDWAIT, until the specified timeout occurs.
+ * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE
+ *   can wake up, even if all signals are blocked
+ * - TODO: handle signals correctly by passing an indication back to the
+ *   caller that the wait has been interrupted and the stack should be cleaned
+ *   up preparatory to signal delivery
  */
 static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
 {
     int isAFSGlocked = ISAFS_GLOCK(); 
     sigset_t saved_set;
+#ifdef DECLARE_WAITQUEUE
+    DECLARE_WAITQUEUE(wait, current);
+#else
+    struct wait_queue wait = { current, NULL };
+#endif
+    add_wait_queue(cv, &wait);
+    set_current_state(TASK_INTERRUPTIBLE);
 
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
@@ -117,19 +127,16 @@ static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
     recalc_sigpending(current);
     spin_unlock_irq(&current->sigmask_lock);
 
-#if defined(AFS_LINUX24_ENV)
-    interruptible_sleep_on((wait_queue_head_t *)cv);
-#else
-    interruptible_sleep_on((struct wait_queue**)cv);
-#endif
+    schedule();
+    remove_wait_queue(cv, &wait);
 
     spin_lock_irq(&current->sigmask_lock);
     current->blocked = saved_set;
     recalc_sigpending(current);
     spin_unlock_irq(&current->sigmask_lock);
 
-    MUTEX_ENTER(l);
     if (isAFSGlocked) AFS_GLOCK();
+    MUTEX_ENTER(l);
 
     return 0;
 }
@@ -139,6 +146,14 @@ static inline int CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime
     int isAFSGlocked = ISAFS_GLOCK();
     long t = waittime * HZ / 1000;
     sigset_t saved_set;
+#ifdef DECLARE_WAITQUEUE
+    DECLARE_WAITQUEUE(wait, current);
+#else
+    struct wait_queue wait = { current, NULL };
+#endif
+    add_wait_queue(cv, &wait);
+    set_current_state(TASK_INTERRUPTIBLE);
 
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
@@ -149,19 +164,16 @@ static inline int CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime
     recalc_sigpending(current);
     spin_unlock_irq(&current->sigmask_lock);
 
-#if defined(AFS_LINUX24_ENV)
-    t = interruptible_sleep_on_timeout((wait_queue_head_t *)cv, t);
-#else
-    t = interruptible_sleep_on_timeout((struct wait_queue**)cv, t);
-#endif
+    t = schedule_timeout(t);
+    remove_wait_queue(cv, &wait);
     
     spin_lock_irq(&current->sigmask_lock);
     current->blocked = saved_set;
     recalc_sigpending(current);
     spin_unlock_irq(&current->sigmask_lock);
 
-    MUTEX_ENTER(l);
     if (isAFSGlocked) AFS_GLOCK();
+    MUTEX_ENTER(l);
 
     return 0;
 }
index 9fd3e7214da5f9d9043662b1cbbf003575c49d7f..bd2cac240afb123aba9143fc1d52d6e54d3ed0f5 100644 (file)
@@ -38,7 +38,7 @@ CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -DRXDEBUG ${XCFLAGS}
 # Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
 # Really the xdr stuff should be in its own directory.
 #
-XDROBJS = xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
+XDROBJS = xdr.o xdr_array.o 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 \
index e800790512a3311830dab5d6f5d41ce3129aa845..9bef2e902ce0035dc100231067586136a28a8e18 100644 (file)
 #endif
 #include <afsconfig.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_clock.c,v 1.1.1.6 2001/10/14 18:06:18 hartmans Exp $");
+#ifdef AFS_SUN59_ENV
+#include <sys/time_impl.h>
+#endif
+
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_clock.c,v 1.1.1.7 2002/08/02 04:36:19 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
index fe56489b8bc0f79595ddfeb834dbdd462db26e06..394eb02589463726f807da774f671c6bc6721d17 100644 (file)
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.6 2002/05/11 00:01:25 hartmans Exp $");
+#ifdef AFS_SUN59_ENV
+#include <sys/time_impl.h>
+#endif
+
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.7 2002/08/02 04:36:20 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
index f2043fc141ed2434d975cb6e5a1c741fc220364c..b9663636e82490cbd6bc5470e82caf5ae514a867 100644 (file)
@@ -12,7 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_lwp.c,v 1.1.1.8 2001/07/14 22:23:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_lwp.c,v 1.1.1.9 2002/08/02 04:36:22 hartmans Exp $");
 
 # include <sys/types.h>                /* fd_set on older platforms */
 # include <errno.h>
@@ -431,7 +431,9 @@ int rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
 #elif defined(AFS_LINUX22_ENV)
          /* linux unfortunately returns ECONNREFUSED if the target port
           * is no longer in use */
-       if (errno != EWOULDBLOCK && errno != ENOBUFS && errno != ECONNREFUSED)
+         /* and EAGAIN if a UDP checksum is incorrect */
+       if (errno != EWOULDBLOCK && errno != ENOBUFS &&
+           errno != ECONNREFUSED && errno != EAGAIN)
 #else
        if (errno != EWOULDBLOCK && errno != ENOBUFS)
 #endif
index 7545c48b7da97fa5faece7a573b7972786f6b29b..c2709d2e2b151723456a2ef420bbb04a3b5288c0 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_pthread.c,v 1.1.1.8 2001/10/14 18:06:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_pthread.c,v 1.1.1.9 2002/08/02 04:36:23 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -403,7 +403,8 @@ rxi_Sendmsg(socket, msg_p, flags)
 #ifdef AFS_LINUX22_ENV
     /* linux unfortunately returns ECONNREFUSED if the target port
      * is no longer in use */
-    if (ret == -1 && errno != ECONNREFUSED) {
+    /* and EAGAIN if a UDP checksum is incorrect */
+    if (ret == -1 && errno != ECONNREFUSED && errno != EAGAIN) {
 #else
     if (ret == -1) {
 #endif
index e5cb6884ebbf60f0ecfd17d760d61a9373d28b3d..774608df0c5340243240333e1994974b110ab384 100644 (file)
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.9 2002/06/10 11:47:28 hartmans Exp $");
+#ifdef AFS_SUN59_ENV
+#include <sys/time_impl.h>
+#endif
+
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.10 2002/08/02 04:36:36 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
index 338ce9c901fa724ec10114f326e4a70dd9a556eb..5f155afc7e54f0ac583e624938d2ef3ca3a00c8a 100644 (file)
@@ -45,7 +45,7 @@ BUCOORD = ../bucoord
 VOLSER  = ../volser
 
 BUCOORDOBJS=ubik_db_if.o ${BUCOORD}/volstub.o ${BUCOORD}/dlq.o \
-           ${BUCOORD}/status.o ${BUCOORD}/bucoord_errs.o
+           status.o ${BUCOORD}/bucoord_errs.o
 
 VOLSERLIBOBJ=${VOLSER}/volint.cs.o  vsprocs.o              ${VOLSER}/vsutils.o \
             ${VOLSER}/lockprocs.o  ${VOLSER}/volint.xdr.o ${VOLSER}/volerr.o \
@@ -138,6 +138,9 @@ butc_xbsa.o: ${BUTC}/butc_xbsa.c ${BUTC}/butc_xbsa.h ${BUTCINCLS}
 ubik_db_if.o: ${BUCOORD}/ubik_db_if.c
        ${CC} ${CFLAGS} -c ${BUCOORD}/ubik_db_if.c
 
+status.o: ${BUCOORD}/status.c
+       ${CC} ${CFLAGS} -c ${BUCOORD}/status.c
+
 vsprocs.o: ${VOLSER}/vsprocs.c
        ${CC} ${CFLAGS} -c ${VOLSER}/vsprocs.c
 
index 135e77a830402748b490539d0a2b797799c17934..ce3b46790f75c93a0d6cf6a033026ef4fe97c2f4 100644 (file)
@@ -8,14 +8,14 @@
 ## License.  For details, see the LICENSE file in the top-level source
 ## directory or online at http://www.openafs.org/dl/license10.html
 ##
-## openafs-tools, Version 1.2.2 ##
+## openafs-tools, Version 1.2.5 ##
 
 Follow these steps to create a binary distribution RPM for the 
 openafs-tools-cmd package no Red Hat Linux:
 
 1) Copy the spec file to your SPECS directory.
 
-  cp openafs-tools-cmd-1.2.2-1.spec /usr/src/redhat/SPECS/
+  cp openafs-tools-cmd-1.2.5-1.spec /usr/src/redhat/SPECS/
 
 2) Create the source package by running:
 
@@ -27,7 +27,7 @@ openafs-tools-cmd package no Red Hat Linux:
 3) Now you can create the RPM:
 
   cd /usr/src/redhat/SPECS
-  rpm -ba --clean openafs-tools-cmd-1.2.2-1.i386.rpm
+  rpm -ba --clean openafs-tools-cmd-1.2.5-1.i386.rpm
 
   The RPM is now ready for use in the 
 /usr/src/redhat/RPMS directory.
index 79d6293876a7463196ed418d96c6e02be6e07cf0..bc25cb70a1db3d408199942010b5f964644046f9 100644 (file)
@@ -28,7 +28,10 @@ rm -f /usr/vice/etc/CellServDB
 rm -f /usr/vice/etc/ThisCell
 rm -f /usr/vice/etc/AFSLog
 rm -rf /usr/vice/cache
+rm -f $afscodeFileDir/install_output
+rm -f $afscodeFileDir/done.txt
 mkdir /usr/vice/cache
+echo "If you were using K5 authentication, make sure you delete all AFS related principals."
 echo "Uninstall" > $afscodeFileDir/.afs_state
 echo "complete" >> $afscodeFileDir/.afs_state
 
index a8bfa140473c2d6267356a4acf603a03747019f8..26fc79b5f3b59c4e09741c0513502307c07924de 100644 (file)
@@ -35,6 +35,8 @@ if [ $1 = "help" ]; then
   echo -e "\t-adminPassword (or -p) password: the administrative\n\t    password of the cell.  Ignored if this is not a server"
   echo -e "\t-existingServer (or -e) name: the name of an\n\t   existing server already in the cell.  Ignored if\n\t   this is not an additional server"
   echo -e "\t-scriptDirectory (or -d) name: the name of the\n\t   directory containing these OpenAFS installation\n\t   scripts"
+  echo -e "\t-krb5 (or -k): Set up Kerberos 5 authentication on this\n\t   machine.  Assumes this machine is a client of a Kerberos\n\t   realm that has the same name as the cell being created,\n\t   but all caps.  Ignored if this is not a first server."
+  echo -e "\t-kadminPassword (or -ka) password: the administrative\n\t   password of the kerberos realm.  Ignored if the -krb5\n\t   flag is not set."
   echo -e "\t-noConf (or -n): Do not ask for confirmation before\n\t    performing the installation."
   echo -e "\thelp: Display this help dialogue"
   echo
@@ -57,7 +59,7 @@ while [ $# -gt 0 ]; do
   if [ $# -ne 0 ]; then 
     shift
   fi
-  if [ $flag != "-noConf" -a $flag != "-n" ]; then
+  if [ $flag != "-noConf" -a $flag != "-n" -a $flag != "-krb5" -a $flag != "-k" ]; then
     val=$1
     if [ $# -ne 0 ]; then 
       shift
@@ -126,10 +128,16 @@ while [ $# -gt 0 ]; do
   else
   if [ $flag = "-noConf"  -o $flag = "-n" ]; then
      noConf=$val
+  else 
+  if [ $flag = "-krb5"  -o $flag = "-k" ]; then
+     krb5=$val
+  else
+  if [ $flag = "-kadminPassword" -o $flag = "-ka" ]; then
+     kadminPassword=$val
   else
     echo Invalid flag $flag.  Use \"install_afs help\" for syntax.
     exit 0;
-  fi fi fi fi fi fi fi fi fi fi
+  fi fi fi fi fi fi fi fi fi fi fi fi
 done
 
 # Collect variables not given:
@@ -267,6 +275,31 @@ if [ $serverType -ne $notServer ]; then
   done
 fi
 
+if [ $krb5 -ne 0 ]; then 
+  while [ -z $kadminPassword ]; do
+    echo -ne "Provide the administrative password of the Kerberos realm: "
+    stty -echo echonl
+    read kadminPassword
+    stty echo
+    echo -ne "Please confirm the password: "
+    stty -echo echonl
+    read kadminPassword2
+    stty echo
+
+    if [ -z $kadminPassword ]; then
+      echo -e "You must give a password"
+    else 
+    if [ -z $kadminPassword2 ]; then
+      echo -e "You must confirm the password"
+      adminPassword=""
+    else
+    if [ $kadminPassword != $kadminPassword2 ]; then
+      echo -e "Passwords do not match"
+      kadminPassword=""
+    fi fi fi
+  done
+fi
+
 # Make sure the needed files exist:
 if [ $serverType -eq $addServer ]; then
   while [ ! -e $scriptDir/afs/ -o ! -e $scriptDir/afs/ThisCell -o ! -e $scriptDir/afs/CellServDB -o ! -e $scriptDir/afs/KeyFile -o  ! -e $scriptDir/afs/UserList ]; do
@@ -430,21 +463,35 @@ if [ $serverType -ne $notServer ]; then
     echo kill ${bosserver_process%% /*}
     kill ${bosserver_process%% /*}
 
-    /usr/afs/bin/kaserver -noauth &
+    if [ -z $krb5 ]; then
+      /usr/afs/bin/kaserver -noauth &
  
-    echo Configuring kaserver
-    kas create afs -initial_password $afsPassword -cell $cellName -noauth
-    kas examine -name afs -cell $cellName -noauth
-    kas create admin -initial_password $adminPassword -cell $cellName -noauth
-    kas setfields admin -flags admin -cell $cellName -noauth
-    kas examine -name admin -cell $cellName -noauth
+      echo Configuring kaserver
+      kas create afs -initial_password $afsPassword -cell $cellName -noauth
+      kas examine -name afs -cell $cellName -noauth
+      kas create admin -initial_password $adminPassword -cell $cellName -noauth
+      kas setfields admin -flags admin -cell $cellName -noauth
+      kas examine -name admin -cell $cellName -noauth
     
-    kaserver_process=$(ps -Ao pid,cmd | grep kaserver)
-    echo kill ${kaserver_process%% /*}
-    kill ${kaserver_process%% /*}
+      kaserver_process=$(ps -Ao pid,cmd | grep kaserver)
+      echo kill ${kaserver_process%% /*}
+      kill ${kaserver_process%% /*}
+   
+    else 
+
+      echo Setting up krb5
+      kadmin -p admin/admin -w $kadminPassword -q "addprinc -pw $adminPassword afs"
+      kadmin -p admin/admin -w $kadminPassword -q "modprinc -kvno 0 afs"
+      kadmin -p admin/admin -w $kadminPassword -q "ktadd -k /etc/krb5.keytab -e des-cbc-crc:afs3 afs"
+      asetkey add 1 /etc/krb5.keytab afs
+      kadmin -p admin/admin -w $kadminPassword -q "ktremove -k /etc/krb5.keytab afs all"
+      kadmin -p admin/admin -w $kadminPassword -q "addprinc -pw $adminPassword admin"
+      kadmin -p admin/admin -w $kadminPassword -q "ktadd -k /etc/krb5.keytab admin" 
+
+    fi
 
     echo Bootstrapping ptserver
-    echo -e "admin 128/20 1 -204 -204\nsystem:administrators 130/20 -204 -204 -204\n   admin   1\n" | pt_util -p /usr/afs/db/prdb.DB0 -w
+    echo -e "admin 128/20 1 -204 -204\nsystem:administrators 130/20 -204 -204 -204\n   admin   1\n" | /usr/afs/bin/pt_util -p /usr/afs/db/prdb.DB0 -w
 
   fi
 
@@ -464,8 +511,10 @@ if [ $serverType -eq $firstServer ]; then
 #
   echo Starting the Database Server Processes
 #
-  echo bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
-  bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
+  if [ -z $krb5 ]; then
+    echo bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
+    bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
+  fi
   echo bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
   bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
   echo bos create -server $machineName -instance ptserver -type simple -cmd /usr/afs/bin/ptserver -cell $cellName -localauth
@@ -552,9 +601,16 @@ echo Continuing with Verifying ths AFS Initialization Script
 echo /etc/rc.d/init.d/afs start
 /etc/rc.d/init.d/afs start
 if [ $serverType -ne $notServer ]; then
-  # klog in as admin
-  echo klog admin -password 
-  klog admin -password $adminPassword
+  if [ -z $krb5 ]; then
+    # klog in as admin
+    echo klog admin -password 
+    klog admin -password $adminPassword
+  else
+    kinit -t /etc/krb5.keytab admin
+    aklog
+  fi
+
   # verify klog worked correctly:
   echo tokens
   tokens
@@ -616,9 +672,16 @@ if [ $serverType -eq $firstServer ]; then
   /etc/rc.d/init.d/afs start
   cd /afs
 
-  # klog in as admin
-  echo klog admin -password 
-  klog admin -password $adminPassword
+  if [ -z $krb5 ]; then
+    # klog in as admin
+    echo klog admin -password 
+    klog admin -password $adminPassword
+  else
+    kinit -t /etc/krb5.keytab admin
+    aklog
+    kadmin -p admin/admin -w $kadminPassword -q "ktremove -k /etc/krb5.keytab admin all"
+    kadmin -p admin/admin -w $kadminPassword -q "cpw -pw $adminPassword admin"
+  fi
 
   # Wait for Ubik to elect a quorum
   echo Waiting for a quorum election . . .
@@ -629,8 +692,6 @@ if [ $serverType -eq $firstServer ]; then
   echo fs examine /afs/$cellName
   fs examine /afs/$cellName
 
-#
-#
 fi
 fs checkvolumes
 #
index c138e6f091d4f62e6a6f9be6d549e1a1182cffcf..5b634ba99091414b55c9fe68b61d3fc3f6c5cf45 100644 (file)
@@ -28,6 +28,8 @@ cp $mainFileDir/afsinit_client .
 cp $mainFileDir/afsinit_server .
 cp $mainFileDir/afs_uninstall .
 cp $mainFileDir/install_afs .
+cp $mainFileDir/K5_README .
+cp $mainFileDir/check_udebug.pl .
 cp $mainFileDir/write_fstab.pl .
 cp $mainFileDir/write_pam.pl .
 #
index 6a11181dbbddacd654fbfd9d1819253641845124..66dd9f5fe51db6e2d0e16e5ea23cd737e2197185 100644 (file)
@@ -26,6 +26,7 @@ cp -f afsinit_client $mainFileDir/
 cp -f afsinit_server $mainFileDir/
 cp -f afs_uninstall $mainFileDir/
 cp -f install_afs $mainFileDir/
+cp -f K5_README $mainFileDir/
 cp -f check_udebug.pl $mainFileDir/
 cp -f write_fstab.pl $mainFileDir/
 cp -f write_pam.pl $mainFileDir/
index 8c87c6824cb7d02a2547ead1c4d37b4f123a6298..7abb71a8282cf8350684494fa927d8a72a5618d1 100644 (file)
@@ -9,7 +9,7 @@
 ## License.  For details, see the LICENSE file in the top-level source
 ## directory or online at http://www.openafs.org/dl/license10.html
 ##
-## openafs-tools, Version 1.2.2 ##
+## openafs-tools, Version 1.2.5 ##
 
 ####################### TABLE OF CONTENTS ###########################
 
@@ -57,7 +57,7 @@ are:
       openafs-server-1.2.2-rh6.2.1.i386.rpm
     Red Hat 7.1:
       openafs-kernel-1.2.2-rh7.1.1.i386.rpm
-      openafs-1.2.2-rh7.11..i386.rpm 
+      openafs-1.2.2-rh7.1.1.i386.rpm 
       openafs-client-1.2.2-rh7.1.1.i386.rpm 
       openafs-server-1.2.2-rh7.1.1.i386.rpm
 Once these are downloaded, install them (using an rpm -i or rpm -U
@@ -65,7 +65,7 @@ command).
 
 c) OpenAFS Tools
     Now all that's left to do is install the OpenAFS Tools rpm.  The
-file you need is openafs-tools-1.1.1-1.i386.rpm.  Install it using 
+file you need is openafs-tools-1.2.2-1.i386.rpm.  Install it using 
 an rpm -i or rpm -U command.  This will create several directories
 and populate your system with necessary files.  The main directories
 created and populated is:
@@ -82,9 +82,28 @@ to set the machine up.  If you do not specify needed arguments
 on the command line, you will be prompted for them interactively.
 To get a rundown on how to use install_afs, execute:
   /usr/afs/tools/install/install_afs help
-Once configured correctly, this machine will run the installation 
-program (the same one run by the web interface), and restart your
-computer.
+
+If you are creating an additional server or not a server, OpenAFS 
+Tools will ensure that you have all the required files on your 
+system.  These are files needed by the OpenAFS installation program 
+to connect you to cells that already exist.  You must get these files
+manually from an existing server, as we have not yet implemented
+a secure way of doing this automatically.  For additional servers,
+the files you need to copy are:
+    - Copy the /usr/afs/etc/ThisCell file from the existing server
+to /usr/afs/tools/install/afs/ThisCell on your machine.
+    - Copy the /usr/afs/etc/CellServDB file from the existing server
+to /usr/afs/tools/install/afs/CellServDB on your machine.
+    - Copy the /usr/afs/etc/KeyFile file from the existing server
+to /usr/afs/tools/install/afs/KeyFile on your machine.
+    - Copy the /usr/afs/etc/UserList file from the existing server
+to /usr/afs/tools/install/afs/UserList on your machine.
+    - Copy the /usr/vice/etc/CellServDB file from the existing server
+to /usr/afs/tools/install/vice/CellServDB on your machine.
+
+    For client-only installation, you need the following file:
+    - Copy the /usr/vice/etc/CellServDB file from the existing server
+to /usr/afs/tools/install/vice/CellServDB on your machine.
 
 b) OpenAFS Uninstallation 
 
@@ -126,7 +145,7 @@ What follows is a brief summary of the installation process.
   - Installation starts with the script install_afs.  The first thing
 it does is ensure that the files needed for setting up additional 
 servers and/or clients exist in the appropriate places (see section 
-3.a.i for a description of these files).  Then, after indicating to 
+3.a for a description of these files).  Then, after indicating to 
 the state file that installation has begun, it begins installing 
 OpenAFS.
   - For clients, it then enables Pam Login Authentication using
@@ -149,7 +168,7 @@ account for the server processes and will not be needed by the user.
 Currently we use the administrative password for the afs account
 password.  The admin account is now added to the bos server database
 and a pts entry is created as well.  Also, the afs account password
-is added as a key for the server. The kaserver proces is terminated.  
+is added as a key for the server. The kaserver process is terminated.  
 The pts database is then bootstrapped to add the administrator to it.  
   - For first servers, a normal bosserver is started.  It then 
 creates the database server processes (kaserver, buserver, ptserver, 
@@ -182,8 +201,7 @@ is notified that installation is complete, and then the script ends.
 
 b) OpenAFS Uninstallation
 
-    Uninstallation has only two files: the main script and the 
-redirection script.
+    Uninstallation has only one file:
   /usr/afs/tools/install/afs_uninstall
 Here is a brief summary of what it does to uninstall OpenAFS:
   - First it indicates to the state file that uninstallation has 
index 76249bd97f2a0f84dca94d38aae12064457e6f57..c020d061c6c9f86613c07af0244c4469ba29b701 100644 (file)
@@ -96,6 +96,9 @@ ConstructLocalLogPath(const char *cpath,
 /* afs installation dir names */
 #define AFSDIR_ETC_DIR   "etc"
 #define AFSDIR_BIN_DIR   "bin"
+#define AFSDIR_SERVER_ETC_DIR   "etc"
+#define AFSDIR_SERVER_BIN_DIR   "bin"
+#define AFSDIR_CLIENT_ETC_DIR   "etc"
 #define AFSDIR_CORES_DIR "cores"
 #define AFSDIR_DB_DIR    "db"
 #define AFSDIR_LOGS_DIR  "logs"
@@ -103,10 +106,13 @@ ConstructLocalLogPath(const char *cpath,
 #define AFSDIR_BACKUP_DIR "backup"
 #define AFSDIR_MIGR_DIR  "local/migrate"
 #define AFSDIR_BIN_FILE_DIR  "local/migrate/bin_files"
+#define AFSDIR_BOSCONFIG_DIR "local"
+#define AFSDIR_BOSSERVER_DIR "bin"
 
 /* file names */ 
 #define AFSDIR_THISCELL_FILE    "ThisCell"
 #define AFSDIR_CELLSERVDB_FILE  "CellServDB"
+#define AFSDIR_CELLALIAS_FILE   "CellAlias"
 #define AFSDIR_KEY_FILE         "KeyFile"
 #define AFSDIR_ULIST_FILE       "UserList"
 #define AFSDIR_NOAUTH_FILE      "NoAuth"
@@ -248,6 +254,7 @@ typedef enum afsdir_id {
       AFSDIR_SERVER_MIGRATE_DIRPATH_ID,
       AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID,
       AFSDIR_SERVER_BIN_FILE_DIRPATH_ID,
+      AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID,
       AFSDIR_PATHSTRING_MAX } afsdir_id_t;
 
 /* getDirPath() returns a pointer to a string from an internal array of path strings 
index 460e8299fffce17616d4767369139a7431548b00..fcb13e4d2b36a9c1a25e9eb6203f85f0de83744f 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.7 2001/10/14 18:07:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.8 2002/08/02 04:37:25 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/sysincludes.h"
@@ -141,6 +141,66 @@ uuid_time_p_t           time2; {
     return (0);
 }
 
+#if !defined(KERNEL) && !defined(UKERNEL)
+/*
+ *    Converts a string UUID to binary representation.
+ */
+
+int
+afsUUID_from_string(const char *str, afsUUID *uuid)
+{
+    unsigned int time_low, time_mid, time_hi_and_version;
+    unsigned int clock_seq_hi_and_reserved, clock_seq_low;
+    unsigned int node[6];
+    int i;
+
+    i = sscanf(str, "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
+               &time_low,
+               &time_mid,
+               &time_hi_and_version,
+               &clock_seq_hi_and_reserved,
+               &clock_seq_low,
+               &node[0], &node[1], &node[2], &node[3], &node[4], &node[5]);
+    if (i != 11)
+        return -1;
+    
+    uuid->time_low = time_low;
+    uuid->time_mid = time_mid;
+    uuid->time_hi_and_version = time_hi_and_version;
+    uuid->clock_seq_hi_and_reserved = clock_seq_hi_and_reserved;
+    uuid->clock_seq_low = clock_seq_low;
+
+    for (i = 0; i < 6; i++)
+        uuid->node[i] = node[i];
+
+    return 0;
+}
+
+/*
+ *    Converts a UUID from binary representation to a string representation.
+ */
+
+int
+afsUUID_to_string(const afsUUID *uuid, char *str, size_t strsz)
+{
+    snprintf(str, strsz,
+             "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
+             uuid->time_low,
+             uuid->time_mid,
+             uuid->time_hi_and_version,
+             (unsigned char)uuid->clock_seq_hi_and_reserved,
+             (unsigned char)uuid->clock_seq_low,
+             (unsigned char)uuid->node[0],
+             (unsigned char)uuid->node[1],
+             (unsigned char)uuid->node[2],
+             (unsigned char)uuid->node[3],
+             (unsigned char)uuid->node[4],
+             (unsigned char)uuid->node[5]);
+
+    return 0;
+}
+#endif
+
 afs_int32 afs_uuid_create (uuid)
 afsUUID *uuid; {
     uuid_address_t eaddr;
index cdf33b56844ca5e4035bfb9d13b83129cda6d006..599d35715d2e64de0346d59d60c0f77778e63493 100644 (file)
@@ -105,7 +105,7 @@ ${DEST}/etc/kdump: kdump
                for f in kdump.IP??; \
                        do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
                done ;; \
-       sun4x_5[789] ) \
+       sun*_5[789] ) \
                ${INSTALLex} -f kdump.sh.solaris7 $@; \
                ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
        *linux* ) \
@@ -228,7 +228,7 @@ kdump:  kdump.o
        case ${SYS_NAME} in \
        sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
                ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
-       sun4x_5? ) \
+       sun*_5? ) \
                ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
        sgi_6? ) \
                for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
@@ -320,7 +320,7 @@ ${DESTDIR}${sbindir}/kdump: kdump
                for f in kdump.IP??; \
                        do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
                done ;; \
-       sun4x_5[789] ) \
+       sun*_5[789] ) \
                ${INSTALLex} -f kdump.sh.solaris7 $@; \
                ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
        *linux* ) \
index 9a79dbb4ae21803ff4c6acbb5bc04ae96bdc3343..4dae14c77d6e0d5156fd97fc4619dd5e72554088 100644 (file)
@@ -38,7 +38,7 @@ static int newVLDB = 1;
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.5 2001/09/11 14:35:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.6 2002/08/02 04:37:35 hartmans Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
@@ -317,7 +317,7 @@ static void FSYNC_com(fd)
     int fd;
 {
     byte rc = FSYNC_OK;
-    int n, i;
+    int n, i, ack = 1;
     Error error;
     struct command command;
     int leaveonline;
@@ -503,6 +503,12 @@ defect #2080 for details.
                vp->specialStatus = VMOVED;
                VPutVolume_r(vp);
            }
+#ifdef AFS_NT40_ENV
+           send(fd, &rc, 1, 0);
+#else
+           write(fd, &rc, 1);
+#endif
+           ack = 0;
            if (V_BreakVolumeCallbacks) {
                Log("fssync: volume %u moved to %x; breaking all call backs\n",
                    command.volume, command.reason);
@@ -515,6 +521,12 @@ defect #2080 for details.
            break;
        case FSYNC_RESTOREVOLUME:
            /* if the volume is being restored, break all callbacks on it*/
+#ifdef AFS_NT40_ENV
+           send(fd, &rc, 1, 0);
+#else
+           write(fd, &rc, 1);
+#endif
+           ack = 0;
            if (V_BreakVolumeCallbacks) {
                VOL_UNLOCK
                VATTACH_UNLOCK
@@ -529,11 +541,13 @@ defect #2080 for details.
     }
     VOL_UNLOCK
     VATTACH_UNLOCK
+    if (ack) {
 #ifdef AFS_NT40_ENV
-    send(fd, &rc, 1, 0);
+       send(fd, &rc, 1, 0);
 #else
-    write(fd, &rc, 1);
+       write(fd, &rc, 1);
 #endif
+    }
 }
 
 static void FSYNC_Drop(fd)
index c583bd0af61fc8c901b306d29e916ece93735232..e471dea5474693f16bb1183f7a72f1ef8c0b38ce 100644 (file)
@@ -50,8 +50,8 @@
  */
 struct DiskPartition {
     struct DiskPartition *next;
-    char       name[32];       /* Mounted partition name */
-    char       devName[32];    /* Device mounted on */
+    char       *name;          /* Mounted partition name */
+    char       *devName;       /* Device mounted on */
     Device     device;         /* device number */
     int                lock_fd;        /* File descriptor of this partition if locked; otherwise -1;
                                   Not used by the file server */
index e290ea1832f1f81f95bdefd516abce04c9950843..7be40ed73aa3cfdb5a6669d07148be4697185ede 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.9 2002/01/22 19:55:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.10 2002/08/02 04:37:52 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -62,6 +62,8 @@ struct tqHead {
 };
 
 
+struct hostent *hostutil_GetHostByName(register char *ahost);
+
 #define COMMONPARMS     cmd_Seek(ts, 12);\
 cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
 cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");\
@@ -3793,33 +3795,26 @@ register struct cmd_syndesc *as;
     return 0;
 }
 
-static ListAddrs(as)
-register struct cmd_syndesc *as;
-
+static void
+print_addrs(const bulkaddrs *addrs, const afsUUID *m_uuid, int nentries, int print, int noresolve)
 {
   afs_int32 vcode;
   afs_int32 i, j;
   struct VLCallBack    unused;
-  afs_int32                nentries, *addrp;
-  bulkaddrs            addrs, m_addrs;
+  afs_int32            *addrp;
+  bulkaddrs            m_addrs;
   ListAddrByAttributes m_attrs;
-  afsUUID              m_uuid;
-  afs_int32                m_unique, m_nentries, *m_addrp;
-  afs_int32                base, index;
+  afs_int32            m_unique, m_nentries, *m_addrp;
+  afs_int32            base, index;
+  char buf[1024];
 
-  /* Get the list of non multihomed fileservers */
-  addrs.bulkaddrs_val = 0;
-  addrs.bulkaddrs_len = 0;
-  vcode = ubik_Call_New(VL_GetAddrs, cstruct, 0,
-                       0, 0, &unused, &nentries, &addrs);
-  if (vcode) {
-     fprintf(STDERR,"vos: could not list the server addresses\n");
-     PrintError("",vcode);
-     return( vcode );
+  if (print) {
+      afsUUID_to_string(m_uuid, buf, sizeof(buf));
+      printf("UUID: %s\n", buf);
   }
 
   /* print out the list of all the server */
-  addrp = (afs_int32 *)addrs.bulkaddrs_val;
+  addrp = (afs_int32 *)addrs->bulkaddrs_val;
   for (i=0; i<nentries; i++, addrp++) {
      /* If it is a multihomed address, then we will need to 
       * get the addresses for this multihomed server from
@@ -3848,7 +3843,12 @@ register struct cmd_syndesc *as;
           m_addrp = (afs_int32 *)m_addrs.bulkaddrs_val;
           for (j=0; j<m_nentries; j++, m_addrp++) {
              *m_addrp = htonl(*m_addrp);       
-             printf("%s ", hostutil_GetNameByINet(*m_addrp));
+             if (noresolve) {
+                 char hoststr[16];
+                 printf("%s ", afs_inet_ntoa_r(*m_addrp,hoststr));
+             } else {
+                 printf("%s ", hostutil_GetNameByINet(*m_addrp));
+             }
           }
           if (j==0) {
              printf("<unknown>\n");
@@ -3863,12 +3863,92 @@ register struct cmd_syndesc *as;
      /* Otherwise, it is a non-multihomed entry and contains
       * the IP address of the server - print it.
       */
-     printf ("%s\n", hostutil_GetNameByINet(htonl(*addrp)));
+     *addrp = htonl(*addrp);   
+     if (noresolve) {
+        char hoststr[16];
+        printf("%s\n", afs_inet_ntoa_r(*addrp,hoststr));
+     } else {
+        printf("%s\n", hostutil_GetNameByINet(*addrp));
+     }
+  }
+
+  if (print) {
+      printf("\n");
+  }
+  return;
+}
+
+static ListAddrs(as)
+register struct cmd_syndesc *as;
+{
+  afs_int32 vcode;
+  afs_int32 i, j, noresolve=0, printuuid=0;
+  struct VLCallBack    unused;
+  afs_int32                nentries, *addrp;
+  bulkaddrs            addrs, m_addrs;
+  ListAddrByAttributes m_attrs;
+  afsUUID              m_uuid, askuuid;
+  afs_int32                m_unique, m_nentries, *m_addrp;
+  afs_int32                base, index;
+
+  memset(&m_attrs, 0, sizeof(struct ListAddrByAttributes));
+  m_attrs.Mask = VLADDR_INDEX;
+
+  memset(&m_addrs, 0, sizeof(bulkaddrs));
+  memset(&askuuid, 0, sizeof(afsUUID));
+  if (as->parms[0].items) {
+      /* -uuid */
+      afsUUID_from_string(as->parms[0].items->data, &askuuid);
+      m_attrs.Mask = VLADDR_UUID;
+      m_attrs.uuid = askuuid;
+  }
+  if (as->parms[1].items) {
+      /* -host */
+      struct hostent       *he; 
+      afs_int32 saddr;
+      he = hostutil_GetHostByName((char*)as->parms[1].items->data);
+      if (he == (struct hostent *)0) {
+         fprintf(stderr,
+                 "Can't get host info for '%s'\n",
+                 as->parms[1].items->data);
+         exit(-1);
+      }
+      memcpy(&saddr, he->h_addr, 4);
+      m_attrs.Mask = VLADDR_IPADDR;
+      m_attrs.ipaddr = ntohl(saddr);
   }
+  if (as->parms[2].items) {
+      noresolve=1;
+  }
+  if (as->parms[3].items) {
+      printuuid=1;
+  }
+
+  m_nentries            = 0;
+  m_addrs.bulkaddrs_val = 0;
+  m_addrs.bulkaddrs_len = 0;
+  i=1;
+  while (1) {
+      m_attrs.index = i;
 
-  if (addrs.bulkaddrs_val) {
-     free (addrs.bulkaddrs_val);
+      vcode = ubik_Call_New(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid, 
+                       &m_unique, &m_nentries, &m_addrs);
+      if(vcode == VL_NOENT)
+         break;
+
+      if (vcode) {
+         fprintf(STDERR,"vos: could not list the server addresses\n");
+         PrintError("",vcode);
+         return( vcode );
+      }
+
+      print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
+      i++;
+
+      if ((as->parms[1].items)||(as->parms[0].items))
+         break;
   }
+    
   return 0;
 }
 
@@ -4179,6 +4259,10 @@ char **argv; {
     COMMONPARMS;
 
     ts = cmd_CreateSyntax("listaddrs", ListAddrs, 0, "list the IP address of all file servers registered in the VLDB");
+    cmd_AddParm(ts, "-uuid", CMD_SINGLE, CMD_OPTIONAL, "uuid of server");
+    cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_OPTIONAL, "address of host");
+    cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses");
+    cmd_AddParm(ts, "-printuuid", CMD_FLAG, CMD_OPTIONAL, "print uuid of hosts");
     COMMONPARMS;
 
     code = cmd_Dispatch(argc, argv);
index c483eee2f05cda1c2a7bc47bfa7c9da4a537d910..0756e03d5c5e9de842df58f5d4a1805d55fded91 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm_test.c,v 1.1.1.5 2001/09/11 14:36:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm_test.c,v 1.1.1.6 2002/08/02 04:37:58 hartmans Exp $");
 
 #include "xstat_cm.h"          /*Interface for xstat_cm module*/
 #include <cmd.h>               /*Command line interpreter*/
@@ -451,6 +451,7 @@ print_cmCallStats()
     printf("\t%10d afs_GetCell\n",         cmp->callInfo.C_afs_GetCell);
     printf("\t%10d afs_GetCellByIndex\n",         cmp->callInfo.C_afs_GetCellByIndex);
     printf("\t%10d afs_GetCellByName\n",         cmp->callInfo.C_afs_GetCellByName);
+    printf("\t%10d afs_GetRealCellByIndex\n",         cmp->callInfo.C_afs_GetRealCellByIndex);
     printf("\t%10d afs_NewCell\n",         cmp->callInfo.C_afs_NewCell);
     printf("\t%10d CheckVLDB\n",         cmp->callInfo.C_CheckVLDB);
     printf("\t%10d afs_GetVolume\n",         cmp->callInfo.C_afs_GetVolume);