gtx: project null auth # kauth rxkad ?
case ${SYS_NAME} in \
- rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \
+ rs_aix* | sun*_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \
$(RM) -f ${TOP_LIBDIR}/libtermlib.a; \
ln -s libnull.a ${TOP_LIBDIR}/libtermlib.a; \
${COMPILE_PART1} gtx ${COMPILE_PART2};; \
${COMPILE_PART1} login ${COMPILE_PART2} ;; \
parisc_linux24) \
echo Skipping pam/login for parisc_linux24 ;; \
- sun4x_* | hp_ux11* | *linux* | *fbsd* ) \
+ sun*_* | hp_ux11* | *linux* | *fbsd* ) \
${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
ppc_darwin* | *_obsd* ) \
echo Skipping login for ${SYS_NAME} ;; \
tbutc: project bubasics butm budb bucoord cmd butc
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux110) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix4*|*linux*|hp_ux110) \
${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \
*) \
echo Not building MT butc for ${SYS_NAME} ;; \
# pthread based user space RX library
libafsrpc: rx rxkad des
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \
${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
*) \
echo Not building MT libafsrpc for ${SYS_NAME} ;; \
libafsauthent: ubik auth kauth libafsrpc
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \
${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
*) \
echo Not building MT libafsrpc for ${SYS_NAME} ;; \
shlibafsrpc: rx rxkad des
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux110) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \
${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \
*) \
echo Not building shared libafsrpc for ${SYS_NAME} ;; \
shlibafsauthent: ubik auth kauth shlibafsrpc
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux110) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \
${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \
*) \
echo Not building shared libafsrpc for ${SYS_NAME} ;; \
libadmin: libafsauthent bozo
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \
$(MAKE) libadmin_real ;; \
*) \
echo Not building MT libadmin for ${SYS_NAME} ;; \
ntp: project volser
@case ${WITH_OBSOLETE} in \
YES) case ${SYS_NAME} in \
- sun4x_58 | sunx86_* | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
+ sun*_5[89] | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
* ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
esac ;; \
*) echo skipping deprecated target: ntp ;; \
-OpenAFS News -- history of user-visible changes. December 9, 2002.
+OpenAFS News -- history of user-visible changes. April 10, 2003.
+
+* Changes incorporated in OpenAFS 1.2.9
+
+** The kaserver now defaults to not allowing interrealm authentication,
+ due to security vulnerabilities in the krb4 protocol. The new
+ "-crossrealm" flag to the kaserver is provided to reenable interrealm
+ authentication if desired.
+
+** RedHat Linux 9.0 is now supported.
+
+** Solaris 9 12/02 is now supported. Solaris 7 and 8 x86 should now
+ work again.
* Changes incorporated in OpenAFS 1.2.8
#undef getuerror
#define getpid() current->pid
+#ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+#define getppid() current->real_parent->pid
+#else
#define getppid() current->p_opptr->pid
+#endif
+#ifdef RECALC_SIGPENDING_TAKES_VOID
+#define RECALC_SIGPENDING(X) recalc_sigpending()
+#else
+#define RECALC_SIGPENDING(X) recalc_sigpending(X)
+#endif
+
+#if defined (STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK)
+#define SIG_LOCK(X) spin_lock_irq(&X->sigmask_lock)
+#define SIG_UNLOCK(X) spin_unlock_irq(&X->sigmask_lock)
+#elif defined (STRUCT_TASK_STRUCT_HAS_SIGHAND)
+#define SIG_LOCK(X) spin_lock_irq(&X->sighand->siglock)
+#define SIG_UNLOCK(X) spin_unlock_irq(&X->sighand->siglock)
+#else
+#define SIG_LOCK(X) spin_lock_irq(&X->sig->siglock)
+#define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock)
+#endif
#define afs_hz HZ
-#include "../h/sched.h"
#define osi_Time() (xtime.tv_sec)
#if (CPU == sparc64)
#define osi_GetTime(V) do { (*(V)).tv_sec = xtime.tv_sec; (*(V)).tv_usec = xtime.tv_usec; } while (0)
#define afs_linux_page_address(page) (afs_linux_page_offset + PAGE_SIZE * (page - mem_map))
#if defined(__KERNEL__) && defined(CONFIG_SMP)
+#include "../h/sched.h"
#include "linux/wait.h"
extern struct semaphore afs_global_lock;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.12 2002/09/26 19:18:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.13 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
struct task_struct *rxk_ListenerTask;
void osi_linux_mask() {
- spin_lock_irq(¤t->sigmask_lock);
+ SIG_LOCK(current);
sigfillset(¤t->blocked);
- recalc_sigpending(current);
- spin_unlock_irq(¤t->sigmask_lock);
-}
-
-void osi_linux_unmask() {
- spin_lock_irq(&rxk_ListenerTask->sigmask_lock);
- sigemptyset(&rxk_ListenerTask->blocked);
- flush_signals(rxk_ListenerTask);
- recalc_sigpending(rxk_ListenerTask);
- spin_unlock_irq(&rxk_ListenerTask->sigmask_lock);
+ RECALC_SIGPENDING(current);
+ SIG_UNLOCK(current);
}
void osi_linux_rxkreg() {
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.10 2002/12/11 03:00:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.11 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include <linux/slab.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
#include <linux/init.h>
+#include <linux/sched.h>
#endif
#ifndef EXPORTED_SYS_CALL_TABLE
-#include <linux/sched.h>
#include <linux/syscall.h>
#endif
#if !defined(AFS_ALPHA_LINUX20_ENV)
asmlinkage int (*sys_socketcallp)(int call, long *args);
#endif /* no socketcall on alpha */
-asmlinkage int (*sys_killp)(int pid, int signal);
asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
#ifdef EXPORTED_SYS_CALL_TABLE
asmlinkage int afs_syscall32(long syscall, long parm1, long parm2, long parm3,
long parm4, long parm5)
{
-__asm__ __volatile__ ("
- srl %o4, 0, %o4
- mov %o7, %i7
- call afs_syscall
- srl %o5, 0, %o5
- ret
- nop
-");
+__asm__ __volatile__ ("srl %o4, 0, %o4\n\t"
+ "mov %o7, %i7\n\t"
+ "call afs_syscall\n\t"
+ "srl %o5, 0, %o5\n\t"
+ "ret\n\t"
+ "nop");
}
#endif
asmlinkage long
afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp)
{
-__asm__ __volatile__ ("
- alloc r42 = ar.pfs, 8, 3, 6, 0
- mov r41 = b0 /* save rp */
- mov out0 = in0
- mov out1 = in1
- mov out2 = in2
- mov out3 = in3
- mov out4 = in4
- mov out5 = gp /* save gp */
- ;;
-.L1: mov r3 = ip
- ;;
- addl r15=.fptr_afs_syscall-.L1,r3
- ;;
- ld8 r15=[r15]
- ;;
- ld8 r16=[r15],8
- ;;
- ld8 gp=[r15]
- mov b6=r16
- br.call.sptk.many b0 = b6
- ;;
- mov ar.pfs = r42
- mov b0 = r41
- mov gp = r48 /* restore gp */
- br.ret.sptk.many b0
-.fptr_afs_syscall:
- data8 @fptr(afs_syscall)
-");
+__asm__ __volatile__ ("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t"
+ "mov r41 = b0\n\t" /* save rp */
+ "mov out0 = in0\n\t"
+ "mov out1 = in1\n\t"
+ "mov out2 = in2\n\t"
+ "mov out3 = in3\n\t"
+ "mov out4 = in4\n\t"
+ "mov out5 = gp\n\t" /* save gp */
+ ";;\n"
+ ".L1: mov r3 = ip\n\t"
+ ";;\n\t"
+ "addl r15=.fptr_afs_syscall-.L1,r3\n\t"
+ ";;\n\t"
+ "ld8 r15=[r15]\n\t"
+ ";;\n\t"
+ "ld8 r16=[r15],8\n\t"
+ ";;\n\t"
+ "ld8 gp=[r15]\n\t"
+ "mov b6=r16\n\t"
+ "br.call.sptk.many b0 = b6\n\t"
+ ";;\n\t"
+ "mov ar.pfs = r42\n\t"
+ "mov b0 = r41\n\t"
+ "mov gp = r48\n\t" /* restore gp */
+ "br.ret.sptk.many b0\n"
+ ".fptr_afs_syscall:\n\t"
+ "data8 @fptr(afs_syscall)");
}
asmlinkage long
afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp)
{
-__asm__ __volatile__ ("
- alloc r42 = ar.pfs, 8, 3, 6, 0
- mov r41 = b0 /* save rp */
- mov out0 = in0
- mov out1 = in1
- mov out2 = in2
- mov out3 = in3
- mov out4 = in4
- mov out5 = gp /* save gp */
- ;;
-.L2: mov r3 = ip
- ;;
- addl r15=.fptr_afs_xsetgroups - .L2,r3
- ;;
- ld8 r15=[r15]
- ;;
- ld8 r16=[r15],8
- ;;
- ld8 gp=[r15]
- mov b6=r16
- br.call.sptk.many b0 = b6
- ;;
- mov ar.pfs = r42
- mov b0 = r41
- mov gp = r48 /* restore gp */
- br.ret.sptk.many b0
-.fptr_afs_xsetgroups:
- data8 @fptr(afs_xsetgroups)
-");
+__asm__ __volatile__ ("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t"
+ "mov r41 = b0\n\t" /* save rp */
+ "mov out0 = in0\n\t"
+ "mov out1 = in1\n\t"
+ "mov out2 = in2\n\t"
+ "mov out3 = in3\n\t"
+ "mov out4 = in4\n\t"
+ "mov out5 = gp\n\t" /* save gp */
+ ";;\n"
+ ".L2: mov r3 = ip\n\t"
+ ";;\n\t"
+ "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t"
+ ";;\n\t"
+ "ld8 r15=[r15]\n\t"
+ ";;\n\t"
+ "ld8 r16=[r15],8\n\t"
+ ";;\n\t"
+ "ld8 gp=[r15]\n\t"
+ "mov b6=r16\n\t"
+ "br.call.sptk.many b0 = b6\n\t"
+ ";;\n\t"
+ "mov ar.pfs = r42\n\t"
+ "mov b0 = r41\n\t"
+ "mov gp = r48\n\t" /* restore gp */
+ "br.ret.sptk.many b0\n"
+ ".fptr_afs_xsetgroups:\n\t"
+ "data8 @fptr(afs_xsetgroups)");
}
struct fptr
{
#if defined(AFS_IA64_LINUX20_ENV)
unsigned long kernel_gp;
- static struct fptr sys_kill, sys_settimeofday, sys_setgroups;
+ static struct fptr sys_settimeofday, sys_setgroups;
#endif
extern int afs_syscall();
extern long afs_xsetgroups();
sys_call_table=(void *) &(ptr[ -1 * (__NR_close-1024)]);
break;
}
+#else
+#if defined(EXPORTED_SYS_CHDIR) && defined(EXPORTED_SYS_CLOSE)
+ if (ptr[0] == (unsigned long)&sys_close &&
+ ptr[__NR_chdir - __NR_close] == (unsigned long)&sys_chdir) {
+ sys_call_table=ptr - __NR_close;
+ break;
+ }
#else
if (ptr[0] == (unsigned long)&sys_exit &&
ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) {
sys_call_table=ptr - __NR_exit;
break;
}
+#endif
#endif
}
#ifdef EXPORTED_KALLSYMS_ADDRESS
printf("Failed to find address of sys_call_table\n");
return -EIO;
}
+ printf("Found sys_call_table at %x\n", sys_call_table);
# ifdef AFS_SPARC64_LINUX20_ENV
error cant support this yet.
#endif
kernel_gp = ((struct fptr *)printk)->gp;
sys_settimeofdayp = (void *) &sys_settimeofday;
- sys_killp = (void *) &sys_kill;
((struct fptr *)sys_settimeofdayp)->ip =
SYSCALL2POINTER sys_call_table[__NR_settimeofday - 1024];
((struct fptr *)sys_settimeofdayp)->gp = kernel_gp;
- ((struct fptr *)sys_killp)->ip =
- SYSCALL2POINTER sys_call_table[__NR_kill - 1024];
- ((struct fptr *)sys_killp)->gp = kernel_gp;
#else /* !AFS_IA64_LINUX20_ENV */
sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
#ifdef __NR_socketcall
sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall];
#endif /* no socketcall on alpha */
- sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill];
#endif /* AFS_IA64_LINUX20_ENV */
/* setup AFS entry point. */
#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV)
return PAGE_OFFSET;
#else
- struct task_struct *p;
+ struct task_struct *p, *q;
/* search backward thru the circular list */
- for(p = current; p; p = p->prev_task)
- if (p->pid == 1)
- return p->addr_limit.seg;
-
- return 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ read_lock(&tasklist_lock);
+#endif
+ /* search backward thru the circular list */
+#ifdef DEFINED_PREV_TASK
+ for(q = current; p = q; q = prev_task(p)) {
+#else
+ for(p = current; p; p = p->prev_task) {
+#endif
+ if (p->pid == 1) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ read_unlock(&tasklist_lock);
+#endif
+ return p->addr_limit.seg;
+ }
+ }
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ read_unlock(&tasklist_lock);
+#endif
+ return 0;
#endif
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.14 2002/12/11 03:00:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.15 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
/* Safe because there are no large files, yet */
#if defined(F_GETLK64) && (F_GETLK != F_GETLK64)
- if (cmd = F_GETLK64)
+ if (cmd == F_GETLK64)
cmd = F_GETLK;
- else if (cmd = F_SETLK64)
+ else if (cmd == F_SETLK64)
cmd = F_SETLK;
- else if (cmd = F_SETLKW64)
+ else if (cmd == F_SETLKW64)
cmd = F_SETLKW;
#endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.13 2002/12/11 03:00:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.14 2003/04/13 19:32:23 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!tcell) return ENODEV;
- mtptCell = tcell->cell; /* The cell for the mountpoint */
+ mtptCell = tcell->cellNum; /* The cell for the mountpoint */
if (tcell->lcellp) {
- hac = 1; /* has associated cell */
- assocCell = tcell->lcellp->cell; /* The associated cell */
+ hac = 1; /* has associated cell */
+ assocCell = tcell->lcellp->cellNum; /* The associated cell */
}
afs_PutCell(tcell, READ_LOCK);
afs_InitFakeStat(state)
struct afs_fakestat_state *state;
{
+ if (!afs_fakestat_enable)
+ return;
+
state->valid = 1;
state->did_eval = 0;
state->need_release = 0;
struct volume *tvolp = NULL;
int code = 0;
+ if (!afs_fakestat_enable)
+ return 0;
+
osi_Assert(state->valid == 1);
osi_Assert(state->did_eval == 0);
state->did_eval = 1;
- if (!afs_fakestat_enable)
- return 0;
+
tvc = *avcp;
if (tvc->mvstat != 1)
return 0;
afs_PutFakeStat(state)
struct afs_fakestat_state *state;
{
+ if (!afs_fakestat_enable)
+ return;
+
osi_Assert(state->valid == 1);
if (state->need_release)
afs_PutVCache(state->root_vp, 0);
afs_PutDCache(tdc);
if (code == ENOENT && afs_IsDynroot(adp) && dynrootRetry) {
- struct cell *tcell;
-
ReleaseReadLock(&adp->lock);
dynrootRetry = 0;
- if (*tname == '.')
- tcell = afs_GetCellByName(tname + 1, READ_LOCK);
+ if (tname[0] == '.')
+ afs_LookupAFSDB(tname + 1);
else
- tcell = afs_GetCellByName(tname, READ_LOCK);
- if (tcell) {
- afs_PutCell(tcell, READ_LOCK);
- afs_RefreshDynroot();
- if (tname != aname && tname) osi_FreeLargeSpace(tname);
- goto redo;
- }
+ afs_LookupAFSDB(tname);
+ if (tname && tname != aname) osi_FreeLargeSpace(tname);
+ goto redo;
} else {
ReleaseReadLock(&adp->lock);
}
struct AFSFid fid;
};
-
-#define LOCALCELL 1 /* local cell's number is always 1 */
+/* cellinfo file magic number */
+#define AFS_CELLINFO_MAGIC 0xf32817cd
/* cell flags */
-#define CPrimary 1 /* on if this is the primary cell */
-#define CNoSUID 2 /* 1 if no suid progs can run from this cell */
-#define CHasVolRef 16 /* Volumes were referenced in this cell*/
-#define CLinkedCell 32
-#define CAlias 64 /* This cell entry is an alias */
+#define CNoSUID 0x02 /* disable suid bit for this cell */
+#define CLinkedCell4 0x04 /* reserved for ADDCELL2 pioctl */
+#define CNoAFSDB 0x08 /* never bother trying AFSDB */
+#define CHasVolRef 0x10 /* volumes were referenced */
+#define CLinkedCell 0x20 /* has a linked cell in lcellp */
struct cell {
- struct afs_q lruq; /* lru q next and prev */
- afs_int32 cell; /* unique id assigned by venus */
+ struct afs_q lruq; /* lru q next and prev */
char *cellName; /* char string name of cell */
- struct server *cellHosts[MAXCELLHOSTS]; /* volume *location* hosts for this cell */
+ afs_int32 cellIndex; /* sequence number */
+ afs_int32 cellNum; /* semi-permanent cell number */
+ struct server *cellHosts[MAXCELLHOSTS]; /* volume *location* hosts */
struct cell *lcellp; /* Associated linked cell */
u_short fsport; /* file server port */
u_short vlport; /* volume server port */
short states; /* state flags */
- short cellIndex; /* relative index number per cell */
- short realcellIndex; /* as above but ignoring aliases */
time_t timeout; /* data expire time, if non-zero */
- char *realName; /* who this cell is an alias for */
+ struct cell_name *cnamep; /* pointer to our cell_name */
+ afs_rwlock_t lock; /* protects cell data */
+};
+
+struct cell_name {
+ struct cell_name *next;
+ afs_int32 cellnum;
+ char *cellname;
+ char used;
+};
+
+struct cell_alias {
+ struct cell_alias *next;
+ afs_int32 index;
+ char *alias;
+ char *cell;
};
#define afs_PutCell(cellp, locktype)
extern struct conn *afs_Conn();
extern struct conn *afs_ConnByHost();
extern struct conn *afs_ConnByMHosts();
-extern afs_int32 afs_NewCell();
extern struct dcache *afs_GetDCache();
extern struct dcache *afs_FindDCache();
extern struct dcache *afs_NewDCache();
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.14 2002/09/26 19:18:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.15 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
static int afs_Go_Done = 0;
extern struct interfaceAddr afs_cb_interface;
static int afs_RX_Running = 0;
+static int afs_InitSetup_done = 0;
static int
Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval);
extern void afs_InitStats();
int code;
+ if (afs_InitSetup_done)
+ return;
+
#ifndef AFS_NOSTATS
/*
* Set up all the AFS statistics variables. This should be done
/* resource init creates the services */
afs_ResourceInit(preallocs);
+ afs_InitSetup_done = 1;
+ afs_osi_Wakeup(&afs_InitSetup_done);
+
return code;
}
#if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)
daemonize(); /* doesn't do much, since we were forked from keventd, but
does call mm_release, which wakes up our parent (since it
used CLONE_VFORK) */
+ reparent_to_init();
afs_osi_MaskSignals();
switch (parm) {
case AFSOP_START_RXCALLBACK:
long parm, parm2, parm3, parm4, parm5, parm6;
{
afs_int32 code = 0;
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ size_t bufferSize;
+#else /* AFS_SGI61_ENV */
+ u_int bufferSize;
+#endif /* AFS_SGI61_ENV */
AFS_STATCNT(afs_syscall_call);
#ifdef AFS_SUN5_ENV
#endif
else if (parm == AFSOP_START_AFS) {
/* afs daemon */
- afs_int32 temp;
-
if (AFS_Running) goto out;
AFS_Running = 1;
while (afs_initState < AFSOP_START_AFS)
afs_osi_Sleep(&afs_initState);
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- temp = AFS_MINBUFFERS; /* Should fix this soon */
-#else
- temp = ((afs_bufferpages * NBPG)>>11); /* number of 2k buffers we could get from all of the buffer space */
- temp = temp>>2; /* don't take more than 25% (our magic parameter) */
- if (temp < AFS_MINBUFFERS) temp = AFS_MINBUFFERS; /* although we really should have this many */
-#endif
- DInit(temp);
afs_initState = AFSOP_START_BKG;
afs_osi_Wakeup(&afs_initState);
afs_osi_Invisible();
}
#endif
#endif
+ else if (parm == AFSOP_BASIC_INIT) {
+ afs_int32 temp;
+
+ while (!afs_InitSetup_done)
+ afs_osi_Sleep(&afs_InitSetup_done);
+
+#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ temp = AFS_MINBUFFERS; /* Should fix this soon */
+#else
+ /* number of 2k buffers we could get from all of the buffer space */
+ temp = ((afs_bufferpages * NBPG)>>11);
+ temp = temp>>2; /* don't take more than 25% (our magic parameter) */
+ if (temp < AFS_MINBUFFERS)
+ temp = AFS_MINBUFFERS; /* though we really should have this many */
+#endif
+ DInit(temp);
+ afs_rootFid.Fid.Volume = 0;
+ code = 0;
+ }
else if (parm == AFSOP_ADDCELL) {
/* add a cell. Parameter 2 is 8 hosts (in net order), parm 3 is the null-terminated
name. Parameter 4 is the length of the name, including the null. Parm 5 is the
home cell flag (0x1 bit) and the nosuid flag (0x2 bit) */
struct afsop_cell tcell;
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code);
if (!code) {
if (parm4 > sizeof(tcell.cellName))
AFS_COPYIN((char *)parm3, tcell.cellName, parm4, code);
if (!code)
afs_NewCell(tcell.cellName, tcell.hosts, parm5,
- (char *)0, (u_short)0, (u_short)0, (int)0);
+ NULL, 0, 0, 0);
}
}
} else if (parm == AFSOP_ADDCELL2) {
struct afsop_cell tcell;
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0;
char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
int cflags = parm4;
- /* wait for basic init */
+#if 0
+ /* wait for basic init - XXX can't find any reason we need this? */
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
+#endif
AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code);
if (!code) {
}
if (!code)
afs_NewCell(tbuffer1, tcell.hosts, cflags,
- lcnamep, (u_short)0, (u_short)0, (int)0);
+ lcnamep, 0, 0, 0);
}
}
osi_FreeSmallSpace(tbuffer);
* parm2 is the alias name
* parm3 is the real cell name
*/
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
char *aliasName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
char *cellName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
AFS_COPYINSTR((char *)parm2, aliasName, AFS_SMALLOCSIZ, &bufferSize, code);
if (!code) AFS_COPYINSTR((char *)parm3, cellName, AFS_SMALLOCSIZ, &bufferSize, code);
- if (!code) afs_NewCell(aliasName, /* new entry name */
- 0, /* host list */
- CAlias, /* flags */
- (char *) 0, /* linked cell */
- 0, 0, /* fs & vl ports */
- 0, /* timeout */
- cellName); /* real cell name */
+ if (!code) afs_NewCellAlias(aliasName, cellName);
osi_FreeSmallSpace(aliasName);
osi_FreeSmallSpace(cellName);
}
+ else if (parm == AFSOP_SET_THISCELL) {
+ /*
+ * Call arguments:
+ * parm2 is the primary cell name
+ */
+ char *cell = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+
+ AFS_COPYINSTR((char *) parm2, cell, AFS_SMALLOCSIZ, &bufferSize, code);
+ if (!code)
+ afs_SetPrimaryCell(cell);
+ osi_FreeSmallSpace(cell);
+ }
else if (parm == AFSOP_CACHEINIT) {
struct afs_cacheParams cparms;
if (afs_CacheInit_Done) goto out;
- /* wait for basic init */
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code);
if (code) {
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
code = afs_InitCacheFile((char *) 0, ainode);
}
else if (parm == AFSOP_ROOTVOLUME) {
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
-
/* wait for basic init */
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
}
else code = 0;
}
- else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO ||
- parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG) {
+ else if (parm == AFSOP_CACHEFILE ||
+ parm == AFSOP_CACHEINFO ||
+ parm == AFSOP_VOLUMEINFO ||
+ parm == AFSOP_AFSLOG ||
+ parm == AFSOP_CELLINFO) {
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
- /* wait for basic init */
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
code = 0;
- AFS_COPYINSTR((char *)parm2, tbuffer, AFS_SMALLOCSIZ, &bufferSize, code);
+ AFS_COPYINSTR((char *) parm2, tbuffer, AFS_SMALLOCSIZ,
+ &bufferSize, code);
if (code) {
osi_FreeSmallSpace(tbuffer);
goto out;
}
if (!code) {
- tbuffer[AFS_SMALLOCSIZ-1] = 0; /* null-terminate the name */
- /* we now have the cache dir copied in. Call the cache init routines */
- if (parm == AFSOP_CACHEFILE) code = afs_InitCacheFile(tbuffer, 0);
- else if (parm == AFSOP_CACHEINFO) code = afs_InitCacheInfo(tbuffer);
- else if (parm == AFSOP_VOLUMEINFO) code = afs_InitVolumeInfo(tbuffer);
+ tbuffer[AFS_SMALLOCSIZ-1] = '\0'; /* null-terminate the name */
+ /* We have the cache dir copied in. Call the cache init routine */
+ if (parm == AFSOP_CACHEFILE)
+ code = afs_InitCacheFile(tbuffer, 0);
+ else if (parm == AFSOP_CACHEINFO)
+ code = afs_InitCacheInfo(tbuffer);
+ else if (parm == AFSOP_VOLUMEINFO)
+ code = afs_InitVolumeInfo(tbuffer);
+ else if (parm == AFSOP_CELLINFO)
+ code = afs_InitCellInfo(tbuffer);
}
osi_FreeSmallSpace(tbuffer);
}
AFS_COPYIN((afs_int32 *)parm2, cellname, cellLen, code);
AFS_COPYIN((afs_int32 *)parm3, kmsg, kmsgLen, code);
if (!code) {
- code = afs_AfsdbHandler(cellname, cellLen, kmsg);
+ code = afs_AFSDBHandler(cellname, cellLen, kmsg);
if (*cellname == 1) *cellname = 0;
if (code == -2) { /* Shutting down? */
*cellname = 1;
}
#ifdef AFS_AFSDB_ENV
afs_warn("AFSDB... ");
- afs_StopAfsdb();
+ afs_StopAFSDB();
while (afs_termState == AFSOP_STOP_AFSDB)
afs_osi_Sleep(&afs_termState);
#endif
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_daemons.c,v 1.7 2002/05/12 05:50:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_daemons.c,v 1.8 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
}
-afs_CheckRootVolume () {
+int afs_CheckRootVolume (void) {
char rootVolName[32];
- register struct volume *tvp;
+ struct volume *tvp;
int usingDynroot = afs_GetDynrootEnable();
+ int localcell;
AFS_STATCNT(afs_CheckRootVolume);
if (*afs_rootVolumeName == 0) {
strcpy(rootVolName, "root.afs");
- }
- else {
+ } else {
strcpy(rootVolName, afs_rootVolumeName);
}
+
+ if (!usingDynroot) {
+ struct cell *lc = afs_GetPrimaryCell(READ_LOCK);
+
+ if (!lc)
+ return ENOENT;
+ localcell = lc->cellNum;
+ afs_PutCell(lc, READ_LOCK);
+ }
+
if (usingDynroot) {
- afs_GetDynrootFid(&afs_rootFid);
- tvp = afs_GetVolume(&afs_rootFid, (struct vrequest *) 0, READ_LOCK);
+ afs_GetDynrootFid(&afs_rootFid);
+ tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
} else {
- tvp = afs_GetVolumeByName(rootVolName, LOCALCELL, 1, (struct vrequest *) 0, READ_LOCK);
+ tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK);
}
- if (!tvp) {
- char buf[128];
- int len = strlen(rootVolName);
-
- if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
- strcpy(buf, rootVolName);
- afs_strcat(buf, ".readonly");
- tvp = afs_GetVolumeByName(buf, LOCALCELL, 1, (struct vrequest *) 0, READ_LOCK);
- }
+ if (!tvp && !usingDynroot) {
+ char buf[128];
+ int len = strlen(rootVolName);
+
+ if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
+ strcpy(buf, rootVolName);
+ afs_strcat(buf, ".readonly");
+ tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+ }
}
if (tvp) {
- if (!usingDynroot) {
- int volid = (tvp->roVol? tvp->roVol : tvp->volume);
- afs_rootFid.Cell = LOCALCELL;
- if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid
- && afs_globalVp) {
- /* If we had a root fid before and it changed location we reset
- * the afs_globalVp so that it will be reevaluated.
- * Just decrement the reference count. This only occurs during
- * initial cell setup and can panic the machine if we set the
- * count to zero and fs checkv is executed when the current
- * directory is /afs.
- */
- AFS_FAST_RELE(afs_globalVp);
- afs_globalVp = 0;
- }
- afs_rootFid.Fid.Volume = volid;
- afs_rootFid.Fid.Vnode = 1;
- afs_rootFid.Fid.Unique = 1;
- }
- afs_initState = 300; /* won */
- afs_osi_Wakeup(&afs_initState);
- afs_PutVolume(tvp, READ_LOCK);
+ if (!usingDynroot) {
+ int volid = (tvp->roVol? tvp->roVol : tvp->volume);
+ afs_rootFid.Cell = localcell;
+ if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid
+ && afs_globalVp) {
+ /* If we had a root fid before and it changed location we reset
+ * the afs_globalVp so that it will be reevaluated.
+ * Just decrement the reference count. This only occurs during
+ * initial cell setup and can panic the machine if we set the
+ * count to zero and fs checkv is executed when the current
+ * directory is /afs.
+ */
+ AFS_FAST_RELE(afs_globalVp);
+ afs_globalVp = 0;
+ }
+ afs_rootFid.Fid.Volume = volid;
+ afs_rootFid.Fid.Vnode = 1;
+ afs_rootFid.Fid.Unique = 1;
+ }
+ afs_initState = 300; /* won */
+ afs_osi_Wakeup(&afs_initState);
+ afs_PutVolume(tvp, READ_LOCK);
}
#ifdef AFS_DEC_ENV
/* This is to make sure that we update the root gnode */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.15 2002/09/26 19:18:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.16 2003/04/13 19:32:22 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
return 0;
}
- static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize)
- struct vcache *avc;
- int afun;
- struct vrequest *areq;
- register char *ain;
- char *aout;
- afs_int32 ainSize;
- afs_int32 *aoutSize; /* set this */ {
- register struct cell *tcell=0, *cellOne=0;
- register struct afs_q *cq, *tq;
+static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize)
+ struct vcache *avc;
+ int afun;
+ struct vrequest *areq;
+ register char *ain;
+ char *aout;
+ afs_int32 ainSize;
+ afs_int32 *aoutSize; /* set this */
+{
+ struct cell *tcell = NULL;
AFS_STATCNT(PGetWSCell);
if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
return EIO; /* Inappropriate ioctl for device */
- ObtainReadLock(&afs_xcell);
- cellOne = (struct cell *) 0;
-
- for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
- tcell = QTOC(cq); tq = QNext(cq);
- if (tcell->states & CPrimary) break;
- if (tcell->cell == 1) cellOne = tcell;
- tcell = 0;
- }
- ReleaseReadLock(&afs_xcell);
- if (!tcell) { /* no primary cell, use cell #1 */
- if (!cellOne) return ESRCH;
- tcell = cellOne;
- }
+ tcell = afs_GetPrimaryCell(READ_LOCK);
+ if (!tcell) /* no primary cell? */
+ return ESRCH;
strcpy(aout, tcell->cellName);
*aoutSize = strlen(aout) + 1;
+ afs_PutCell(tcell, READ_LOCK);
return 0;
- }
+}
static PGetUserCell(avc, afun, areq, ain, aout, ainSize, aoutSize)
struct vcache *avc;
set_parent_pag = 1;
}
tcell = afs_GetCellByName(ain, READ_LOCK);
- if (tcell) {
- i = tcell->cell;
- }
- else {
- goto nocell;
- }
+ if (!tcell) goto nocell;
}
else {
- /* default to cell 1, primary id */
+ /* default to primary cell, primary id */
flag = 1; /* primary id */
- i = 1; /* cell number */
- tcell = afs_GetCell(1, READ_LOCK);
+ tcell = afs_GetPrimaryCell(READ_LOCK);
if (!tcell) goto nocell;
}
+ i = tcell->cellNum;
afs_PutCell(tcell, READ_LOCK);
if (set_parent_pag) {
int pag;
}
}
else {
- if (tu->uid == areq->uid && tu->cell == 1) break;
+ if (tu->uid == areq->uid && afs_IsPrimaryCellNum(tu->cell)) break;
}
}
if (tu) {
else cellp = (struct cell *) 0;
if (!cellp && (temp & 2)) {
/* use local cell */
- cellp = afs_GetCell(1, READ_LOCK);
+ cellp = afs_GetPrimaryCell(READ_LOCK);
}
if (!(temp & 1)) { /* if not fast, call server checker routine */
afs_CheckServers(1, cellp); /* check down servers */
}
linkedstate |= CNoSUID; /* setuid is disabled by default for fs newcell */
- code = afs_NewCell(newcell, cellHosts, linkedstate, linkedcell, fsport, vlport, (int)0, (char *) 0);
+ code = afs_NewCell(newcell, cellHosts, linkedstate, linkedcell, fsport, vlport, (int)0);
return code;
}
afs_int32 *aoutSize; /* set this */
{
/* create a new cell alias */
- register struct cell *tcell;
char *tp = ain;
register afs_int32 code;
char *realName, *aliasName;
- register struct afs_q *cq, *tq;
if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
return EIO; /* Inappropriate ioctl for device */
tp += strlen(aliasName) + 1;
realName = tp;
- /*
- * Prevent user from shooting themselves in the foot -- don't allow
- * creation of aliases when a real cell already exists with that name.
- */
- ObtainReadLock(&afs_xcell);
- for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
- tcell = QTOC(cq); tq = QNext(cq);
- if ((afs_strcasecmp(tcell->cellName, aliasName) == 0) &&
- !(tcell->states & CAlias)) {
- ReleaseReadLock(&afs_xcell);
- return EEXIST;
- }
- }
- ReleaseReadLock(&afs_xcell);
-
- code = afs_NewCell(aliasName, 0, CAlias, 0, 0, 0, 0, realName);
+ code = afs_NewCellAlias(aliasName, realName);
*aoutSize = 0;
return code;
}
register struct cell *tcell=0;
register afs_int32 i;
register char *cp, *tp = ain;
- register struct afs_q *cq, *tq;
AFS_STATCNT(PListCells);
if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
memcpy((char *)&whichCell, tp, sizeof(afs_int32));
tp += sizeof(afs_int32);
- tcell = afs_GetRealCellByIndex(whichCell, READ_LOCK, 0);
+ tcell = afs_GetCellByIndex(whichCell, READ_LOCK);
if (tcell) {
cp = aout;
memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
strcpy(cp, tcell->cellName);
cp += strlen(tcell->cellName)+1;
*aoutSize = cp - aout;
+ afs_PutCell(tcell, READ_LOCK);
}
if (tcell) return 0;
else return EDOM;
afs_int32 *aoutSize; /* set this */
{
afs_int32 whichAlias;
- register struct cell *tcell=0;
+ register struct cell_alias *tcalias=0;
register char *cp, *tp = ain;
- register struct afs_q *cq, *tq;
if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
return EIO; /* Inappropriate ioctl for device */
memcpy((char *)&whichAlias, tp, sizeof(afs_int32));
tp += sizeof(afs_int32);
- ObtainReadLock(&afs_xcell);
- for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
- tcell = QTOC(cq); tq = QNext(cq);
- if (!(tcell->states & CAlias)) {
- tcell = 0;
- continue;
- }
- if (whichAlias == 0) break;
- tcell = 0;
- whichAlias--;
- }
- if (tcell) {
+ tcalias = afs_GetCellAlias(whichAlias);
+ if (tcalias) {
cp = aout;
- strcpy(cp, tcell->cellName);
- cp += strlen(tcell->cellName)+1;
- strcpy(cp, tcell->realName);
- cp += strlen(tcell->realName)+1;
+ strcpy(cp, tcalias->alias);
+ cp += strlen(tcalias->alias)+1;
+ strcpy(cp, tcalias->cell);
+ cp += strlen(tcalias->cell)+1;
*aoutSize = cp - aout;
+ afs_PutCellAlias(tcalias);
}
- ReleaseReadLock(&afs_xcell);
- if (tcell) return 0;
+ if (tcalias) return 0;
else return EDOM;
}
* fine. Should consider special-casing the local cell for large n.
* Likewise for PSetSPrefs.
*/
-static void ReSortCells(s,l, vlonly)
- int s; /* number of ids in array l[] -- NOT index of last id */
- afs_int32 l[]; /* array of cell ids which have volumes that need to be sorted */
- int vlonly; /* sort vl servers or file servers?*/
+static void *ReSortCells_cb(struct cell *cell, void *arg)
+{
+ afs_int32 *p = (afs_int32 *) arg;
+ afs_int32 *l = p + 1;
+ int i, s = p[0];
+
+ for (i=0; i<s; i++) {
+ if (l[i] == cell->cellNum) {
+ ObtainWriteLock(&cell->lock, 690);
+ afs_SortServers(cell->cellHosts, MAXCELLHOSTS);
+ ReleaseWriteLock(&cell->lock);
+ }
+ }
+}
+
+static void ReSortCells(int s, afs_int32 *l, int vlonly)
{
extern struct volume *afs_volumes[NVOLS]; /* volume hash table */
register int k;
if (vlonly) {
- struct cell *tcell;
- ObtainWriteLock(&afs_xcell,300);
- for(k=0;k<s;k++) {
- tcell = afs_GetCellNoLock(l[k], WRITE_LOCK);
- if (!tcell) continue;
- afs_SortServers(tcell->cellHosts, MAXCELLHOSTS);
- afs_PutCell(tcell, WRITE_LOCK);
- }
- ReleaseWriteLock(&afs_xcell);
+ afs_int32 *p;
+ p = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * (s+1));
+ p[0] = s;
+ memcpy(p+1, l, s * sizeof(afs_int32));
+ afs_TraverseCells(&ReSortCells_cb, p);
+ afs_osi_Free(p, sizeof(afs_int32) * (s+1));
return;
}
if (srvr->cell) {
/* if we don't know yet what cell it's in, this is moot */
- for (j=touchedSize-1; j>=0 && touched[j] != srvr->cell->cell; j--)
+ for (j=touchedSize-1; j>=0 && touched[j] != srvr->cell->cellNum; j--)
/* is it in our list of touched cells ? */ ;
if (j < 0) { /* no, it's not */
- touched[touchedSize++] = srvr->cell->cell;
+ touched[touchedSize++] = srvr->cell->cellNum;
if (touchedSize >= 32) { /* watch for ovrflow */
ReleaseReadLock(&afs_xserver);
ReSortCells(touchedSize, touched, vlonly);
#ifdef AFS_SMP
#define CONFIG_SMP 1
#ifndef CONFIG_X86_LOCAL_APIC
-#define CONFIG_X86_LOCAL_APIC
+#define CONFIG_X86_LOCAL_APIC 1
#endif
#ifndef __SMP__
#define __SMP__
#ifdef AFS_SMP
#define CONFIG_SMP 1
#ifndef CONFIG_X86_LOCAL_APIC
-#define CONFIG_X86_LOCAL_APIC
+#define CONFIG_X86_LOCAL_APIC 1
#endif
#ifndef __SMP__
#define __SMP__
#ifdef AFS_SMP
#define CONFIG_SMP 1
#ifndef CONFIG_S390_LOCAL_APIC
-#define CONFIG_S390_LOCAL_APIC
+#define CONFIG_S390_LOCAL_APIC 1
#endif
#ifndef __SMP__
#define __SMP__
@case "$(SYS_NAME)" in \
pmax_he1) \
$(CC) -c -I${TOP_INCDIR} process.s;; \
- sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sunx86_54) \
+ sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sunx86_5? | ncrx86_*) \
/usr/ccs/lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
${AS} process.ss -o process.o; \
$(RM) process.ss ;; \
$(RM) process.ss ;; \
hp* | *_linux* | sgi_64 | sgi_65 ) \
${CC} ${CFLAGS} -c process.c;; \
- ncrx86_*) \
- /usr/ccs/lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
- ${AS} -o process.o process.ss; \
- $(RM) process.ss ;; \
alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
${AS} -v -P -DOSF -I${TOP_INCDIR} -DASSEMBLER process.s; \
${AS} -v process.i -o process.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
+INCLUDES=-I${TOP_SRCDIR}/config -I${TOP_INCDIR}
CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS}
all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1
-/* $Id: pt_util.c,v 1.6 2003/01/02 03:55:51 hartmans Exp $ */
+/* $Id: pt_util.c,v 1.7 2003/04/13 19:32:23 hartmans Exp $ */
/*
*
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <errno.h>
#include <sys/file.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/pt_util.c,v 1.6 2003/01/02 03:55:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/pt_util.c,v 1.7 2003/04/13 19:32:23 hartmans Exp $");
#include <errno.h>
#include <lock.h>
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.13 2002/12/11 03:00:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.14 2003/04/13 19:32:24 hartmans Exp $");
#ifdef KERNEL
#include "../afs/sysincludes.h"
#ifdef AFS_NT40_ENV
# include <stdlib.h>
# include <fcntl.h>
-# include <afsutil.h>
+# include <afs/afsutil.h>
#else
# include <sys/socket.h>
# include <sys/file.h>
* to ease NT porting
*/
+extern pthread_mutex_t rx_stats_mutex;
extern pthread_mutex_t rxkad_stats_mutex;
extern pthread_mutex_t des_init_mutex;
extern pthread_mutex_t des_random_mutex;
static void rxi_InitPthread(void) {
assert(pthread_mutex_init(&rx_clock_mutex,
(const pthread_mutexattr_t*)0)==0);
+ assert(pthread_mutex_init(&rx_stats_mutex,
+ (const pthread_mutexattr_t*)0)==0);
assert(pthread_mutex_init(&rxi_connCacheMutex,
(const pthread_mutexattr_t*)0)==0);
assert(pthread_mutex_init(&rx_init_mutex,
*/
#ifdef RX_ENABLE_LOCKS
-static int rxi_ServerThreadSelectingCall;
static afs_kmutex_t rx_rpc_stats;
void rxi_StartUnlocked();
#endif
#ifndef KERNEL
MUTEX_INIT(&rxi_keyCreate_lock, "rxi_keyCreate_lock", MUTEX_DEFAULT, 0);
#endif /* !KERNEL */
- CV_INIT(&rx_serverPool_cv, "rx_serverPool_cv",CV_DEFAULT, 0);
#if defined(KERNEL) && defined(AFS_HPUX110_ENV)
if ( !uniprocessor )
rx_sleepLock = alloc_spinlock(LAST_HELD_ORDER-10, "rx_sleepLock");
osi_socket *socketp;
{
struct rx_serverQueueEntry *sq;
- register struct rx_call *call = (struct rx_call *) 0, *choice2;
+ register struct rx_call *call = (struct rx_call *) 0;
struct rx_service *service = NULL;
SPLVAR;
}
while (1) {
if (queue_IsNotEmpty(&rx_incomingCallQueue)) {
- register struct rx_call *tcall, *ncall;
- choice2 = (struct rx_call *) 0;
+ register struct rx_call *tcall, *ncall, *choice2 = NULL;
+
/* Scan for eligible incoming calls. A call is not eligible
* if the maximum number of calls for its service type are
* already executing */
* have all their input data available immediately. This helps
* keep threads from blocking, waiting for data from the client. */
for (queue_Scan(&rx_incomingCallQueue, tcall, ncall, rx_call)) {
- service = tcall->conn->service;
- if (!QuotaOK(service)) {
- continue;
- }
- if (!tno || !tcall->queue_item_header.next ) {
- /* If we're thread 0, then we'll just use
- * this call. If we haven't been able to find an optimal
- * choice, and we're at the end of the list, then use a
- * 2d choice if one has been identified. Otherwise... */
- call = (choice2 ? choice2 : tcall);
- service = call->conn->service;
- } else if (!queue_IsEmpty(&tcall->rq)) {
- struct rx_packet *rp;
- rp = queue_First(&tcall->rq, rx_packet);
- if (rp->header.seq == 1) {
- if (!meltdown_1pkt ||
- (rp->header.flags & RX_LAST_PACKET)) {
- call = tcall;
- } else if (rxi_2dchoice && !choice2 &&
- !(tcall->flags & RX_CALL_CLEARED) &&
- (tcall->rprev > rxi_HardAckRate)) {
- choice2 = tcall;
- } else rxi_md2cnt++;
+ service = tcall->conn->service;
+ if (!QuotaOK(service)) {
+ continue;
+ }
+ if (tno==rxi_fcfs_thread_num || !tcall->queue_item_header.next ) {
+ /* If we're the fcfs thread , then we'll just use
+ * this call. If we haven't been able to find an optimal
+ * choice, and we're at the end of the list, then use a
+ * 2d choice if one has been identified. Otherwise... */
+ call = (choice2 ? choice2 : tcall);
+ service = call->conn->service;
+ } else if (!queue_IsEmpty(&tcall->rq)) {
+ struct rx_packet *rp;
+ rp = queue_First(&tcall->rq, rx_packet);
+ if (rp->header.seq == 1) {
+ if (!meltdown_1pkt ||
+ (rp->header.flags & RX_LAST_PACKET)) {
+ call = tcall;
+ } else if (rxi_2dchoice && !choice2 &&
+ !(tcall->flags & RX_CALL_CLEARED) &&
+ (tcall->rprev > rxi_HardAckRate)) {
+ choice2 = tcall;
+ } else rxi_md2cnt++;
+ }
+ }
+ if (call) {
+ break;
+ } else {
+ ReturnToServerPool(service);
}
- }
- if (call) {
- break;
- } else {
- ReturnToServerPool(service);
- }
}
- }
+ }
if (call) {
queue_Remove(call);
- rxi_ServerThreadSelectingCall = 1;
MUTEX_EXIT(&rx_serverPool_lock);
MUTEX_ENTER(&call->lock);
- MUTEX_ENTER(&rx_serverPool_lock);
-
- if (queue_IsEmpty(&call->rq) ||
- queue_First(&call->rq, rx_packet)->header.seq != 1)
- rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0);
- CLEAR_CALL_QUEUE_LOCK(call);
- if (call->error) {
+ if (call->state != RX_STATE_PRECALL || call->error) {
MUTEX_EXIT(&call->lock);
+ MUTEX_ENTER(&rx_serverPool_lock);
ReturnToServerPool(service);
- rxi_ServerThreadSelectingCall = 0;
- CV_SIGNAL(&rx_serverPool_cv);
- call = (struct rx_call*)0;
+ call = NULL;
continue;
}
- call->flags &= (~RX_CALL_WAIT_PROC);
+
+ if (queue_IsEmpty(&call->rq) ||
+ queue_First(&call->rq, rx_packet)->header.seq != 1)
+ rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0);
+
+ CLEAR_CALL_QUEUE_LOCK(call);
+ call->flags &= ~RX_CALL_WAIT_PROC;
MUTEX_ENTER(&rx_stats_mutex);
rx_nWaiting--;
MUTEX_EXIT(&rx_stats_mutex);
- rxi_ServerThreadSelectingCall = 0;
- CV_SIGNAL(&rx_serverPool_cv);
- MUTEX_EXIT(&rx_serverPool_lock);
break;
}
else {
for (queue_Scan(&rx_incomingCallQueue, tcall, ncall, rx_call)) {
service = tcall->conn->service;
if (QuotaOK(service)) {
- if (!tno || !tcall->queue_item_header.next ) {
- /* If we're thread 0, then we'll just use
+ if (tno==rxi_fcfs_thread_num || !tcall->queue_item_header.next ) {
+ /* If we're the fcfs thread, then we'll just use
* this call. If we haven't been able to find an optimal
* choice, and we're at the end of the list, then use a
* 2d choice if one has been identified. Otherwise... */
{
register struct rx_serverQueueEntry *sq;
register struct rx_service *service = call->conn->service;
-#ifdef RX_ENABLE_LOCKS
register int haveQuota = 0;
-#endif /* RX_ENABLE_LOCKS */
+
/* May already be attached */
if (call->state == RX_STATE_ACTIVE) return;
MUTEX_ENTER(&rx_serverPool_lock);
-#ifdef RX_ENABLE_LOCKS
- while(rxi_ServerThreadSelectingCall) {
- MUTEX_EXIT(&call->lock);
- CV_WAIT(&rx_serverPool_cv, &rx_serverPool_lock);
- MUTEX_EXIT(&rx_serverPool_lock);
- MUTEX_ENTER(&call->lock);
- MUTEX_ENTER(&rx_serverPool_lock);
- /* Call may have been attached */
- if (call->state == RX_STATE_ACTIVE) return;
- }
haveQuota = QuotaOK(service);
if ((!haveQuota) || queue_IsEmpty(&rx_idleServerQueue)) {
* put the call on the incoming call queue (unless it's
* already on the queue).
*/
+#ifdef RX_ENABLE_LOCKS
if (haveQuota)
ReturnToServerPool(service);
+#endif /* RX_ENABLE_LOCKS */
+
if (!(call->flags & RX_CALL_WAIT_PROC)) {
call->flags |= RX_CALL_WAIT_PROC;
MUTEX_ENTER(&rx_stats_mutex);
queue_Append(&rx_incomingCallQueue, call);
}
}
-#else /* RX_ENABLE_LOCKS */
- if (!QuotaOK(service) || queue_IsEmpty(&rx_idleServerQueue)) {
- /* If there are no processes available to service this call,
- * put the call on the incoming call queue (unless it's
- * already on the queue).
- */
- if (!(call->flags & RX_CALL_WAIT_PROC)) {
- call->flags |= RX_CALL_WAIT_PROC;
- rx_nWaiting++;
- rxi_calltrace(RX_CALL_ARRIVAL, call);
- queue_Append(&rx_incomingCallQueue, call);
- }
- }
-#endif /* RX_ENABLE_LOCKS */
else {
sq = queue_First(&rx_idleServerQueue, rx_serverQueueEntry);
CALL_HOLD(call, RX_CALL_REFCOUNT_SEND);
MUTEX_EXIT(&call->lock);
if (len > 1) {
- rxi_SendPacketList(conn, list, len, istack);
+ rxi_SendPacketList(call, conn, list, len, istack);
} else {
- rxi_SendPacket(conn, list[0], istack);
+ rxi_SendPacket(call, conn, list[0], istack);
}
MUTEX_ENTER(&call->lock);
CALL_RELE(call, RX_CALL_REFCOUNT_SEND);
/* Actually send the packet, filling in more connection-specific fields */
CALL_HOLD(call, RX_CALL_REFCOUNT_SEND);
MUTEX_EXIT(&call->lock);
- rxi_SendPacket(conn, p, istack);
+ rxi_SendPacket(call, conn, p, istack);
MUTEX_ENTER(&call->lock);
CALL_RELE(call, RX_CALL_REFCOUNT_SEND);
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_packet.c,v 1.7 2002/09/26 19:18:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_packet.c,v 1.8 2003/04/13 19:32:24 hartmans Exp $");
#ifdef KERNEL
#if defined(UKERNEL)
}
/* Send the packet to appropriate destination for the specified
- * connection. The header is first encoded and placed in the packet.
+ * call. The header is first encoded and placed in the packet.
*/
-void rxi_SendPacket(struct rx_connection * conn, struct rx_packet *p,
- int istack)
+void rxi_SendPacket(struct rx_call * call, struct rx_connection * conn,
+ struct rx_packet *p, int istack)
{
#if defined(KERNEL)
int waslocked;
#endif
+ int code;
struct sockaddr_in addr;
register struct rx_peer *peer = conn->peer;
osi_socket socket;
waslocked = ISAFS_GLOCK();
if (waslocked) AFS_GUNLOCK();
#endif
- if (osi_NetSend(socket, &addr, p->wirevec, p->niovecs,
- p->length+RX_HEADER_SIZE, istack)){
+ if ((code = osi_NetSend(socket, &addr, p->wirevec, p->niovecs,
+ p->length+RX_HEADER_SIZE, istack)) != 0) {
/* send failed, so let's hurry up the resend, eh? */
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.netSendFailures++;
MUTEX_EXIT(&rx_stats_mutex);
p->retryTime = p->timeSent; /* resend it very soon */
clock_Addmsec(&(p->retryTime), 10 + (((afs_uint32) p->backoff) << 8));
+
+#if defined(KERNEL) && defined(AFS_LINUX20_ENV)
+ /* Linux is nice -- it can tell us right away that we cannot
+ * reach this recipient by returning an ENETUNREACH error
+ * code. So, when this happens let's "down" the host NOW so
+ * we don't sit around waiting for this host to timeout later.
+ */
+ if (call && code == -ENETUNREACH)
+ call->lastReceiveTime = 0;
+#endif
}
#ifdef KERNEL
if (waslocked) AFS_GLOCK();
/* Send a list of packets to appropriate destination for the specified
* connection. The headers are first encoded and placed in the packets.
*/
-void rxi_SendPacketList(struct rx_connection * conn,
- struct rx_packet **list,
- int len,
- int istack)
+void rxi_SendPacketList(struct rx_call * call, struct rx_connection * conn,
+ struct rx_packet **list, int len, int istack)
{
#if defined(AFS_SUN5_ENV) && defined(KERNEL)
int waslocked;
osi_socket socket;
struct rx_packet *p = NULL;
struct iovec wirevec[RX_MAXIOVECS];
- int i, length;
+ int i, length, code;
afs_uint32 serial;
afs_uint32 temp;
struct rx_jumboHeader *jp;
waslocked = ISAFS_GLOCK();
if (!istack && waslocked) AFS_GUNLOCK();
#endif
- if (osi_NetSend(socket, &addr, &wirevec[0], len+1, length, istack)){
+ if ((code = osi_NetSend(socket, &addr, &wirevec[0], len+1, length, istack)) != 0){
/* send failed, so let's hurry up the resend, eh? */
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.netSendFailures++;
p->retryTime = p->timeSent; /* resend it very soon */
clock_Addmsec(&(p->retryTime), 10 + (((afs_uint32) p->backoff) << 8));
}
+#if defined(KERNEL) && defined(AFS_LINUX20_ENV)
+ /* Linux is nice -- it can tell us right away that we cannot
+ * reach this recipient by returning an ENETUNREACH error
+ * code. So, when this happens let's "down" the host NOW so
+ * we don't sit around waiting for this host to timeout later.
+ */
+ if (call && code == -ENETUNREACH)
+ call->lastReceiveTime = 0;
+#endif
}
#if defined(AFS_SUN5_ENV) && defined(KERNEL)
if (!istack && waslocked) AFS_GLOCK();
}
if (call) rxi_Send(call, p, istack);
- else rxi_SendPacket(conn, p, istack);
+ else rxi_SendPacket((struct rx_call *)0, conn, p, istack);
if (saven) { /* means we truncated the packet above. We probably don't */
/* really need to do this, but it seems safer this way, given that */
/* sneaky optionalPacket... */
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket5.c,v 1.1.1.2 2003/04/13 19:07:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket5.c,v 1.3 2003/04/13 19:32:24 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
syscall.o: syscall.s
case "$(SYS_NAME)" in \
- sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sunx86_54) \
+ sun*_5? ) \
/usr/ccs/lib/cpp ${SFLAGS} syscall.s syscall.ss; \
as -o syscall.o syscall.ss; \
$(RM) syscall.ss;; \
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsyss.c,v 1.2 2003/01/02 03:55:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsyss.c,v 1.3 2003/04/13 19:32:24 hartmans Exp $");
#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <errno.h>
#include <rx/xdr.h>
+#include <errno.h>
#include <signal.h>
#ifdef HAVE_STRING_H
#include <string.h>
${TOP_INCDIR}/afs/pthread_glock.h \
${TOP_INCDIR}/afs/afs_atomlist.h \
${TOP_INCDIR}/afs/afs_lhash.h \
+ ${TOP_INCDIR}/afs/softsig.h \
${TOP_INCDIR}/potpourri.h \
${TOP_LIBDIR}/util.a \
${TOP_LIBDIR}/libafsutil.a \
${DESTDIR}${includedir}/afs/pthread_glock.h \
${DESTDIR}${includedir}/afs/afs_atomlist.h \
${DESTDIR}${includedir}/afs/afs_lhash.h \
+ ${DESTDIR}${includedir}/afs/softsig.h \
${DESTDIR}${includedir}/potpourri.h \
${DESTDIR}${libdir}/afs/util.a \
${DESTDIR}${libdir}/afs/libafsutil.a \
${TOP_INCDIR}/afs/afs_lhash.h: afs_lhash.h
${INSTALL} $? $@
+${TOP_INCDIR}/afs/softsig.h: softsig.h
+ ${INSTALL} $? $@
+
${TOP_INCDIR}/potpourri.h: potpourri.h
${INSTALL} $? $@
${DESTDIR}${includedir}/afs/afs_lhash.h: afs_lhash.h
${INSTALL} $? $@
+${DESTDIR}${includedir}/afs/softsig.h: softsig.h
+ ${INSTALL} $? $@
+
${DESTDIR}${includedir}/potpourri.h: potpourri.h
${INSTALL} $? $@
${DEST}/include/afs/afs_lhash.h: afs_lhash.h
${INSTALL} $? $@
+${DEST}/include/afs/softsig.h: softsig.h
+ ${INSTALL} $? $@
+
${DEST}/include/potpourri.h: potpourri.h
${INSTALL} $? $@
${DEST}/include/afs/pthread_glock.h \
${DEST}/include/afs/afs_atomlist.h \
${DEST}/include/afs/afs_lhash.h \
+ ${DEST}/include/afs/softsig.h \
${DEST}/include/potpourri.h \
${DEST}/lib/afs/util.a \
${DEST}/lib/afs/libafsutil.a \
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fstrace.c,v 1.7 2002/05/12 05:50:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fstrace.c,v 1.8 2003/04/13 19:32:24 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
}
#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV)
/* on sparc this function returns none value, so do it myself */
- __asm__ __volatile__ ("
- mov %o0, %i0
- ret
- restore
-");
+ __asm__ __volatile__ (
+ "mov %o0, %i0\n\t"
+ "ret\n\t"
+ "restore");
#endif
#else
#if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/kdump.c,v 1.6 2003/01/02 03:55:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/kdump.c,v 1.7 2003/04/13 19:32:24 hartmans Exp $");
#include <stdio.h>
#include <errno.h>
if (Dcells || Dall) {
print_cells(1); /* Handle the afs_cells structures */
+ print_cellaliases(1);
+ print_cellnames(1);
}
if (Dusers || Dall) {
#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
int Sum_cellnames=0, Sum_userstp=0, Sum_volnames=0, Sum_exps=0, Sum_nfssysnames=0;
int Sum_vcachemvids=0, Sum_vcachelinkData=0, Sum_vcacheacc=0, Sum_vcachelocks=0;
+int Sum_cellaliases=0, Sum_cellname_names=0;
int print_cells(pnt)
int pnt;
j++;
}
if (pnt) printf("... found %d 'afs_cells' entries\n", j);
+
+ return j;
+}
+
+int print_cellaliases(int pnt)
+{
+ off_t symoff;
+ struct cell_alias *ca, cae;
+ long j = 0;
+
+ if (pnt) printf("\n\nPrinting cell_alias list...\n");
+ findsym( "afs_cellalias_head", &symoff);
+ kread(kmem, symoff, (char *) &ca, sizeof ca);
+ while (ca) {
+ char alias[100], cell[100];
+
+ kread(kmem, (off_t) ca, (char *) &cae, sizeof cae);
+ kread(kmem, (off_t) cae.alias, alias, (KDUMP_SIZE_T)40);
+ alias[40] = '\0';
+ Sum_cellaliases += strlen(alias) + 1;
+ kread(kmem, (off_t) cae.cell, cell, (KDUMP_SIZE_T)40);
+ cell[40] = '\0';
+ Sum_cellaliases += strlen(cell) + 1;
+ if (pnt)
+ printf("%x: alias=%s cell=%s index=%d\n",
+ ca, alias, cell, cae.index);
+ ca = cae.next;
+ j++;
+ }
+ if (pnt) printf("... found %d 'cell_alias' entries\n", j);
+
+ return j;
+}
+
+int print_cellnames(int pnt)
+{
+ off_t symoff;
+ struct cell_name *cn, cne;
+ long j = 0;
+
+ if (pnt) printf("\n\nPrinting cell_name list...\n");
+ findsym( "afs_cellname_head", &symoff);
+ kread(kmem, symoff, (char *) &cn, sizeof cn);
+ while (cn) {
+ char cellname[100];
+
+ kread(kmem, (off_t) cn, (char *) &cne, sizeof cne);
+ kread(kmem, (off_t) cne.cellname, cellname, (KDUMP_SIZE_T)40);
+ cellname[40] = '\0';
+ Sum_cellname_names += strlen(cellname) + 1;
+ if (pnt)
+ printf("%x: cellnum=%d cellname=%s used=%d\n",
+ cn, cne.cellnum, cellname, cne.used);
+ cn = cne.next;
+ j++;
+ }
+ if (pnt) printf("... found %d 'cell_name' entries\n", j);
+
return j;
}
T += j;
printf("%20s:\t%8d bytes\t[%d cells/%d bytes each + %d bytes for cell names]\n", "Cell package", j, i, sizeof(struct cell), Sum_cellnames);
+ Sum_cellaliases=0;
+ i = print_cellaliases(0);
+ j = (i * sizeof(struct cell_alias)) + Sum_cellaliases;
+ T += j;
+ printf("%20s:\t%8d bytes\t[%d cell_aliases/%d bytes each + %d bytes for cell names]\n", "Cell package", j, i, sizeof(struct cell_alias), Sum_cellaliases);
+
+ Sum_cellname_names=0;
+ i = print_cellnames(0);
+ j = (i * sizeof(struct cell_name)) + Sum_cellname_names;
+ T += j;
+ printf("%20s:\t%8d bytes\t[%d cell_names/%d bytes each + %d bytes for cell name strings]\n", "Cell package", j, i, sizeof(struct cell_name), Sum_cellname_names);
+
Sum_userstp=0;
i = print_users(0);
j = (i * sizeof(struct unixuser)) + Sum_userstp;
cellName[40] = 0;
Sum_cellnames += strlen(cellName)+1;
if (pnt) {
- printf("%lx: cell=%s, cellname=%s, states=%x, cindex=%d fsport=%d vlport=%d\n", ptr,
- PrintIPAddr(clep->cell), cellName, clep->states, clep->cellIndex,
- clep->fsport, clep->vlport);
+ printf("%lx: cellname=%s, states=%x, cnum=%d, cindex=%d fsport=%d vlport=%d timeout=%d cnamep=%x\n", ptr,
+ cellName, clep->states, clep->cellNum, clep->cellIndex,
+ clep->fsport, clep->vlport, clep->timeout, clep->cnamep);
+
#ifdef AFS33
if (clep->lcellp)
printf("\tlinked cellp %lx\n", clep->lcellp);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.11 2002/12/11 03:00:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.12 2003/04/13 19:32:25 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
static CallPreamble(acall, activecall)
register struct rx_call **acall;
int activecall;
-
{
struct host *thost;
struct rx_connection *tconn;
struct client *tclient;
int retry_flag=1;
int code = 0;
+ char hoststr[16];
+
tconn = rx_ConnectionOf(*acall);
*acall = (struct rx_call *)tconn; /* change it! */
ViceLog(0,("BreakDelayedCallbacks FAILED for host %08x which IS UP. Possible network or routing failure.\n",thost->host));
if ( MultiProbeAlternateAddress_r (thost) ) {
ViceLog(0, ("MultiProbe failed to find new address for host %x.%d\n",
- thost->host, thost->port));
- code = -1;
+ afs_inet_ntoa_r(thost->host, hoststr),
+ ntohs(thost->port)));
+ code = -1;
} else {
- ViceLog(0, ("MultiProbe found new address for host %x.%d\n",
- thost->host, thost->port));
+ ViceLog(0, ("MultiProbe found new address for host %s:%d\n",
+ afs_inet_ntoa_r(thost->host, hoststr),
+ ntohs(thost->port)));
if (BreakDelayedCallBacks_r(thost)) {
ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %08x which IS UP. Possible network or routing failure.\n",thost->host));
code = -1;
/* I'm not really worried about when we restarted, I'm */
/* just worried about when the first VBUSY was returned. */
TM_GetTimeOfDay(&restartedat, 0);
- return(VBUSY);
+ return(busyonrst?VBUSY:VRESTARTING);
}
else {
struct timeval now;
TM_GetTimeOfDay(&now, 0);
if ((now.tv_sec - restartedat.tv_sec) < (11*60)) {
- return(VBUSY);
+ return(busyonrst?VBUSY:VRESTARTING);
}
else {
return (VRESTARTING);