From: Sam Hartman Date: Fri, 2 Aug 2002 04:37:58 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r500, X-Git-Tag: debian/1.2.6-1~13 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=54ec4e0a5eb8f51ca15471a206177b875fe32e8b;p=packages%2Fo%2Fopenafs.git This commit was generated by cvs2svn to compensate for changes in r500, which included commits to RCS files with non-trunk default branches. --- diff --git a/acconfig.h b/acconfig.h index f2d087917..5b182b46a 100644 --- a/acconfig.h +++ b/acconfig.h @@ -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 diff --git a/acinclude.m4 b/acinclude.m4 index 665688692..171bbd30c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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" ;; diff --git a/configure-libafs.in b/configure-libafs.in index f70787657..fe9f1102d 100644 --- a/configure-libafs.in +++ b/configure-libafs.in @@ -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) diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index e8d7665a1..c01099cc2 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -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; diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index e1c8c85d9..e32a57d47 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -9,6 +9,8 @@ //#define NOSERVICE 1 +#define NOMOREFILESFIX 1 + #include #include @@ -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; diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index fad864de7..ef4e7e2b8 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -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 diff --git a/src/afs/DARWIN/osi_vm.c b/src/afs/DARWIN/osi_vm.c index 915b775e7..7c133b81f 100644 --- a/src/afs/DARWIN/osi_vm.c +++ b/src/afs/DARWIN/osi_vm.c @@ -10,7 +10,7 @@ #include #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; diff --git a/src/afs/DUX/osi_vfsops.c b/src/afs/DUX/osi_vfsops.c index d076c2434..f66430cee 100644 --- a/src/afs/DUX/osi_vfsops.c +++ b/src/afs/DUX/osi_vfsops.c @@ -13,7 +13,7 @@ #include #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; diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index 7e79a07f5..c374a3575 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -14,7 +14,7 @@ #include #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); diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h index e2b30ee84..615fb453c 100644 --- a/src/afs/LINUX/osi_prototypes.h +++ b/src/afs/LINUX/osi_prototypes.h @@ -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 */ diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 57f84a704..edf1e6dfa 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -10,7 +10,7 @@ #include #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(¤t->sigmask_lock); @@ -233,7 +198,7 @@ void afs_osi_Sleep(char *event) recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - interruptible_sleep_on(&evp->cond); + schedule(); spin_lock_irq(¤t->sigmask_lock); current->blocked = saved_set; @@ -241,6 +206,9 @@ void afs_osi_Sleep(char *event) spin_unlock_irq(¤t->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; } diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c index f8c338346..eabc30915 100644 --- a/src/afs/LINUX/osi_sysctl.c +++ b/src/afs/LINUX/osi_sysctl.c @@ -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} }; diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 69dda6464..dbc5ce85c 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -15,7 +15,7 @@ #include #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); +} diff --git a/src/afs/SOLARIS/osi_machdep.h b/src/afs/SOLARIS/osi_machdep.h index ef27ae516..09403c6b8 100644 --- a/src/afs/SOLARIS/osi_machdep.h +++ b/src/afs/SOLARIS/osi_machdep.h @@ -39,7 +39,19 @@ * 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_ */ diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 0d07e4ea1..b38c01571 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -10,7 +10,7 @@ #include #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); diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index 75dcff943..5a19f3dcb 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -22,7 +22,7 @@ #include #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; } } diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index f19091435..3b2a3160a 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -21,7 +21,7 @@ #include #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; } diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index 54202d3c9..6622455c4 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -16,7 +16,7 @@ #include #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: diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index 334d450e1..cb473ff47 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -20,7 +20,7 @@ #include #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 diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index e3f40f04d..09e7f390b 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -15,7 +15,7 @@ #include #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 } diff --git a/src/afs/VNOPS/afs_vnop_link.c b/src/afs/VNOPS/afs_vnop_link.c index 1ba9f19b1..c6602dfbe 100644 --- a/src/afs/VNOPS/afs_vnop_link.c +++ b/src/afs/VNOPS/afs_vnop_link.c @@ -16,7 +16,7 @@ #include #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); diff --git a/src/afs/VNOPS/afs_vnop_open.c b/src/afs/VNOPS/afs_vnop_open.c index f34944372..30b0de0eb 100644 --- a/src/afs/VNOPS/afs_vnop_open.c +++ b/src/afs/VNOPS/afs_vnop_open.c @@ -17,7 +17,7 @@ #include #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, diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index 021f981e2..13b686c61 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -19,7 +19,7 @@ #include #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 */ diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index 467083c5d..39e680eb3 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -22,7 +22,7 @@ #include #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; } diff --git a/src/afs/VNOPS/afs_vnop_rename.c b/src/afs/VNOPS/afs_vnop_rename.c index 47a678f39..90b5fd14e 100644 --- a/src/afs/VNOPS/afs_vnop_rename.c +++ b/src/afs/VNOPS/afs_vnop_rename.c @@ -17,7 +17,7 @@ #include #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; } diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index 242aab9e6..1fd305117 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -21,7 +21,7 @@ #include #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; } diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 8ecb2cbdf..cdfbca726 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -20,7 +20,7 @@ #include #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; } diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 17e52be91..ec8bb1870 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -13,7 +13,7 @@ #include #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) { diff --git a/src/afs/afs_dynroot.c b/src/afs/afs_dynroot.c index 7ca29aa42..e42714b2c 100644 --- a/src/afs/afs_dynroot.c +++ b/src/afs/afs_dynroot.c @@ -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)); diff --git a/src/afs/afs_nfsdisp.c b/src/afs/afs_nfsdisp.c index d25d3538e..a9141f300 100644 --- a/src/afs/afs_nfsdisp.c +++ b/src/afs/afs_nfsdisp.c @@ -10,8 +10,10 @@ #include #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) diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 6377e582b..a7b1f7f28 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -10,7 +10,7 @@ #include #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) { diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index bd100abd8..8c7fb39c4 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -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, diff --git a/src/afs/afs_stats.h b/src/afs/afs_stats.h index a0919dc8b..d595c0c20 100644 --- a/src/afs/afs_stats.h +++ b/src/afs/afs_stats.h @@ -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*/ diff --git a/src/afs/afs_trace.et b/src/afs/afs_trace.et index 42dd71547..2b9658304 100644 --- a/src/afs/afs_trace.et +++ b/src/afs/afs_trace.et @@ -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 diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 850af1649..5e461cab4 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -38,7 +38,7 @@ #include #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 diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 247fe25c2..814bef826 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -55,7 +55,7 @@ #include #include -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)); } diff --git a/src/cf/linux-test2.m4 b/src/cf/linux-test2.m4 index 22047a5a7..17b34bf6b 100644 --- a/src/cf/linux-test2.m4 +++ b/src/cf/linux-test2.m4 @@ -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 ], +[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" diff --git a/src/config/afs_args.h b/src/config/afs_args.h index 14644a269..ab8d095ee 100644 --- a/src/config/afs_args.h +++ b/src/config/afs_args.h @@ -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 diff --git a/src/config/param.alpha_linux_22.h b/src/config/param.alpha_linux_22.h index 4f9ea914f..252d68fb9 100644 --- a/src/config/param.alpha_linux_22.h +++ b/src/config/param.alpha_linux_22.h @@ -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" diff --git a/src/config/param.alpha_linux_24.h b/src/config/param.alpha_linux_24.h index ebb4e2e9b..2bf32a9a1 100644 --- a/src/config/param.alpha_linux_24.h +++ b/src/config/param.alpha_linux_24.h @@ -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" diff --git a/src/config/param.ia64_linux24.h b/src/config/param.ia64_linux24.h index 7d9254c9b..63e5f45a8 100644 --- a/src/config/param.ia64_linux24.h +++ b/src/config/param.ia64_linux24.h @@ -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" diff --git a/src/config/param.parisc_linux24.h b/src/config/param.parisc_linux24.h index af619cc79..1c181bff6 100644 --- a/src/config/param.parisc_linux24.h +++ b/src/config/param.parisc_linux24.h @@ -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" diff --git a/src/config/param.s390_linux22.h b/src/config/param.s390_linux22.h index 9614398cf..1dcb8fed4 100644 --- a/src/config/param.s390_linux22.h +++ b/src/config/param.s390_linux22.h @@ -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" diff --git a/src/config/param.s390_linux24.h b/src/config/param.s390_linux24.h index 66c335eb0..c80aebb64 100644 --- a/src/config/param.s390_linux24.h +++ b/src/config/param.s390_linux24.h @@ -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" diff --git a/src/config/param.sparc64_linux24.h b/src/config/param.sparc64_linux24.h index e63497dce..140638526 100644 --- a/src/config/param.sparc64_linux24.h +++ b/src/config/param.sparc64_linux24.h @@ -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 diff --git a/src/config/param.sparc_linux24.h b/src/config/param.sparc_linux24.h index 2bff46edc..3dcdc5362 100644 --- a/src/config/param.sparc_linux24.h +++ b/src/config/param.sparc_linux24.h @@ -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" diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index 1c0881657..6fc3de348 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -15,12 +15,14 @@ #include #include -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 #include +#include #ifdef AFS_NT40_ENV #include +#include #define snprintf _snprintf #else #include @@ -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 diff --git a/src/libafsrpc/Makefile.in b/src/libafsrpc/Makefile.in index 006e666fa..c8eb620c2 100644 --- a/src/libafsrpc/Makefile.in +++ b/src/libafsrpc/Makefile.in @@ -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;; \ diff --git a/src/login/Makefile.in b/src/login/Makefile.in index be2903a9e..cfaa3dff3 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -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 diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in index f840d9d4d..521a8ca9f 100644 --- a/src/pam/Makefile.in +++ b/src/pam/Makefile.in @@ -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 diff --git a/src/rx/LINUX/rx_kmutex.h b/src/rx/LINUX/rx_kmutex.h index 8b492132f..783280f66 100644 --- a/src/rx/LINUX/rx_kmutex.h +++ b/src/rx/LINUX/rx_kmutex.h @@ -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(¤t->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(¤t->sigmask_lock); current->blocked = saved_set; recalc_sigpending(current); spin_unlock_irq(¤t->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(¤t->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(¤t->sigmask_lock); current->blocked = saved_set; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - MUTEX_ENTER(l); if (isAFSGlocked) AFS_GLOCK(); + MUTEX_ENTER(l); return 0; } diff --git a/src/rx/Makefile.in b/src/rx/Makefile.in index 9fd3e7214..bd2cac240 100644 --- a/src/rx/Makefile.in +++ b/src/rx/Makefile.in @@ -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 \ diff --git a/src/rx/rx_clock.c b/src/rx/rx_clock.c index e80079051..9bef2e902 100644 --- a/src/rx/rx_clock.c +++ b/src/rx/rx_clock.c @@ -17,7 +17,11 @@ #endif #include -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 +#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 diff --git a/src/rx/rx_event.c b/src/rx/rx_event.c index fe56489b8..394eb0258 100644 --- a/src/rx/rx_event.c +++ b/src/rx/rx_event.c @@ -14,7 +14,11 @@ #include #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 +#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 diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index f2043fc14..b9663636e 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -12,7 +12,7 @@ #include #include -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 /* fd_set on older platforms */ # include @@ -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 diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 7545c48b7..c2709d2e2 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -18,7 +18,7 @@ #include #include -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 #include @@ -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 diff --git a/src/rxkad/rxkad_common.c b/src/rxkad/rxkad_common.c index e5cb6884e..774608df0 100644 --- a/src/rxkad/rxkad_common.c +++ b/src/rxkad/rxkad_common.c @@ -16,7 +16,11 @@ #include #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 +#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 diff --git a/src/tbutc/Makefile.in b/src/tbutc/Makefile.in index 338ce9c90..5f155afc7 100644 --- a/src/tbutc/Makefile.in +++ b/src/tbutc/Makefile.in @@ -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 diff --git a/src/tools/install/RPM.README b/src/tools/install/RPM.README index 135e77a83..ce3b46790 100644 --- a/src/tools/install/RPM.README +++ b/src/tools/install/RPM.README @@ -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. diff --git a/src/tools/install/afs_uninstall b/src/tools/install/afs_uninstall index 79d629387..bc25cb70a 100644 --- a/src/tools/install/afs_uninstall +++ b/src/tools/install/afs_uninstall @@ -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 diff --git a/src/tools/install/install_afs b/src/tools/install/install_afs index a8bfa1404..26fc79b5f 100644 --- a/src/tools/install/install_afs +++ b/src/tools/install/install_afs @@ -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 # diff --git a/src/tools/install/make_rpm_source b/src/tools/install/make_rpm_source index c138e6f09..5b634ba99 100644 --- a/src/tools/install/make_rpm_source +++ b/src/tools/install/make_rpm_source @@ -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 . # diff --git a/src/tools/install/unpack_cmd b/src/tools/install/unpack_cmd index 6a11181db..66dd9f5fe 100644 --- a/src/tools/install/unpack_cmd +++ b/src/tools/install/unpack_cmd @@ -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/ diff --git a/src/tools/openafs-tools-cmd.README b/src/tools/openafs-tools-cmd.README index 8c87c6824..7abb71a82 100644 --- a/src/tools/openafs-tools-cmd.README +++ b/src/tools/openafs-tools-cmd.README @@ -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 diff --git a/src/util/dirpath_nt.h b/src/util/dirpath_nt.h index 76249bd97..c020d061c 100644 --- a/src/util/dirpath_nt.h +++ b/src/util/dirpath_nt.h @@ -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 diff --git a/src/util/uuid.c b/src/util/uuid.c index 460e8299f..fcb13e4d2 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -14,7 +14,7 @@ #include #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; diff --git a/src/venus/Makefile.in b/src/venus/Makefile.in index cdf33b568..599d35715 100644 --- a/src/venus/Makefile.in +++ b/src/venus/Makefile.in @@ -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* ) \ diff --git a/src/vol/fssync.c b/src/vol/fssync.c index 9a79dbb4a..4dae14c77 100644 --- a/src/vol/fssync.c +++ b/src/vol/fssync.c @@ -38,7 +38,7 @@ static int newVLDB = 1; #include #include -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 #include @@ -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) diff --git a/src/vol/partition.h b/src/vol/partition.h index c583bd0af..e471dea54 100644 --- a/src/vol/partition.h +++ b/src/vol/partition.h @@ -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 */ diff --git a/src/volser/vos.c b/src/volser/vos.c index e290ea183..7be40ed73 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -10,7 +10,7 @@ #include #include -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 #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\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); diff --git a/src/xstat/xstat_cm_test.c b/src/xstat/xstat_cm_test.c index c483eee2f..0756e03d5 100644 --- a/src/xstat/xstat_cm_test.c +++ b/src/xstat/xstat_cm_test.c @@ -16,7 +16,7 @@ #include #include -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 /*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);