*/
-#ifdef AFS_SGI65_ENV
/* TODO: Fix this later. */
static int
SGI_ProcScanFunc(void *p, void *arg, int mode)
{
return 0;
}
-#else /* AFS_SGI65_ENV */
-static int
-SGI_ProcScanFunc(proc_t * p, void *arg, int mode)
-{
- afs_int32(*perproc_func) (afs_proc_t *) = arg;
- int code = 0;
- /* we pass in the function pointer for arg,
- * mode ==0 for startup call, ==1 for each valid proc,
- * and ==2 for terminate call.
- */
- if (mode == 1) {
- code = perproc_func(p);
- }
- return code;
-}
-#endif /* AFS_SGI65_ENV */
void
afs_osi_TraverseProcTable(void)
* subsequent calls may overwrite the previously returned value.
*/
-#if defined(AFS_SGI65_ENV)
const afs_ucred_t *
afs_osi_proc2cred(afs_proc_t * p)
{
return NULL;
}
-#else
-const afs_ucred_t *
-afs_osi_proc2cred(afs_proc_t * pr)
-{
- afs_ucred_t *rv = NULL;
-
- if (pr == NULL) {
- return NULL;
- }
- rv = pr->p_cred;
-
- return rv;
-}
-#endif
-
#endif /* AFS_GCPAGS */
/* This is common code between SGI's DFS and our AFS. Do *not* alter it's
* interface or semantics without notifying SGI.
*/
-#ifdef AFS_SGI65_ENV
/* fixup_pags returns error code if relevant or 0 on no error.
* Sets up the cred for the call to estgroups. This is pretty convoluted
* in order to avoid including the private proc.h header file.
}
return 0;
}
-#else
-/*
- * Generic routine to set the PAG in the cred for AFS and DFS.
- * If flag = 0 this is a DFS pag held in one group.
- * If flag = 1 this is a AFS pag held in two group entries
- */
-static int
-afsDFS_SetPagInCred(struct ucred *credp, int pag, int flag)
-{
- int *gidset;
- int i, ngrps;
- gid_t g0, g1;
- int n = 0;
- struct ucred *newcredp;
- int groups_taken = (flag ? 2 : 1);
-
- ngrps = credp->cr_ngroups + groups_taken;
- if (ngrps >= ngroups_max)
- return E2BIG;
-
-
- if (flag) {
- /* Break out the AFS pag into two groups */
- afs_get_groups_from_pag(pag, &g0, &g1);
- }
-
- newcredp = crdup(credp);
- newcredp->cr_ngroups = ngrps;
-
- if (flag) {
- /* AFS case */
- newcredp->cr_groups[0] = g0;
- newcredp->cr_groups[1] = g1;
- } else {
- /* DFS case */
- if (PagInCred(newcredp) != NOPAG) {
- /* found an AFS PAG is set in this cred */
- n = 2;
- }
- newcredp->cr_groups[n] = pag;
- }
- for (i = n; i < credp->cr_ngroups; i++)
- newcredp->cr_groups[i + groups_taken] = credp->cr_groups[i];
-
- /* estgroups sets current threads cred from newcredp and crfree's credp */
- estgroups(credp, newcredp);
-
- return 0;
-}
-#endif /* AFS_SGI65_ENV */
/* SGI's osi_GetPagFromCred - They return a long. */
int
* This means we don't really know if our DFS PAG is in
* the first or third group entry.
*/
-#ifdef AFS_SGI65_ENV
pag = credp->cr_groups[ngroups - 1];
-#else
- pag = credp->cr_groups[0];
- if (PagInCred(credp) != NOPAG) {
- /* AFS has a PAG value in the first two group entries */
- if (ngroups < 3)
- return NOPAG;
- pag = credp->cr_groups[2];
- }
-#endif
if (((pag >> 24) & 0xff) == 'A')
return pag;
else
if (code = setgroups(ngroups, gidset))
return code;
-#ifdef AFS_SGI65_ENV
if (old_afs_pag == NOPAG && old_dfs_pag == NOPAG)
return 0;
(old_dfs_pag == NOPAG) ? 0 : old_dfs_pag);
if (!code && modcredp)
estgroups(OSI_GET_CURRENT_PROCP(), modcredp);
-#else
-
- /*
- * The setgroups gave our curent thread a new cred pointer
- * Get the value again
- */
- credp = OSI_GET_CURRENT_CRED();
- if ((PagInCred(credp) == NOPAG) && (old_afs_pag != NOPAG)) {
- /* reset the AFS PAG */
- code = afsDFS_SetPagInCred(credp, old_afs_pag, 1);
- }
- /*
- * Once again get the credp because the afsDFS_SetPagInCred might have
- * assigned a new one.
- */
- credp = OSI_GET_CURRENT_CRED();
- if ((osi_DFSGetPagFromCred(credp) == NOPAG)
- && (old_dfs_pag != NOPAG)) {
- code = afsDFS_SetPagInCred(credp, old_dfs_pag, 0);
- }
-#endif /* AFS_SGI65_ENV */
return code;
}
while (ngroups--)
*gp++ = *gidset++;
if (!change_parent) {
-#ifdef AFS_SGI65_ENV
estgroups(OSI_GET_CURRENT_PROCP(), newcr);
-#else
- estgroups(cr, newcr);
-#endif
}
*cred = newcr;
return (0);
#include "afs/param.h"
-#ifdef AFS_SGI62_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
avc->execsOrWriters, avc->flockCount, avc->f.states);
printflags(avc->f.states, tab_vcache);
qprintf("\n");
-#ifdef AFS_SGI64_ENV
qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n",
avc->mapcnt, avc->mvstat, avc->f.anyAccess, avc->Access);
qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid.target_root, &avc->lock,
avc->cred);
qprintf(" rwlock 0x%x (%d) id %llu trips %d\n", &avc->vc_rwlock,
valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips);
-#else
- qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n", avc->mapcnt,
- avc->mvstat, avc->f.anyAccess, avc->Access);
- qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid.target_root, &avc->lock,
- avc->cred);
- qprintf(" rwlock 0x%x (%d) id %d trips %d\n", &avc->vc_rwlock,
- valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips);
-#endif
AFS_GUNLOCK();
return 0;
}
AFS_GUNLOCK();
return 0;
}
-
-#endif /* AFS_SGI62_ENV */
#undef gop_lookupname_user
#define gop_lookupname_user(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),NULL,(compvpp), NULL)
-#ifdef AFS_SGI64_ENV
#include <sys/flock.h>
extern flid_t osi_flid;
#define v_op v_bh.bh_first->bd_ops
#define v_data v_bh.bh_first->bd_pdata
#define vfs_data vfs_bh.bh_first->bd_pdata
-#endif /* AFS_SGI64_ENV */
/*
* Global lock, semaphore, mutex and state vector support.
#define SPLOCK(l) mp_mutex_spinlock(&(l))
#define SPUNLOCK(l,s) mp_mutex_spinunlock(&(l),s)
#define SP_WAIT(l, s, cv, p) mp_sv_wait_sig(cv, p, (void*)(&(l)), s)
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
/* Add PLTWAIT for afsd's to wait so we don't rack up the load average. */
#define AFSD_PRI() ((kt_basepri(curthreadp) == PTIME_SHARE) ? PZERO : (PZERO|PLTWAIT))
#undef AFS_MUTEX_ENTER
} \
MACRO_END
-#else /* AFS_SGI65_ENV */
-/* Add PLTWAIT for afsd's to wait so we don't rack up the load average. */
-#define AFSD_PRI() ((curprocp && curprocp->p_rss==0) ? (PZERO|PLTWAIT) : PZERO)
-
-#define AFS_MUTEX_ENTER(mp) \
- MACRO_BEGIN \
- kthread_t *kt; \
- while(mutex_tryenter(mp) == 0) { \
- kt = mutex_owner(mp); \
- if (kt != NULL && kt->k_sonproc == CPU_NONE) { \
- mutex_lock(mp, AFSD_PRI()); \
- break; \
- } \
- } \
- MACRO_END
-#endif /* AFS_SGI65_ENV */
#define cv_timedwait(cv, l, t) { \
sv_timedwait(cv, AFSD_PRI(), l, 0, 0, &(t), \
sv_wait(cv, AFSD_PRI(), l, 0); \
AFS_MUTEX_ENTER(l); \
}
-#else /* AFS_SGI64_ENV */
-#ifdef AFS_SGI62_ENV
-
-#define AFS_MUTEX_ENTER(mp) \
- MACRO_BEGIN \
- struct proc *_procP; \
- while(mutex_tryenter(mp) == 0) { \
- _procP = mutex_owner(mp); \
- if (_procP != NULL && _procP->p_sonproc == CPU_NONE) { \
- mutex_enter(mp); \
- break; \
- } \
- } \
- MACRO_END
-
-#else /* AFS_SGI62_ENV */
-
-#define AFS_MUTEX_ENTER(mp) mutex_enter(mp)
-
-#endif /* AFS_SGI62_ENV */
-
-#define cv_timedwait(cv, l, t) { \
- sv_timedwait(cv, l, t); \
- AFS_GLOCK(); \
- }
-#endif /* AFS_SGI64_ENV */
#if defined(KERNEL)
#if defined(MP)
* concern no longer exists.
*/
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
/* Irix does not check for deadlocks unless it's a debug kernel. */
#define AFS_ASSERT_GNOTME() \
(!ISAFS_GLOCK() || (panic("afs global lock held be me"), 0))
#define AFS_GLOCK() \
{ AFS_ASSERT_GNOTME(); AFS_MUTEX_ENTER(&afs_global_lock); }
-#else
-#define AFS_GLOCK() AFS_MUTEX_ENTER(&afs_global_lock)
-#endif
#define AFS_GUNLOCK() { AFS_ASSERT_GLOCK(); mutex_exit(&afs_global_lock); }
#define ISAFS_GLOCK() mutex_mine(&afs_global_lock)
-#else
-extern long afs_global_owner;
-#define AFS_GLOCK() \
- MACRO_BEGIN \
- AFS_MUTEX_ENTER(&afs_global_lock) ; \
- afs_global_owner = osi_ThreadUnique(); \
- MACRO_END
-#define AFS_GUNLOCK() \
- { AFS_ASSERT_GLOCK(); afs_global_owner = 0; mutex_exit(&afs_global_lock); }
-#define ISAFS_GLOCK() (osi_ThreadUnique() == afs_global_owner)
-#endif /* AFS_SGI64_ENV */
#else /* MP */
#define AFS_GLOCK()
#define AFS_GUNLOCK()
#endif /* KERNEL */
-#if defined(AFS_SGI62_ENV)
-# define osi_InitGlock() \
+#define osi_InitGlock() \
mutex_init(&afs_global_lock, MUTEX_DEFAULT, "afs_global_lock");
-#else
-# define osi_InitGlock() \
- mutex_init(&afs_global_lock, "afs_global_lock", MUTEX_DEFAULT, NULL);
-#endif
-#ifdef AFS_SGI64_ENV
#define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr),\
(int *)(aresid), &osi_flid)
-#else
-#define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
- vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr), \
- (int *)(aresid))
-#endif
-#ifdef AFS_SGI64_ENV
#undef suser
#define suser() cap_able(CAP_DEVICE_MGT)
-#endif
#define afs_suser(x) suser()
#define afs_hz HZ
-#ifdef AFS_SGI64_ENV
#undef setuerror
#undef getuerror
-#endif
/* OS independent user structure stuff */
/*
* OSI_GET_CURRENT_PID
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_PID() (u.u_procp->p_pid)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV) && !defined(AFS_SGI65_ENV)
-#define OSI_GET_CURRENT_PID() current_pid()
-#endif /* AFS_SGI64_ENV */
-
-#if defined(AFS_SGI65_ENV)
#define OSI_GET_CURRENT_PID() proc_pid(curproc())
-#endif
#define getpid() OSI_GET_CURRENT_PID()
/*
* OSI_GET_CURRENT_PROCP
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_PROCP() (u.u_procp)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV) && !defined(AFS_SGI65_ENV)
-#define OSI_GET_CURRENT_PROCP() curprocp
-#endif /* AFS_SGI64_ENV */
-
-#if defined(AFS_SGI65_ENV)
#define OSI_GET_CURRENT_PROCP() UT_TO_PROC(curuthread)
-#endif
/*
*
* Prior to IRIX 6.4, pid sufficed, now we need kthread.
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_LOCKID() (u.u_procp->p_pid)
-#define OSI_NO_LOCKID (-1)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
/* IRIX returns k_id, but this way, we've got the thread address for debugging. */
#define OSI_GET_LOCKID() \
(private.p_curkthread ? (uint64_t)private.p_curkthread : (uint64_t)0)
#define OSI_NO_LOCKID ((uint64_t)-1)
-#endif /* AFS_SGI64_ENV */
/*
* OSI_GET_CURRENT_CRED
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_CRED() (u.u_cred)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
#define OSI_GET_CURRENT_CRED() get_current_cred()
-#endif /* AFS_SGI64_ENV */
#define osi_curcred() OSI_GET_CURRENT_CRED()
/*
* OSI_SET_CURRENT_CRED
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_SET_CURRENT_CRED(x) u.u_cred=x
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
#define OSI_SET_CURRENT_CRED(C) set_current_cred((C))
-#endif /* AFS_SGI64_ENV */
/*
* OSI_GET_CURRENT_ABI
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_ABI() (u.u_procp->p_abi)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
#define OSI_GET_CURRENT_ABI() get_current_abi()
-#endif /* AFS_SGI64_ENV */
/*
* OSI_GET_CURRENT_SYSID
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_SYSID() (u.u_procp->p_sysid)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
#define OSI_GET_CURRENT_SYSID() (curprocp->p_flid.fl_sysid)
-#endif /* AFS_SGI64_ENV */
/*
* OSI_GET_CURRENT_COMM
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_COMM() (u.u_comm)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV)
#define OSI_GET_CURRENT_COMM() (curprocp->p_comm)
-#endif /* AFS_SGI64_ENV */
/*
* OSI_GET_CURRENT_CDIR
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_CDIR() (u.u_cdir)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV) && !defined(AFS_SGI65_ENV)
-#define OSI_GET_CURRENT_CDIR() (curprocp->p_cdir)
-#endif /* AFS_SGI64_ENV */
-
-#if defined(AFS_SGI65_ENV)
#define OSI_GET_CURRENT_CDIR() (curuthread->ut_cdir)
-#endif /* AFS_SGI65_ENV */
/*
* OSI_GET_CURRENT_RDIR
*/
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-#define OSI_GET_CURRENT_RDIR() (u.u_rdir)
-#endif /* AFS_SGI_ENV but not AFS_SGI64_ENV */
-
-#if defined(AFS_SGI64_ENV) && !defined(AFS_SGI65_ENV)
-#define OSI_GET_CURRENT_RDIR() (curprocp->p_rdir)
-#endif /* AFS_SGI64_ENV */
-
-#if defined(AFS_SGI65_ENV)
#define OSI_GET_CURRENT_RDIR() (curuthread->ut_rdir)
-#endif /* AFS_SGI65_ENV */
* Note that the _CONVERT routines get the ";" here so that argument lists
* can have arguments after the OSI_x_CONVERT macro is called.
*/
-#ifdef AFS_SGI64_ENV
#undef OSI_VN_ARG
#define OSI_VN_ARG(V) bhv_##V
#undef OSI_VN_DECL
#define OSI_VFS_DECL(V) bhv_desc_t *bhv_##V
#undef OSI_VFS_CONVERT
#define OSI_VFS_CONVERT(V) struct vfs * V = (struct vfs*)bhvtovfs(bhv_##V)
-#endif /* AFS_SGI64_ENV */
#define osi_procname(procname, size) strncpy(procname, proc_name(curproc()), size)
#include "afs/param.h"
-#ifdef AFS_SGI62_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
#else
int afs_ipno = -1;
#endif
-
-
-#endif /* AFS_SGI62_ENV */
avc->vc_rwlockid = OSI_NO_LOCKID;
initnsema(&avc->vc_rwlock, 1,
makesname(name, "vrw", avc->v.v_number));
-#ifndef AFS_SGI53_ENV
- initnsema(&avc->v.v_sync, 0,
- makesname(name, "vsy", avc->v.v_number));
-#endif
-#ifndef AFS_SGI62_ENV
- initnlock(&avc->v.v_lock,
- makesname(name, "vlk", avc->v.v_number));
-#endif
return avc;
}
memset(&(avc->vc_bhv_desc), 0, sizeof(avc->vc_bhv_desc));
bhv_desc_init(&(avc->vc_bhv_desc), avc, avc, &Afs_vnodeops);
-#if defined(AFS_SGI65_ENV)
vn_bhv_head_init(&(avc->v.v_bh), "afsvp");
vn_bhv_insert_initial(&(avc->v.v_bh), &(avc->vc_bhv_desc));
avc->v.v_mreg = avc->v.v_mregb = (struct pregion *)avc;
avc->v.v_number);
init_mutex(&avc->v.v_filocksem, MUTEX_DEFAULT, "afsvfl", (long)avc);
init_mutex(&avc->v.v_buf_lock, MUTEX_DEFAULT, "afsvnbuf", (long)avc);
-#else
- bhv_head_init(&(avc->v.v_bh));
- bhv_insert_initial(&(avc->v.v_bh), &(avc->vc_bhv_desc));
-#endif
vnode_pcache_init(&avc->v);
osi_Assert(avc->mapcnt == 0 && avc->vc_locktrips == 0);
osi_Assert(avc->vc_rwlockid == OSI_NO_LOCKID);
osi_Assert(avc->v.v_filocks == NULL);
-# if !defined(AFS_SGI65_ENV)
- osi_Assert(avc->v.v_filocksem == NULL);
-# endif
osi_Assert(avc->cred == NULL);
-# if defined(AFS_SGI64_ENV)
vnode_pcache_reinit(&avc->v);
avc->v.v_rdev = NODEV;
-# endif
vn_initlist((struct vnlist *)&avc->v);
avc->lastr = 0;
}
extern int xfs_iget(struct mount *, struct xfs_trans *, xfs_ino_t, uint,
xfs_inode_t **, daddr_t);
-#ifdef AFS_SGI64_ENV
#define XFS_ITOV(ip) BHV_TO_VNODE((struct bhv_desc *)(((char*)(ip)) + 6*sizeof(void*)))
-#else
-#define XFS_ITOV(ip) (*((vnode_t**)((((char*)(ip)) + 6*sizeof(void*)))))
-#endif
/* When we have XFS only clients, then these macros will be defined in
* terms of the XFS inode only.
#endif
-#if defined(AFS_SGI64_ENV) && defined(CKPT)
+#if defined(CKPT)
/* This is a fid for checkpoint restart. Note that the length will be
* greater than 10 and so afs_vget can distinguish this fid.
*/
extern int afs_mount(), afs_unmount(), afs_root(), afs_statfs();
-#ifdef AFS_SGI65_ENV
extern int afs_sync(OSI_VFS_DECL(afsp), int flags, struct cred *cr);
-#else
-extern int afs_sync(OSI_VFS_DECL(afsp), short flags, struct cred *cr);
-#endif
extern int afs_vget(OSI_VFS_DECL(afsp), vnode_t ** vpp, struct fid *afidp);
#ifdef MP
struct vfsops afs_lockedvfsops =
struct vfsops Afs_vfsops =
#endif
{
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
BHV_IDENTITY_INIT_POSITION(VFS_POSITION_BASE),
-#else
- VFS_POSITION_BASE,
-#endif
-#endif
afs_mount,
-#ifdef AFS_SGI64_ENV
fs_nosys, /* rootinit */
fs_nosys, /* mntupdate */
fs_dounmount,
-#endif
afs_unmount,
afs_root,
afs_statfs,
afs_sync,
afs_vget,
fs_nosys, /* mountroot */
-#ifdef AFS_SGI65_ENV
fs_nosys, /* realvfsops */
fs_import, /* import */
fs_nosys, /* quotactl */
-#else
- fs_nosys, /* swapvp */
-#endif
};
extern struct afs_q VLRU; /*vcache LRU */
-#ifdef AFS_SGI64_ENV
static bhv_desc_t afs_vfs_bhv;
-#endif
afs_mount(struct vfs *afsp, vnode_t * mvp, struct mounta *uap,
-#ifdef AFS_SGI65_ENV
char *attrs,
-#endif
cred_t * cr)
{
AFS_STATCNT(afs_mount);
afsp->vfs_bsize = 8192;
afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
afsp->vfs_fsid.val[1] = afs_fstype;
-#ifdef AFS_SGI64_ENV
vfs_insertbhv(afsp, &afs_vfs_bhv, &Afs_vfsops, &afs_vfs_bhv);
-#else
- afsp->vfs_data = NULL;
-#endif
afsp->vfs_fstype = afs_fstype;
afsp->vfs_dev = 0xbabebabe; /* XXX this should be unique */
ReleaseWriteLock(&afs_xvcache);
afs_globalVFS = 0;
afs_shutdown(AFS_WARM);
-#ifdef AFS_SGI65_ENV
VFS_REMOVEBHV(afsp, &afs_vfs_bhv);
-#endif
return 0;
}
extern afs_int32 vcachegen;
#define PREEMPT_MASK 0x7f
-#ifdef AFS_SGI64_ENV
#define PREEMPT()
-#endif
int
afs_sync(OSI_VFS_DECL(afsp),
-#ifdef AFS_SGI65_ENV
int flags,
-#else
- short flags,
-#endif
struct cred *cr)
{
/* Why enable the vfs sync operation?? */
/*
* if not interested in vnodes, skip all this
*/
-#ifdef AFS_SGI61_ENV
if ((flags & (SYNC_CLOSE | SYNC_DELWRI | SYNC_PDFLUSH)) == 0)
goto end;
-#else /* AFS_SGI61_ENV */
- if ((flags & (SYNC_CLOSE | SYNC_DELWRI | SYNC_ATTR)) == 0)
- goto end;
-#endif /* AFS_SGI61_ENV */
loop:
ObtainReadLock(&afs_xvcache);
for (tq = VLRU.prev; tq != &VLRU; tq = uq) {
continue;
}
}
-#ifdef AFS_SGI61_ENV
else if (flags & SYNC_PDFLUSH) {
if (!VN_GET_DPAGES(vp)) {
VN_UNLOCK(vp, s);
continue;
}
}
-#endif /* AFS_SGI61_ENV */
vp->v_count++;
VN_UNLOCK(vp, s);
* sleep for rwlock.
*/
if (afs_rwlock_nowait(vp, 1) == 0) {
-#ifdef AFS_SGI61_ENV
if (flags & (SYNC_BDFLUSH | SYNC_PDFLUSH))
-#else /* AFS_SGI61_ENV */
- if (flags & SYNC_BDFLUSH)
-#endif /* AFS_SGI61_ENV */
{
AFS_RELE(vp);
ObtainReadLock(&afs_xvcache);
if (flags & SYNC_CLOSE) {
PFLUSHINVALVP(vp, (off_t) 0, (off_t) tvc->f.m.Length);
}
-#ifdef AFS_SGI61_ENV
else if (flags & SYNC_PDFLUSH) {
if (VN_GET_DPAGES(vp)) {
pdflush(vp, B_ASYNC);
}
}
-#endif /* AFS_SGI61_ENV */
if ((flags & SYNC_DELWRI) && AFS_VN_DIRTY(vp)) {
-#ifdef AFS_SGI61_ENV
PFLUSHVP(vp, (off_t) tvc->f.m.Length,
(flags & SYNC_WAIT) ? 0 : B_ASYNC, error);
-#else /* AFS_SGI61_ENV */
- if (flags & SYNC_WAIT)
- /* push all and wait */
- PFLUSHVP(vp, (off_t) tvc->f.m.Length, (off_t) 0, error);
- else if (flags & SYNC_BDFLUSH) {
- /* push oldest */
- error = pdflush(vp, B_ASYNC);
- } else {
- /* push all but don't wait */
- PFLUSHVP(vp, (off_t) tvc->f.m.Length, (off_t) B_ASYNC, error);
- }
-#endif /* AFS_SGI61_ENV */
}
/*
afs_int32 code = 0;
afs_int32 ret;
-#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
+#if defined(CKPT) && !defined(_R5000_CVT_WAR)
afs_fid2_t *afid2;
#endif
*avcp = NULL;
-#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
+#if defined(CKPT) && !defined(_R5000_CVT_WAR)
afid2 = (afs_fid2_t *) fidp;
if (afid2->af_len == sizeof(afs_fid2_t) - sizeof(afid2->af_len)) {
/* It's a checkpoint restart fid. */
#ifdef MP /* locked versions of vfs operations. */
/* wrappers for vfs calls */
-#ifdef AFS_SGI64_ENV
#define AFS_MP_VFS_ARG(A) bhv_desc_t A
-#else
-#define AFS_MP_VFS_ARG(A) struct vfs A
-#endif
int
mp_afs_mount(struct vfs *a, struct vnode *b, struct mounta *c,
-#ifdef AFS_SGI65_ENV
char *d,
-#endif
struct cred *e)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvfsops.vfs_mount(a, b, c, d
-#ifdef AFS_SGI65_ENV
, e
-#endif
);
AFS_GUNLOCK();
return rv;
int
mp_afs_sync(AFS_MP_VFS_ARG(*a),
-#ifdef AFS_SGI65_ENV
int b,
-#else
- short b,
-#endif
struct cred *c)
{
int rv;
}
struct vfsops Afs_vfsops = {
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
BHV_IDENTITY_INIT_POSITION(VFS_POSITION_BASE),
-#else
- VFS_POSITION_BASE,
-#endif
-#endif
mp_afs_mount,
-#ifdef AFS_SGI64_ENV
fs_nosys, /* rootinit */
fs_nosys, /* mntupdate */
fs_dounmount,
-#endif
mp_afs_unmount,
mp_afs_root,
mp_afs_statvfs,
mp_afs_sync,
mp_afs_vget,
fs_nosys, /* mountroot */
-#ifdef AFS_SGI65_ENV
fs_nosys, /* realvfsops */
fs_import, /* import */
fs_nosys, /* quotactl */
-#else
- fs_nosys, /* swapvp */
-#endif
};
#endif /* MP */
osi_Assert(!AFS_VN_MAPPED(vp));
osi_Assert(!AFS_VN_DIRTY(&avc->v));
-#if defined(AFS_SGI65_ENV)
if (vp->v_filocks)
cleanlocks(vp, IGN_PID, 0);
mutex_destroy(&vp->v_filocksem);
-#else /* AFS_SGI65_ENV */
- if (vp->v_filocksem) {
- if (vp->v_filocks)
-#ifdef AFS_SGI64_ENV
- cleanlocks(vp, &curprocp->p_flid);
-#else
- cleanlocks(vp, IGN_PID, 0);
-#endif
- osi_Assert(vp->v_filocks == NULL);
- mutex_destroy(vp->v_filocksem);
- kmem_free(vp->v_filocksem, sizeof *vp->v_filocksem);
- vp->v_filocksem = NULL;
- }
-#endif /* AFS_SGI65_ENV */
if (avc->vrefCount)
osi_Panic("flushVcache: vm race");
-#ifdef AFS_SGI64_ENV
AFS_GUNLOCK();
vnode_pcache_reclaim(vp); /* this can sleep */
vnode_pcache_free(vp);
VOP_RECLAIM(vp, FSYNC_WAIT, code);
}
AFS_GLOCK();
-#ifdef AFS_SGI65_ENV
#ifdef VNODE_TRACING
ktrace_free(vp->v_trace);
#endif /* VNODE_TRACING */
vn_bhv_head_destroy(&(vp->v_bh));
destroy_bitlock(&vp->v_pcacheflag);
mutex_destroy(&vp->v_buf_lock);
-#else
- bhv_remove(VN_BHV_HEAD(vp), &(avc->vc_bhv_desc));
- bhv_head_destroy(&(vp->v_bh));
-#endif
vp->v_flag = 0; /* debug */
#if defined(DEBUG) && defined(VNODE_INIT_BITLOCK)
destroy_bitlock(&vp->v_flag);
#ifdef INTR_KTHREADS
AFS_VN_DESTROY_BUF_LOCK(vp);
#endif
-#endif /* AFS_SGI64_ENV */
return 0;
}
#include "afs/param.h"
-#ifdef AFS_SGI62_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
static void afs_strategy();
static int afs_xread(), afs_xwrite();
static int afs_xbmap(), afs_map(), afs_reclaim();
-#ifndef AFS_SGI65_ENV
-static int afs_addmap(), afs_delmap();
-#endif
extern int afs_open(), afs_close(), afs_ioctl(), afs_getattr(), afs_setattr();
extern int afs_access(), afs_lookup();
extern int afs_create(), afs_remove(), afs_link(), afs_rename();
extern int afs_symlink(), afs_readlink(), afs_fsync(), afs_fid(),
afs_frlock();
static int afs_seek(OSI_VC_DECL(a), off_t b, off_t * c);
-#ifdef AFS_SGI64_ENV
extern int afs_xinactive();
-#else
-extern void afs_xinactive();
-#endif
extern void afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b);
extern void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b);
static int afsrwvp(struct vcache *avc, struct uio *uio,
enum uio_rw rw, int ioflag,
-#ifdef AFS_SGI64_ENV
struct cred *cr, struct flid *flp);
-#else
- struct cred *cr);
-#endif
#ifdef MP
static void mp_afs_rwlock(OSI_VN_DECL(a), AFS_RWLOCK_T b);
static void mp_afs_rwunlock(OSI_VN_DECL(a), AFS_RWLOCK_T b);
struct vnodeops Afs_vnodeops =
#endif
{
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE),
-#else
- VNODE_POSITION_BASE,
-#endif
-#endif
afs_open,
afs_close,
afs_xread,
afs_xbmap,
afs_strategy,
afs_map,
-#ifdef AFS_SGI65_ENV
fs_noerr, /* addmap - devices only */
fs_noerr, /* delmap - devices only */
-#else
- afs_addmap,
- afs_delmap,
-#endif
fs_poll, /* poll */
fs_nosys, /* dump */
fs_pathconf,
fs_nosys, /* attr_set */
fs_nosys, /* attr_remove */
fs_nosys, /* attr_list */
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
fs_cover,
(vop_link_removed_t) fs_noval,
fs_vnode_change,
(vop_readbuf_t) fs_nosys,
fs_strgetmsg,
fs_strputmsg,
-#else
- fs_mount,
-#endif
-#endif
};
#ifndef MP
int
afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag,
off_t offset,
-#ifdef AFS_SGI65_ENV
vrwlock_t vrwlock,
-#endif
cred_t * cr)
{
int error;
OSI_VN_CONVERT(vp);
-#ifdef AFS_SGI65_ENV
struct flid flid;
int pid;
get_current_flid(&flid);
pid = flid.fl_pid;
-#endif
/*
* Since AFS doesn't support byte-wise locks (and simply
|| (lfp->l_len != MAXEND && lfp->l_len != 0)) {
AFS_RWLOCK(vp, VRWLOCK_WRITE);
AFS_GUNLOCK();
-#ifdef AFS_SGI65_ENV
error =
fs_frlock(OSI_VN_ARG(vp), cmd, lfp, flag, offset, vrwlock, cr);
-#else
- error = fs_frlock(vp, cmd, lfp, flag, offset, cr);
-#endif
AFS_GLOCK();
AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
if (error || cmd != F_GETLK)
AFS_GUNLOCK();
error = convoff(vp, lfp, 0, offset, SEEKLIMIT
-#ifdef AFS_SGI64_ENV
, OSI_GET_CURRENT_CRED()
-#endif /* AFS_SGI64_ENV */
);
AFS_GLOCK();
if (!error) {
-#ifdef AFS_SGI65_ENV
error = afs_lockctl(vp, lfp, cmd, cr, pid);
-#else
- error = afs_lockctl(vp, lfp, cmd, cr, OSI_GET_CURRENT_PID());
-#endif
}
return error;
}
* doing direct I/O on the read side....
*/
/* ARGSUSED */
-#ifdef AFS_SGI64_ENV
static int
afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr, flp)
struct flid *flp;
-#else
-static int
-afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr)
-#endif
OSI_VC_DECL(avc);
struct uio *uiop;
int ioflag;
if (avc->v.v_type != VREG)
return EISDIR;
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
if (!(ioflag & IO_ISLOCKED))
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_READ);
-#endif
code = afsrwvp(avc, uiop, UIO_READ, ioflag, cr, flp);
-#ifdef AFS_SGI65_ENV
if (!(ioflag & IO_ISLOCKED))
AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_READ);
-#endif
-#else
- code = afsrwvp(avc, uiop, UIO_READ, ioflag, cr);
-#endif
return code;
}
/* ARGSUSED */
-#ifdef AFS_SGI64_ENV
static int
afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr, flp)
struct flid *flp;
-#else
-static int
-afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr)
-#endif
OSI_VC_DECL(avc);
struct uio *uiop;
int ioflag;
if (ioflag & IO_APPEND)
uiop->uio_offset = avc->f.m.Length;
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
if (!(ioflag & IO_ISLOCKED))
AFS_RWLOCK(((vnode_t *) avc), VRWLOCK_WRITE);
-#endif
code = afsrwvp(avc, uiop, UIO_WRITE, ioflag, cr, flp);
-#ifdef AFS_SGI65_ENV
if (!(ioflag & IO_ISLOCKED))
AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE);
-#endif
-#else
- code = afsrwvp(avc, uiop, UIO_WRITE, ioflag, cr);
-#endif
return code;
}
static int
afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw,
int ioflag,
-#ifdef AFS_SGI64_ENV
struct cred *cr, struct flid *flp)
-#else
- struct cred *cr)
-#endif
{
struct vnode *vp = AFSTOV(avc);
struct buf *bp;
bmv[0].pboff = off;
bmv[0].pbsize = MIN(cnt, uio->uio_resid);
bmv[0].eof = 0;
-#ifdef AFS_SGI64_ENV
bmv[0].pbdev = vp->v_rdev;
bmv[0].pmp = uio->uio_pmp;
-#endif
osi_Assert(cnt > 0);
/*
* initiate read-ahead if it looks like
*/
if ((avc->lastr + BTOBB(AFSBSIZE) == bn
|| uio->uio_resid > AFSBSIZE)
-#ifdef AFS_SGI61_ENV
&& (!AFS_VN_MAPPED(vp))
-#else /* AFS_SGI61_ENV */
- && ((vp->v_flag & VWASMAP) == 0)
-#endif /* AFS_SGI61_ENV */
) {
rem -= cnt;
if (rem > 0) {
bmv[1].bsize = bsize;
bmv[1].pboff = 0;
bmv[1].pbsize = acnt;
-#ifdef AFS_SGI64_ENV
bmv[1].pmp = uio->uio_pmp;
bmv[1].pbdev = vp->v_rdev;
-#endif
}
}
#ifdef DEBUG
bmv[0].bsize = bsize;
bmv[0].pboff = off;
bmv[0].pbsize = cnt;
-#ifdef AFS_SGI64_ENV
bmv[0].pmp = uio->uio_pmp;
-#endif
if (cnt == bsize)
bp = getchunk(vp, bmv, cr);
}
if (!error) {
-#ifdef AFS_SGI61_ENV
if (((ioflag & IO_SYNC) || (ioflag & IO_DSYNC)) && (rw == UIO_WRITE)
&& !AFS_NFSXLATORREQ(cr)) {
error = afs_fsync(avc, 0, cr
-#ifdef AFS_SGI65_ENV
, 0, 0
-#endif
);
}
-#else /* AFS_SGI61_ENV */
- if ((ioflag & IO_SYNC) && (rw == UIO_WRITE) && !AFS_NFSXLATORREQ(cr)) {
- error = afs_fsync(avc, 0, cr);
- }
-#endif /* AFS_SGI61_ENV */
}
if (didFakeOpen) {
ObtainWriteLock(&avc->lock, 236);
bsize = ctob(btoc(off + cnt));
bmv->pbsize = MIN(cnt, count);
bmv->eof = 0;
-#ifdef AFS_SGI64_ENV
bmv->pmp = NULL;
bmv->pbdev = avc->v.v_rdev;
-#endif
bmv->bsize = bsize;
bmv->length = BTOBBT(bsize);
*nbmv = 1;
uio->uio_offset = BBTOB(bp->b_blkno);
uio->uio_segflg = UIO_SYSSPACE;
uio->uio_limit = RLIM_INFINITY; /* we checked the limit earlier */
-#ifdef AFS_SGI64_ENV
uio->uio_pmp = NULL;
-#endif
if (bp->b_flags & B_READ) {
uio->uio_fmode = FREAD;
return *noffp < 0 ? EINVAL : 0;
}
-#if !defined(AFS_SGI65_ENV)
-/* Irix 6.5 uses addmap/delmap only for devices. */
-/* ARGSUSED */
-static int
-afs_addmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, flags, cr)
- off_t off;
-OSI_VC_DECL(avc);
- struct pregion *prp;
- addr_t addr;
- size_t len;
- u_int prot, maxprot;
- u_int flags;
- struct cred *cr;
-{
- OSI_VC_CONVERT(avc);
- struct vnode *vp = AFSTOV(avc);
-
- if (vp->v_flag & VNOMAP)
- return ENOSYS;
- if (len == 0)
- return 0;
- AFS_RWLOCK(vp, VRWLOCK_WRITE);
- if (avc->mapcnt == 0) {
- /* on first mapping add a open reference */
- ObtainWriteLock(&avc->lock, 237);
- avc->execsOrWriters++;
- avc->opens++;
- ReleaseWriteLock(&avc->lock);
- }
- avc->mapcnt += btoc(len);
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
- return 0;
-}
-
- /*ARGSUSED*/ static int
-afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, flags, acred)
- off_t off;
-OSI_VC_DECL(avc);
- struct pregion *prp;
- addr_t addr;
- size_t len;
- u_int prot, maxprot;
- u_int flags;
- struct cred *acred;
-{
- OSI_VC_CONVERT(avc);
- struct vnode *vp = AFSTOV(avc);
- struct brequest *tb;
- struct vrequest treq;
- afs_int32 code;
-
- if (vp->v_flag & VNOMAP)
- return ENOSYS;
- if (len == 0)
- return 0;
- AFS_RWLOCK(vp, VRWLOCK_WRITE);
- osi_Assert(avc->mapcnt > 0);
- avc->mapcnt -= btoc(len);
- osi_Assert(avc->mapcnt >= 0);
- if (avc->mapcnt == 0) {
- /* on last mapping push back and remove our reference */
- osi_Assert(avc->execsOrWriters > 0);
- osi_Assert(avc->opens > 0);
- if (avc->f.m.LinkCount == 0) {
- ObtainWriteLock(&avc->lock, 238);
- AFS_GUNLOCK();
- PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG);
- AFS_GLOCK();
- ReleaseWriteLock(&avc->lock);
- }
- /*
- * mimic afs_close
- */
- code = afs_InitReq(&treq, acred);
- if (code) {
- code = afs_CheckCode(code, NULL, 64);
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
- } else if (afs_BBusy()) {
- /* do it yourself if daemons are all busy */
- ObtainWriteLock(&avc->lock, 239);
- code = afs_StoreOnLastReference(avc, &treq);
- ReleaseWriteLock(&avc->lock);
- /* BStore does CheckCode so we should also */
- /* VNOVNODE is "acceptable" error code from close, since
- * may happen when deleting a file on another machine while
- * it is open here. */
- if (code == VNOVNODE)
- code = 0;
- if (code) {
- afs_StoreWarn(code, avc->f.fid.Fid.Volume, /* /dev/console */
- 1);
- }
- code = afs_CheckCode(code, &treq, 52);
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
- } else {
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
- /* at least one daemon is idle, so ask it to do the store.
- * Also, note that we don't lock it any more... */
- tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred,
- (afs_size_t) afs_cr_uid(acred), 0L, (void *)0,
- (void *)0, (void *)0);
- /* sleep waiting for the store to start, then retrieve error code */
- while ((tb->flags & BUVALID) == 0) {
- tb->flags |= BUWAIT;
- afs_osi_Sleep(tb);
- }
- afs_BRelease(tb);
- }
- } else {
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
- }
- return 0;
-}
-#endif /* ! AFS_SGI65_ENV */
-
-
/* ARGSUSED */
/*
* Note - if mapping in an ELF interpreter, one can get called without vp
* ever having been 'opened'
*/
-#ifdef AFS_SGI65_ENV
static int
afs_map(OSI_VC_ARG(avc), off, len, prot, flags, cr, vpp)
off_t off;
u_int flags;
struct cred *cr;
vnode_t **vpp;
-#else
-static int
-afs_map(OSI_VC_ARG(avc), off, prp, addrp, len, prot, maxprot, flags, cr)
- off_t off;
-OSI_VC_DECL(avc);
- struct pregion *prp;
- addr_t *addrp;
- size_t len;
- u_int prot, maxprot;
- u_int flags;
- struct cred *cr;
-#endif
{
OSI_VC_CONVERT(avc);
struct vnode *vp = AFSTOV(avc);
return afs_CheckCode(error, &treq, 53);
osi_FlushPages(avc, cr); /* ensure old pages are gone */
-#ifdef AFS_SGI65_ENV
/* If the vnode is currently opened for write, there's the potential
* that this mapping might (now or in the future) have PROT_WRITE.
* So assume it does and we'll have to call afs_StoreOnLastReference.
}
ReleaseWriteLock(&avc->lock);
AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
-#else
- AFS_RWLOCK(vp, VRWLOCK_WRITE);
- AFS_GUNLOCK();
- error =
- fs_map_subr(vp, (off_t) avc->f.m.Length, (u_int) avc->f.m.Mode, off, prp,
- *addrp, len, prot, maxprot, flags, cr);
- AFS_GLOCK();
- AFS_RWUNLOCK(vp, VRWLOCK_WRITE);
-#endif /* AFS_SGI65_ENV */
afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vp,
-#ifdef AFS_SGI65_ENV
ICL_TYPE_POINTER, NULL,
-#else
- ICL_TYPE_POINTER, *addrp,
-#endif
ICL_TYPE_INT32, len, ICL_TYPE_INT32, off);
return error;
}
extern afs_rwlock_t afs_xvcache;
extern afs_lock_t afs_xdcache;
-#ifdef AFS_SGI64_ENV
int
-#else
-void
-#endif
afs_xinactive(OSI_VC_ARG(avc), acred)
OSI_VC_DECL(avc);
struct ucred *acred;
/* inactive was already done, or someone did a VN_HOLD; just return */
vp->v_flag &= ~VINACT;
VN_UNLOCK(vp, s);
-#ifdef AFS_SGI64_ENV
return VN_INACTIVE_CACHE;
-#else
- return;
-#endif
}
osi_Assert((vp->v_flag & VSHARE) == 0);
vp->v_flag &= ~VINACT;
*/
VN_UNLOCK(vp, s);
-#ifdef AFS_SGI65_ENV
/* In Irix 6.5, the last unmap of a dirty mmap'd file does not
* get an explicit vnode op. Instead we only find out at VOP_INACTIVE.
*/
}
}
}
-#endif
osi_Assert((avc->f.states & (CCore | CMAPPED)) == 0);
PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG);
AFS_GLOCK();
}
-#ifndef AFS_SGI65_ENV
- osi_Assert(avc->mapcnt == 0);
- afs_chkpgoob(&avc->v, btoc(avc->f.m.Length));
-
- avc->f.states &= ~CDirty; /* Give up on store-backs */
- if (avc->f.states & CUnlinked) {
- if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) {
- avc->f.states |= CUnlinkedDel;
- } else {
- afs_remunlink(avc, 1); /* ignore any return code */
- }
- }
-#endif
-#ifdef AFS_SGI64_ENV
return VN_INACTIVE_CACHE;
-#endif
}
static int
afs_reclaim(OSI_VC_DECL(avc), int flag)
{
-#ifdef AFS_SGI64_ENV
/* Get's called via VOP_RELCAIM in afs_FlushVCache to clear repl_vnodeops */
return 0;
-#else
- panic("afs_reclaim");
-#endif
}
void
return 0;
}
-#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
+#if defined(CKPT) && !defined(_R5000_CVT_WAR)
int
afs_fid2(OSI_VC_DECL(avc), struct fid *fidp)
{
return EINVAL;
#endif
}
-#endif /* AFS_SGI64_ENV && CKPT */
+#endif /* CKPT */
/*
#ifdef MP
-#ifdef AFS_SGI64_ENV
#define AFS_MP_VC_ARG(A) bhv_desc_t A
-#else
-#define AFS_MP_VC_ARG(A) vnode_t A
-#endif
-#ifdef AFS_SGI64_ENV
int
mp_afs_open(bhv_desc_t * bhp, vnode_t ** a, mode_t b, struct cred *c)
-#else
-int
-mp_afs_open(vnode_t ** a, mode_t b, struct cred *c)
-#endif
{
int rv;
AFS_GLOCK();
-#ifdef AFS_SGI64_ENV
rv = afs_lockedvnodeops.vop_open(bhp, a, b, c);
-#else
- rv = afs_lockedvnodeops.vop_open(a, b, c);
-#endif
AFS_GUNLOCK();
return rv;
}
-#if defined(AFS_SGI64_ENV)
-#if defined(AFS_SGI65_ENV)
int
mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, struct cred *d)
-#else
-int
-mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, off_t d, struct cred *e,
- struct flid *f)
-#endif
-#else
-int
-mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, off_t d, struct cred *e)
-#endif
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_close(a, b, c, d
-#if !defined(AFS_SGI65_ENV)
- , e
-#if defined(AFS_SGI64_ENV)
- , f
-#endif
-#endif
);
AFS_GUNLOCK();
return rv;
}
-#ifdef AFS_SGI64_ENV
int
mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d,
struct flid *f)
-#else
-int
-mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d)
-#endif
{
int rv;
AFS_GLOCK();
-#ifdef AFS_SGI64_ENV
rv = afs_lockedvnodeops.vop_read(a, b, c, d, f);
-#else
- rv = afs_lockedvnodeops.vop_read(a, b, c, d);
-#endif
AFS_GUNLOCK();
return rv;
}
-#ifdef AFS_SGI64_ENV
int
mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d,
struct flid *f)
-#else
-int
-mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d)
-#endif
{
int rv;
AFS_GLOCK();
-#ifdef AFS_SGI64_ENV
rv = afs_lockedvnodeops.vop_write(a, b, c, d, f);
-#else
- rv = afs_lockedvnodeops.vop_write(a, b, c, d);
-#endif
AFS_GUNLOCK();
return rv;
}
int
mp_afs_ioctl(AFS_MP_VC_ARG(*a), int b, void *c, int d, struct cred *e, int *f
-#ifdef AFS_SGI65_ENV
, struct vopbd *vbds
-#endif
)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_ioctl(a, b, c, d, e, f
-#ifdef AFS_SGI65_ENV
, vbds
-#endif
);
AFS_GUNLOCK();
return rv;
int
mp_afs_access(AFS_MP_VC_ARG(*a), int b,
-#ifndef AFS_SGI65_ENV
- int c,
-#endif
struct cred *d)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_access(a, b,
-#ifndef AFS_SGI65_ENV
- c,
-#endif
d);
AFS_GUNLOCK();
return rv;
return rv;
}
-#ifdef AFS_SGI64_ENV
int
mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, int d, int e,
vnode_t ** f, struct cred *g)
-#else
-int
-mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, enum vcexcl d,
- int e, vnode_t ** f, struct cred *g)
-#endif
{
int rv;
AFS_GLOCK();
int
mp_afs_fsync(AFS_MP_VC_ARG(*a), int b, struct cred *c
-#ifdef AFS_SGI65_ENV
, off_t start, off_t stop
-#endif
)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_fsync(a, b, c
-#ifdef AFS_SGI65_ENV
, start, stop
-#endif
);
AFS_GUNLOCK();
return rv;
int
mp_afs_frlock(AFS_MP_VC_ARG(*a), int b, struct flock *c, int d, off_t e,
-#ifdef AFS_SGI65_ENV
vrwlock_t vrwlock,
-#endif
struct cred *f)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_frlock(a, b, c, d, e,
-#ifdef AFS_SGI65_ENV
vrwlock,
-#endif
f);
AFS_GUNLOCK();
return rv;
return;
}
-#ifdef AFS_SGI65_ENV
int
mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, size_t c, mprot_t d, u_int e,
struct cred *f, vnode_t ** g)
-#else
-int
-mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, char **d, size_t e,
- u_int f, u_int g, u_int h, struct cred *i)
-#endif
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_map(a, b, c, d, e, f, g
-#ifndef AFS_SGI65_ENV
- , h, i
-#endif
);
AFS_GUNLOCK();
return rv;
}
-#ifndef AFS_SGI65_ENV
-/* As of Irix 6.5, addmap and delmap are only for devices */
-int
-mp_afs_addmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d,
- size_t e, u_int f, u_int g, u_int h, struct cred *i)
-{
- int rv;
- AFS_GLOCK();
- rv = afs_lockedvnodeops.vop_addmap(a, b, c, d, e, f, g, h, i);
- AFS_GUNLOCK();
- return rv;
-}
-
-int
-mp_afs_delmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d,
- size_t e, u_int f, u_int g, u_int h, struct cred *i)
-{
- int rv;
- AFS_GLOCK();
- rv = afs_lockedvnodeops.vop_delmap(a, b, c, d, e, f, g, h, i);
- AFS_GUNLOCK();
- return rv;
-}
-#endif /* ! AFS_SGI65_ENV */
-
int
mp_fs_poll(AFS_MP_VC_ARG(*a), short b, int c, short *d, struct pollhead **e
-#ifdef AFS_SGI65_ENV
, unsigned int *f
-#endif
)
{
int rv;
AFS_GLOCK();
rv = afs_lockedvnodeops.vop_poll(a, b, c, d, e
-#ifdef AFS_SGI65_ENV
, f
-#endif
);
AFS_GUNLOCK();
return rv;
struct vnodeops Afs_vnodeops = {
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE),
-#else
- VNODE_POSITION_BASE,
-#endif
-#endif
mp_afs_open,
mp_afs_close,
mp_afs_read,
mp_afs_bmap,
mp_afs_strategy,
mp_afs_map,
-#ifdef AFS_SGI65_ENV
fs_noerr, /* addmap - devices only */
fs_noerr, /* delmap - devices only */
-#else
- mp_afs_addmap,
- mp_afs_delmap,
-#endif
mp_fs_poll, /* poll */
fs_nosys, /* dump */
fs_pathconf,
fs_nosys, /* attr_set */
fs_nosys, /* attr_remove */
fs_nosys, /* attr_list */
-#ifdef AFS_SGI64_ENV
-#ifdef AFS_SGI65_ENV
fs_cover,
(vop_link_removed_t) fs_noval,
fs_vnode_change,
(vop_readbuf_t) fs_nosys,
fs_strgetmsg,
fs_strputmsg,
-#else
- fs_mount,
-#endif
-#endif
};
struct vnodeops *afs_ops = &Afs_vnodeops;
#endif /* MP */
}
return vattr.va_size;
}
-#endif /* AFS_SGI62_ENV */
}
-#if defined(AFS_SUN5_ENV) || (defined(AFS_SGI_ENV) && !defined(AFS_SGI65_ENV))
+#if defined(AFS_SUN5_ENV)
int
afs_access(OSI_VC_DECL(avc), afs_int32 amode, int flags,
afs_ucred_t *acred)
# else
vp = vp->v_vfsp->vfs_vnodecovered;
if (vp) { /* Ignore weird failures */
-# ifdef AFS_SGI62_ENV
+# ifdef AFS_SGI_ENV
attrs->va_nodeid = VnodeToIno(vp);
# else
struct inode *ip;
ip = (struct inode *)VTOI(vp);
if (ip) /* Ignore weird failures */
attrs->va_nodeid = ip->i_number;
-# endif /* AFS_SGI62_ENV */
+# endif /* AFS_SGI_ENV */
}
# endif /* AFS_DARWIN80_ENV */
}
* I think we can get away without it, but I'm not sure. Note that
* afs_setattr is called in here for truncation.
*/
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
int
afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, int flags,
int amode, struct vcache **avcp, afs_ucred_t *acred)
-#else /* AFS_SGI64_ENV */
+#else /* AFS_SGI_ENV */
int
afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
enum vcexcl aexcl, int amode, struct vcache **avcp,
afs_ucred_t *acred)
-#endif /* AFS_SGI64_ENV */
+#endif /* AFS_SGI_ENV */
{
afs_int32 origCBs, origZaps, finalZaps;
struct vrequest *treq = NULL;
afs_InitFakeStat(&fakestate);
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_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
* the reference count on it.
ReleaseSharedLock(&tdc->lock);
afs_PutDCache(tdc);
ReleaseWriteLock(&adp->lock);
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
if (flags & VEXCL) {
#else
if (aexcl != NONEXCL) {
ObtainWriteLock(&tvc->lock, 136);
tvc->f.states |= CCreating;
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
-#if defined(AFS_SGI64_ENV)
+#if defined(AFS_SGI_ENV)
code =
afs_setattr(VNODE_TO_FIRST_BHV((vnode_t *) tvc),
attrs, 0, acred);
-#else
+#elif defined(AFS_SUN5_ENV)
code = afs_setattr(tvc, attrs, 0, acred);
-#endif /* AFS_SGI64_ENV */
-#else /* SUN5 || SGI */
+#else
code = afs_setattr(tvc, attrs, acred);
-#endif /* SUN5 || SGI */
+#endif
ObtainWriteLock(&tvc->lock, 137);
tvc->f.states &= ~CCreating;
ReleaseWriteLock(&tvc->lock);
SHARED_LOCK, NULL));
if ((code == EEXIST || code == UAEEXIST) &&
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
!(flags & VEXCL)
-#else /* AFS_SGI64_ENV */
+#else /* AFS_SGI_ENV */
aexcl == NONEXCL
#endif
) {
ReleaseWriteLock(&adp->lock);
-#if defined(AFS_SGI64_ENV)
+#if defined(AFS_SGI_ENV)
code = afs_lookup(VNODE_TO_FIRST_BHV((vnode_t *) adp), aname, avcp,
NULL, 0, NULL, acred);
-#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
+#elif defined(AFS_SUN5_ENV)
code = afs_lookup(adp, aname, avcp, NULL, 0, NULL, acred);
#elif defined(UKERNEL)
code = afs_lookup(adp, aname, avcp, acred, 0);
if (avc->f.fid.Fid.Unique > 0xffffff)
afs_fid_uniqueoverflow++;
} else {
-#if defined(AFS_SUN5_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR == 64))
+#if defined(AFS_SUN5_64BIT_ENV) || (defined(AFS_SGI_ENV) && (_MIPS_SZPTR == 64))
addr[1] = (long)AFS_XLATOR_MAGIC << 48;
-#else /* defined(AFS_SGI61_ENV) && (_MIPS_SZPTR == 64) */
+#else /* defined(AFS_SGI_ENV) && (_MIPS_SZPTR == 64) */
addr[1] = AFS_XLATOR_MAGIC;
SizeOfSmallFid = sizeof(addr);
-#endif /* defined(AFS_SGI61_ENV) && (_MIPS_SZPTR == 64) */
+#endif /* defined(AFS_SGI_ENV) && (_MIPS_SZPTR == 64) */
addr[0] = (long)avc;
#ifndef AFS_AIX41_ENV
/* No post processing, so don't hold ref count. */
void
lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid)
{
-# if defined(AFS_SGI65_ENV)
flid_t flid;
get_current_flid(&flid);
-# else
- afs_proc_t *procp = OSI_GET_CURRENT_PROCP();
-# endif
if (slp) {
-# ifdef AFS_SGI65_ENV
slp->sysid = flid.fl_sysid;
-# else
- slp->sysid = OSI_GET_CURRENT_SYSID();
-# endif
slp->pid = clid;
} else {
-# ifdef AFS_SGI65_ENV
flock->l_sysid = flid.fl_sysid;
-# else
- flock->l_sysid = OSI_GET_CURRENT_SYSID();
-# endif
flock->l_pid = clid;
}
}
#if defined(AFS_SUN5_ENV)
proc_t *procp = ttoproc(curthread);
#else
-#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
-#ifdef AFS_SGI64_ENV
- afs_proc_t *procp = curprocp;
-#elif defined(UKERNEL)
+#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
+#if defined(UKERNEL)
afs_proc_t *procp = get_user_struct()->u_procp;
#else
afs_proc_t *procp = u.u_procp;
-#endif /* AFS_SGI64_ENV */
+#endif /* UKERNEL */
#endif
#endif
#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_HPUX_ENV)
(!onlymine && (flock1->l_pid == getppid()))
#else
-#if defined(AFS_SGI65_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
/* XXX check this. used to be *only* irix for some reason. */
(!onlymine && (flock1->l_pid == clid))
#else
* both called by the vn_open call.
*/
int
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags,
afs_ucred_t *acred)
#else
AFS_STATCNT(afs_open);
if ((code = afs_CreateReq(&treq, acred)))
return code;
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
/* avcpp can be, but is not necesarily, bhp's vnode. */
tvc = VTOAFS(BHV_TO_VNODE(bhv));
#else
afs_int32 d_off;
u_short d_reclen;
};
-#ifdef AFS_SGI62_ENV
#define AFS_DIRENT32BASESIZE IRIX5_DIRENTBASESIZE
#define AFS_DIRENT64BASESIZE DIRENT64BASESIZE
#else
-#define AFS_DIRENT32BASESIZE IRIX5_DIRENTBASESIZE
-#define AFS_DIRENT64BASESIZE DIRENTBASESIZE
-#endif /* AFS_SGI62_ENV */
-#else
struct min_direct { /* miniature direct structure */
/* If struct direct changes, this must too */
#if defined(AFS_DARWIN80_ENV)
#define DIRSIZ_LEN(len) \
((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3))
#else
-#if defined(AFS_SGI_ENV)
-#ifndef AFS_SGI53_ENV
-/* SGI 5.3 and later use 32/64 bit versions of directory size. */
-#define DIRSIZ_LEN(len) DIRENTSIZE(len)
-#endif
-#else /* AFS_SGI_ENV */
+#ifndef AFS_SGI_ENV
#define DIRSIZ_LEN(len) \
((sizeof (struct direct) - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3))
#endif /* AFS_SGI_ENV */
#endif
char bufofzeros[64]; /* gotta fill with something */
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
int
afs_readdir_move(struct DirEntry *de, struct vcache *vc, struct uio *auio,
int slen, ssize_t rlen, afs_size_t off)
struct dirent *direntp;
#endif
#endif /* AFS_SUN5_ENV */
-#ifndef AFS_SGI53_ENV
+#ifndef AFS_SGI_ENV
struct min_direct sdirEntry;
memset(&sdirEntry, 0, sizeof(sdirEntry));
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
AFS_STATCNT(afs_readdir_move);
}
#endif
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
{
afs_int32 use64BitDirent;
-#ifdef AFS_SGI61_ENV
-#ifdef AFS_SGI62_ENV
use64BitDirent =
ABI_IS(ABI_IRIX5_64, GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio));
-#else
- use64BitDirent =
- (auio->uio_segflg !=
- UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64 |
- ABI_IRIX5_N32,
- u.u_procp->p_abi));
-#endif
-#else /* AFS_SGI61_ENV */
- use64BitDirent =
- (auio->uio_segflg !=
- UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64,
- u.u_procp->p_abi));
-#endif /* AFS_SGI61_ENV */
if (use64BitDirent) {
struct min_dirent sdirEntry;
}
}
}
-#else /* AFS_SGI53_ENV */
+#else /* AFS_SGI_ENV */
#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
direntp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
direntp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
}
#endif
#endif /* AFS_SUN5_ENV */
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
return (code);
}
int o_slen = 0, n_slen = 0;
afs_int32 us;
struct afs_fakestat_state fakestate;
-#if defined(AFS_SGI53_ENV)
+#if defined(AFS_SGI_ENV)
afs_int32 use64BitDirent, dirsiz;
-#endif /* defined(AFS_SGI53_ENV) */
+#endif /* defined(AFS_SGI_ENV) */
#ifndef AFS_HPUX_ENV
OSI_VC_CONVERT(avc);
#else
memset(&oldEntry, 0, sizeof(struct DirBuffer));
memset(&nextEntry, 0, sizeof(struct DirBuffer));
-#if defined(AFS_SGI53_ENV)
-#ifdef AFS_SGI61_ENV
-#ifdef AFS_SGI62_ENV
+#if defined(AFS_SGI_ENV)
use64BitDirent =
ABI_IS(ABI_IRIX5_64, GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio));
-#else
- use64BitDirent =
- (auio->uio_segflg !=
- UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64 | ABI_IRIX5_N32,
- u.u_procp->p_abi));
-#endif /* AFS_SGI62_ENV */
-#else /* AFS_SGI61_ENV */
- use64BitDirent =
- (auio->uio_segflg !=
- UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64,
- u.u_procp->p_abi));
-#endif /* AFS_SGI61_ENV */
-#endif /* defined(AFS_SGI53_ENV) */
+#endif /* defined(AFS_SGI_ENV) */
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
/* Not really used by the callee so we ignore it for now */
#else
n_slen = strlen(nde->name);
#endif
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
dirsiz =
use64BitDirent ? DIRENTSIZE(n_slen) : IRIX5_DIRENTSIZE(n_slen);
if (dirsiz >= (AFS_UIO_RESID(auio) - len)) {
#else
if (DIRSIZ_LEN(n_slen) >= (AFS_UIO_RESID(auio) - len)) {
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
/* No can do no more now; ya know... at this time */
DRelease(&nextEntry, 0); /* can't use this one. */
if (len) {
code = afs_readdir_move(ode, avc, auio, o_slen, len, origOffset);
#endif /* AFS_HPUX_ENV */
}
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
len = use64BitDirent ? DIRENTSIZE(o_slen =
n_slen) : IRIX5_DIRENTSIZE(o_slen =
n_slen);
#else
len = DIRSIZ_LEN(o_slen = n_slen);
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
DRelease(&oldEntry, 0);
oldEntry = nextEntry;
/* handle any closing cleanup stuff */
int
-#if defined(AFS_SGI65_ENV)
+#if defined(AFS_SGI_ENV)
afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose,
afs_ucred_t *acred)
-#elif defined(AFS_SGI64_ENV)
-afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose,
- off_t offset, afs_ucred_t *acred, struct flid *flp)
-#elif defined(AFS_SGI_ENV)
-afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose
- off_t offset, afs_ucred_t *acred)
#elif defined(AFS_SUN5_ENV)
afs_close(OSI_VC_DECL(avc), afs_int32 aflags, int count, offset_t offset,
afs_ucred_t *acred)
afs_int32 code_checkcode = 0;
struct brequest *tb;
struct vrequest *treq = NULL;
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
struct flid flid;
#endif
struct afs_fakestat_state fakestat;
}
/* unlock any locks for pid - could be wrong for child .. */
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
-# ifdef AFS_SGI65_ENV
get_current_flid(&flid);
cleanlocks((vnode_t *) avc, flid.fl_pid, flid.fl_sysid);
HandleFlock(avc, LOCK_UN, treq, flid.fl_pid, 1 /*onlymine */ );
-# else
-# ifdef AFS_SGI64_ENV
- cleanlocks((vnode_t *) avc, flp);
-# else /* AFS_SGI64_ENV */
- cleanlocks((vnode_t *) avc, u.u_procp->p_epid, u.u_procp->p_sysid);
-# endif /* AFS_SGI64_ENV */
- HandleFlock(avc, LOCK_UN, treq, OSI_GET_CURRENT_PID(), 1 /*onlymine */ );
-# endif /* AFS_SGI65_ENV */
/* afs_chkpgoob will drop and re-acquire the global lock. */
afs_chkpgoob(&avc->v, btoc(avc->f.m.Length));
#elif defined(AFS_SUN5_ENV)
int
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred
-# ifdef AFS_SGI65_ENV
+# ifdef AFS_SGI_ENV
, off_t start, off_t stop
-# endif /* AFS_SGI65_ENV */
+# endif /* AFS_SGI_ENV */
)
#else /* !SUN5 && !SGI */
afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred)
#if defined(AFS_LINUX_ENV)
off_t next_seq_offset; /* Next sequential offset (used by prefetch/readahead) */
-#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI65_ENV)
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
off_t next_seq_blk_offset; /* accounted in blocks for Solaris & IRIX */
#endif
unsigned int readdir_pid; /* pid of the thread in readdir */
#if defined(AFS_SGI_ENV)
daddr_t lastr; /* for read-ahead */
-#ifdef AFS_SGI64_ENV
uint64_t vc_rwlockid; /* kthread owning rwlock */
-#else
- short vc_rwlockid; /* pid of process owning rwlock */
-#endif
short vc_locktrips; /* # of rwlock reacquisitions */
sema_t vc_rwlock; /* vop_rwlock for afs */
pgno_t mapcnt; /* # of pages mapped */
struct cred *cred; /* last writer's cred */
-#ifdef AFS_SGI64_ENV
struct bhv_desc vc_bhv_desc; /* vnode's behavior data. */
-#endif
#endif /* AFS_SGI_ENV */
#if defined(AFS_LINUX_ENV) || defined(AFS_FBSD_ENV)
afs_ucred_t *cred; /* last writer's cred */
#if defined(AFS_SGI_ENV)
#define AVCRWLOCK(avc) (valusema(&(avc)->vc_rwlock) <= 0)
-/* SGI vnode rwlock macros and flags. */
-#ifndef AFS_SGI62_ENV
-/* The following are defined here. SGI 6.2 declares them in vnode.h */
-#define VRWLOCK_READ 0
-#define VRWLOCK_WRITE 1
-#define VRWLOCK_WRITE_DIRECT 2
-#endif
-
-#ifdef AFS_SGI53_ENV
-#ifdef AFS_SGI62_ENV
#define AFS_RWLOCK_T vrwlock_t
-#else
-#define AFS_RWLOCK_T int
-#endif /* AFS_SGI62_ENV */
-#ifdef AFS_SGI64_ENV
#include <ksys/behavior.h>
#define AFS_RWLOCK(V,F) \
afs_rwlock(&VTOAFS(V)->vc_bhv_desc, (F));
#define AFS_RWUNLOCK(V,F) \
afs_rwunlock(&VTOAFS(V)->vc_bhv_desc, (F));
-#else
-#define AFS_RWLOCK(V,F) afs_rwlock((vnode_t *)(V), (F) )
-#define AFS_RWUNLOCK(V,F) afs_rwunlock((vnode_t *)(V), (F) )
-#endif
-#else /* AFS_SGI53_ENV */
-#define AFS_RWLOCK(V,F) afs_rwlock((V))
-#define AFS_RWUNLOCK(V,F) afs_rwunlock((V))
-#endif /* AFS_SGI53_ENV */
#endif /* AFS_SGI_ENV */
struct vcxstat {
typedef user_addr_t uparmtype; /* 64 bit */
#else
typedef char * uparmtype;
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
typedef afs_uint32 iparmtype;
#else
typedef long iparmtype;
#if defined(AFS_CACHE_VNODE_PATH)
typedef char *afs_ufs_dcache_id_t;
-#elif defined(AFS_SGI61_ENV) || defined(AFS_SUN5_64BIT_ENV)
+#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_64BIT_ENV)
/* Using ino64_t here so that user level debugging programs compile
* the size correctly.
*/
/* get a file's serial number from a vnode */
#ifndef afs_vnodeToInumber
-#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToInumber(V) VnodeToIno(V)
#else
#define afs_vnodeToInumber(V) (VTOI(V)->i_number)
-#endif /* AFS_SGI62_ENV */
+#endif /* AFS_SGI_ENV */
#endif
/* get a file's device number from a vnode */
#ifndef afs_vnodeToDev
-#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToDev(V) VnodeToDev(V)
#elif defined(UKERNEL)
#define afs_vnodeToDev(V) (VTOI(V) ? (VTOI(V)->i_dev) : (-1))
#include <netinet/in.h>
#endif
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN_ENV)
#if !defined(UKERNEL)
# if !defined(AFS_LINUX_ENV)
# include "net/if.h"
-# ifdef AFS_SGI62_ENV
+# ifdef AFS_SGI_ENV
# include "h/hashing.h"
# endif
# if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN_ENV)
#endif
{
afs_int32 code = 0;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
size_t bufferSize;
-#else /* AFS_SGI61_ENV */
+#else /* AFS_SGI_ENV */
u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
+#endif /* AFS_SGI_ENV */
#ifdef AFS_DARWIN100_ENV
/* AFSKPTR macro relies on this name format/mapping */
afs_uint32 parm = (afs_uint32)kparm;
get_vfs_context();
#endif
/* do it by inode */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
ainode = (ainode << 32) | (parm3 & 0xffffffff);
#endif
code = afs_InitCacheFile(NULL, ainode);
#endif
#include <netinet/in.h>
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
if (doAdjustSize || overWriteWholeChunk) {
#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
#ifdef AFS_SGI_ENV
-#ifdef AFS_SGI64_ENV
if (doAdjustSize)
adjustsize = NBPP;
-#else /* AFS_SGI64_ENV */
- if (doAdjustSize)
- adjustsize = 8192;
-#endif /* AFS_SGI64_ENV */
#else /* AFS_SGI_ENV */
if (doAdjustSize)
adjustsize = 4096;
#include <netinet/in.h>
#endif
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN_ENV)
#include "rx/rx_globals.h"
#if !defined(UKERNEL) && !defined(AFS_LINUX_ENV)
#include "net/if.h"
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN_ENV)
afs_int32 code;
struct afs_icl_log *logp;
struct afs_icl_set *setp;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
size_t temp;
-#else /* AFS_SGI61_ENV */
+#else /* AFS_SGI_ENV */
#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
afs_uint64 temp;
#else
afs_uint32 temp;
#endif
-#endif /* AFS_SGI61_ENV */
+#endif /* AFS_SGI_ENV */
char tname[65];
afs_int32 startCookie;
afs_int32 allocated;
# endif /* AFS_SUN5_ENV */
# if defined(AFS_SGI_ENV)
-# ifdef AFS_SGI65_ENV
VFS_STATVFS(filevp->v_vfsp, &st, NULL, code);
if (!code)
-# else
- if (!VFS_STATFS(filevp->v_vfsp, &st, NULL))
-# endif /* AFS_SGI65_ENV */
# elif defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV)
if (!VFS_STATVFS(filevp->v_vfsp, &st))
# elif defined(AFS_AIX41_ENV)
afs_lock_t afs_ftf; /* flush text lock */
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
lock_t afs_event_lock;
-#endif
-
-#ifdef AFS_SGI64_ENV
flid_t osi_flid;
#endif
kmutex_t afs_global_lock;
#endif
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
-long afs_global_owner;
-#endif
-
#if defined(AFS_DARWIN_ENV)
thread_t afs_global_owner;
#ifdef AFS_DARWIN80_ENV
#endif
afs_osicred_initialized = 1;
}
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
osi_flid.fl_pid = osi_flid.fl_sysid = 0;
#endif
* Is DEBUG only for turning the ASSERT() macro? If so, we should
* be able to eliminate DEBUG entirely.
*/
-#if !defined(AFS_SGI65_ENV) && !defined(AFS_NBSD_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_NBSD_ENV)
#ifndef DEBUG
#define DEBUG 1 /* Default is to enable debugging/logging */
#endif
int code = 0;
-#if defined(AFS_SGI53_ENV) && defined(MP)
+#if defined(AFS_SGI_ENV) && defined(MP)
/* This is our first chance to get the global lock. */
AFS_GLOCK();
-#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
+#endif /* defined(AFS_SGI_ENV) && defined(MP) */
AFS_STATCNT(afs_setpag);
setuerror(code);
#endif
-#if defined(AFS_SGI53_ENV) && defined(MP)
+#if defined(AFS_SGI_ENV) && defined(MP)
AFS_GUNLOCK();
-#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
+#endif /* defined(AFS_SGI_ENV) && defined(MP) */
return (code);
}
int code = 0;
-#if defined(AFS_SGI53_ENV) && defined(MP)
+#if defined(AFS_SGI_ENV) && defined(MP)
/* This is our first chance to get the global lock. */
AFS_GLOCK();
-#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
+#endif /* defined(AFS_SGI_ENV) && defined(MP) */
AFS_STATCNT(afs_setpag);
if (!getuerror())
setuerror(code);
#endif
-#if defined(AFS_SGI53_ENV) && defined(MP)
+#if defined(AFS_SGI_ENV) && defined(MP)
AFS_GUNLOCK();
-#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
+#endif /* defined(AFS_SGI_ENV) && defined(MP) */
return (code);
}
# endif
#elif defined(AFS_SGI_ENV)
-# if defined(AFS_SGI65_ENV)
afs_ioctl(OSI_VN_DECL(tvc), int cmd, void *arg, int flag, cred_t * cr,
rval_t * rvalp, struct vopbd * vbds)
-# else
-afs_ioctl(OSI_VN_DECL(tvc), int cmd, void *arg, int flag, cred_t * cr,
- rval_t * rvalp, struct vopbd * vbds)
-# endif
{
struct afs_ioctl data;
int error = 0;
AFS_GLOCK();
code = afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow);
AFS_GUNLOCK();
-# ifdef AFS_SGI64_ENV
return code;
-# else
- return u.u_error;
-# endif
}
#elif defined(AFS_FBSD_ENV)
{
char *tp;
afs_int32 code;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
size_t bufferSize;
#else
u_int bufferSize;
sizeof(struct cm_initparams));
}
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
/* They took crget() from us, so fake it. */
static cred_t *
crget(void)
*/
i = (*com) & 0xff;
if (!afs_osi_suser(credp)) {
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
- /* Since SGI's suser() returns explicit failure after the call.. */
- u.u_error = 0;
-#endif
/* check for acceptable opcodes for normal folks, which are, so far,
* get/set tokens, sysname, and unlog.
*/
extern int afs_syscall_iopen(dev_t, int, int, rval_t *, afs_ucred_t *);
extern int afs_syscall_iincdec(dev_t, int, int, int, rval_t *,
afs_ucred_t *);
-#elif defined(AFS_SGI65_ENV)
+#elif defined(AFS_SGI_ENV)
extern int afs_syscall_icreate(afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, rval_t *);
extern int afs_syscall_iopen(int, ino_t, int, rval_t *);
extern int afs_syscall_iincdec(int, int, int, int);
struct vrequest *areq);
extern int afs_AccessOK(struct vcache *avc, afs_int32 arights,
struct vrequest *areq, afs_int32 check_mode_bits);
-#if defined(AFS_SUN5_ENV) || (defined(AFS_SGI_ENV) && !defined(AFS_SGI65_ENV))
+#if defined(AFS_SUN5_ENV)
extern int afs_access(OSI_VC_DECL(avc), afs_int32 amode, int flags,
afs_ucred_t *acred);
#else
extern void afs_DestroyAttr(struct vattr *vattr);
/* VNOPS/afs_vnop_create.c */
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
int flags, int amode, struct vcache **avcp,
afs_ucred_t *acred);
-#else /* AFS_SGI64_ENV */
+#else /* AFS_SGI_ENV */
extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
enum vcexcl aexcl, int amode, struct vcache **avcp,
afs_ucred_t *acred);
-#endif /* AFS_SGI64_ENV */
+#endif /* AFS_SGI_ENV */
extern int afs_LocalHero(struct vcache *avc,
struct dcache *adc,
AFSFetchStatus * astat, int aincr);
#endif
/* VNOPS/afs_vnop_open.c */
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
extern int afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags,
afs_ucred_t *acred);
#else
struct vrequest *areq);
extern int afs_closex(struct file *afd);
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
lastclose_t lastclose, afs_ucred_t *acred);
-#elif defined(AFS_SGI64_ENV)
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
- lastclose_t lastclose, off_t offset,
- afs_ucred_t *acred, struct flid *flp);
-#elif defined(AFS_SGI_ENV)
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
- lastclose_t lastclose, off_t offset,
- afs_ucred_t *acred);
#elif defined(AFS_SUN5_ENV)
extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, int count,
offset_t offset, afs_ucred_t *acred);
afs_ucred_t *acred);
#endif
-#if defined(AFS_SGI65_ENV)
+#if defined(AFS_SGI_ENV)
extern int afs_fsync(OSI_VC_DECL(avc), int flags, afs_ucred_t *acred,
off_t start, off_t stop);
-#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
+#elif defined(AFS_SUN5_ENV)
extern int afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred);
#else
extern int afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred);
extern afs_int32 afs_uuid_create(afsUUID * uuid);
extern u_short afs_uuid_hash(afsUUID * uuid);
-#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV) || defined(UKERNEL)
+#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(UKERNEL)
#include "osi_prototypes.h"
#endif
dcList = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length));
-#if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI65_ENV)
+#if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI_ENV)
/* In the aix vm implementation we need to do the vm_writep even
* on the memcache case since that's we adjust the file's size
* and finish flushing partial vm pages.
} else if ((cacheDiskType != AFS_FCACHE_TYPE_MEM) ||
(sync & AFS_VMSYNC_INVAL) || (sync & AFS_VMSYNC) ||
(sync & AFS_LASTSTORE))
-#endif /* !AFS_AIX32_ENV && !AFS_SGI65_ENV */
+#endif /* !AFS_AIX32_ENV && !AFS_SGI_ENV */
{
/* If we're not diskless, reading a file may stress the VM
* system enough to cause a pageout, and this vnode would be
# endif
# include <netinet/in.h>
-# ifdef AFS_SGI62_ENV
+# ifdef AFS_SGI_ENV
# include "h/hashing.h"
# endif
# if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
# endif /* (DARWIN || OBSD47 || FBSD) && USEIFADDR */
#endif /* AFS_USERSPACE_IP_ADDR */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
static int
afsi_enum_set_rank(struct hashbucket *h, caddr_t mkey, caddr_t arg1,
caddr_t arg2)
afsi_SetServerIPRank((struct srvAddr *)arg1, (struct in_ifaddr *)h);
return 0; /* Never match, so we enumerate everyone */
}
-#endif /* AFS_SGI62_ENV */
+#endif /* AFS_SGI_ENV */
static int
afs_SetServerPrefs(struct srvAddr *const sa)
{
# else /* USEIFADDR */
sa->sa_iprank = LO;
-# ifdef AFS_SGI62_ENV
+# ifdef AFS_SGI_ENV
(void)hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL,
(caddr_t) sa, NULL);
# elif defined(AFS_DARWIN80_ENV)
#include "rx/rx_globals.h"
#if !defined(UKERNEL) && !defined(AFS_LINUX_ENV)
#include "net/if.h"
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN_ENV)
#endif
#include <netinet/in.h>
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
#endif
#include <netinet/in.h>
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
int afsvnumbers = 0;
#endif
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
char *makesname();
-#endif /* AFS_SGI64_ENV */
+#endif /* AFS_SGI_ENV */
/* Exported variables */
afs_rwlock_t afs_xvcdirty; /*Lock: discon vcache dirty list mgmt */
tvc->vc_rwlockid = OSI_NO_LOCKID;
initnsema(&tvc->vc_rwlock, 1,
makesname(name, "vrw", tvc->v.v_number));
-# ifndef AFS_SGI53_ENV
- initnsema(&tvc->v.v_sync, 0, makesname(name, "vsy", tvc->v.v_number));
-# endif
-# ifndef AFS_SGI62_ENV
- initnlock(&tvc->v.v_lock, makesname(name, "vlk", tvc->v.v_number));
-# endif /* AFS_SGI62_ENV */
}
#endif
QInit(&VLRU);
#endif
#include <netinet/in.h>
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
#endif
#include <netinet/in.h>
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
* up 2 bytes
*/
-#if defined(AFS_SUN5_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_SUN5_64BIT_ENV) || (defined(AFS_SGI_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL)
#define AFS_XLATOR_MAGIC 0x8765 /* XXX */
#else
#define AFS_XLATOR_MAGIC 0x87654321
# define MyPidxx (u.u_procp)
# define MyPidxx2Pid(x) (x ? (afs_int32)p_pid(x) : 0)
# endif
-#elif defined(AFS_SGI64_ENV)
-# if defined(AFS_SGI65_ENV)
+#elif defined(AFS_SGI_ENV)
typedef unsigned int afs_lock_tracker_t;
-# define MyPidxx proc_pid(curproc())
-# define MyPidxx2Pid(x) (x)
-# else
-typedef unsigned int afs_lock_tracker_t;
-# define MyPidxx current_pid()
-# define MyPidxx2Pid(x) (x)
-# endif
+# define MyPidxx proc_pid(curproc())
+# define MyPidxx2Pid(x) (x)
#elif defined(AFS_LINUX_ENV)
typedef struct task_struct * afs_lock_tracker_t;
# define MyPidxx (current)
# include "values.h"
# include "sys/sema.h"
# include "sys/cmn_err.h"
-# ifdef AFS_SGI64_ENV
-# include <ksys/behavior.h>
+# include <ksys/behavior.h>
/* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
* but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
* older headers like we want the old behavior, so we fake it. */
-# if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
-# define BHV_IS_BHVL(bhp) (0)
-# endif
-# endif /* AFS_SGI64_ENV */
+# if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
+# define BHV_IS_BHVL(bhp) (0)
+# endif
# include "fs/efs_inode.h"
# include "sys/kmem.h"
# include "sys/cred.h"
*
* Instead of using ASSERT(), we use our own osi_Assert().
*/
-# if defined(AFS_SGI65_ENV) && !defined(DEBUG)
+# if !defined(DEBUG)
# define DEBUG
# include "sys/debug.h"
# undef DEBUG
# include "h/dir.h"
# endif /* SGI || SUN || HPUX */
-# if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) && \
+# if !defined(AFS_SGI_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) && \
!defined(AFS_NBSD40_ENV)
# include "h/user.h"
-# endif /* AFS_SGI64_ENV */
+# endif /* AFS_SGI_ENV */
# define MACH_USER_API 1
# if defined(AFS_FBSD_ENV)
# include "h/bio.h"
#include <afs/afsutil.h>
#include <afs/sys_prototypes.h>
-#if defined(AFS_SGI62_ENV) && !defined(AFS_SGI65_ENV)
-#include <sym.h>
-#include <symconst.h>
-#endif
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
#include <sched.h>
#endif
static int rxmaxfrags = 0; /* Are we forcing a limit on frags? */
static int volume_ttl = 0; /* enable vldb cache timeout support */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#define AFSD_INO_T ino64_t
#else
#define AFSD_INO_T afs_uint32
char fullpn_FileToDelete[1024]; /*File to be deleted from cache */
char *fileToDelete; /*Ptr to last component of above */
DIR *cdirp; /*Ptr to cache directory structure */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
struct dirent64 *currp; /*Current directory entry */
#else
struct dirent *currp; /*Current directory entry */
sprintf(fullpn_FileToDelete, "%s/", directory);
fileToDelete = fullpn_FileToDelete + strlen(fullpn_FileToDelete);
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
for (currp = readdir64(cdirp); currp; currp = readdir64(cdirp))
#else
for (currp = readdir(cdirp); currp; currp = readdir(cdirp))
{
if (afsd_debug) {
printf("%s: Current directory entry:\n", rn);
-#if defined(AFS_SGI62_ENV) || defined(AFS_DARWIN90_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN90_ENV)
printf("\tinode=%" AFS_INT64_FMT ", reclen=%d, name='%s'\n", currp->d_ino,
currp->d_reclen, currp->d_name);
#elif defined(AFS_DFBSD_ENV) || defined(AFS_USR_DFBSD_ENV)
#ifdef AFS_SUN5_ENV
struct stat st;
#endif
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
struct sched_param sp;
#endif
}
/* fall through to setup-by-inode */
}
-#if defined(AFS_SGI62_ENV) || !(defined(AFS_LINUX_ENV) || defined(AFS_CACHE_VNODE_PATH))
+#if defined(AFS_SGI_ENV) || !(defined(AFS_LINUX_ENV) || defined(AFS_CACHE_VNODE_PATH))
afsd_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]);
#else
printf
params[3] = CAST_SYSCALL_PARAM((va_arg(ap, void *)));
break;
case AFSOP_CACHEINODE:
-#if defined AFS_SGI62_ENV
+#if defined AFS_SGI_ENV
{
afs_int64 tmp = va_arg(ap, afs_int64);
params[0] = CAST_SYSCALL_PARAM((afs_uint32)(tmp >> 32));
#define MOUNT_AFS AFS_MOUNT_STR
#endif /* MOUNT_AFS */
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
# include <sched.h>
# define SET_RTPRI(P) { \
struct sched_param sp; \
FILE *fout;
struct bnode *tb = tp->bnode;
-#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI51_ENV)
+#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
setsid();
#elif defined(AFS_DARWIN90_ENV)
setpgid(0, 0);
typedef struct Lock afs_lock_t;
#endif
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || (defined(AFS_DARWIN_ENV) && defined(__amd64__))
+#if (defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || (defined(AFS_DARWIN_ENV) && defined(__amd64__))
#define ICL_LONG 2
#else
#define ICL_LONG 1
#define AFS_ENV 1 /* NOBODY uses this.... */
#define CMUSTD_ENV 1 /* NOBODY uses this.... */
#define AFS_SGI_ENV 1
-#define AFS_SGI51_ENV 1 /* Dist from 5.0.1 */
-#define AFS_SGI52_ENV 1
-#define AFS_SGI53_ENV 1
-#define AFS_SGI61_ENV 1
-#define AFS_SGI62_ENV 1
-#define AFS_SGI63_ENV 1
-#define AFS_SGI64_ENV 1
#define AFS_SGI65_ENV 1
#define AFS_SGI_EXMAG 1 /* use magic fields in extents for AFS extra fields */
/* AFS_SGI_SHORTSTACK not required since we have a 16K stack. */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#define AFS_ENV 1
#define AFS_USR_SGI_ENV 1
-#define AFS_USR_SGI62_ENV 1
-#define AFS_USR_SGI63_ENV 1
-#define AFS_USR_SGI64_ENV 1
#define AFS_USR_SGI65_ENV 1
/*#define AFS_GLOBAL_SUNLOCK 1 *//* For global locking */
# if defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV) || defined(AFS_DARWIN80_ENV)
# include "afs/sysincludes.h"
# endif
-# if !defined(AFS_SGI64_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD48_ENV) && !defined(AFS_NBSD_ENV)
+# if !defined(AFS_SGI_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD48_ENV) && !defined(AFS_NBSD_ENV)
# include "h/user.h"
-# endif /* AFS_SGI64_ENV */
+# endif /* AFS_SGI_ENV */
# include "h/uio.h"
# if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_HPUX110_ENV)
# include "h/mbuf.h"
savecontext(Create_Process_Part2, &temp2->context,
stackptr + MINFRAME);
#else
-#if defined(AFS_SGI62_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#ifdef sys_x86_darwin_80
savecontext(Create_Process_Part2, &temp2->context, stackptr + stacksize - 16 - sizeof(void *)); /* 16 = 2 * jmp_buf_type */
#else /* !sys_x86_darwin_80 */
stackptr + stacksize - sizeof(void *));
#endif /* AFS_S390_LINUX_ENV */
#endif /* AFS_SPARC64_LINUX_ENV || AFS_SPARC_LINUX_ENV */
-#endif /* AFS_SGI62_ENV */
+#endif /* AFS_SGI_ENV */
#endif
/* End of gross hack */
#if defined(__hp9000s800)
savecontext(Dispatcher, &(temp->context),
&(LWPANCHOR.dsptchstack[MINFRAME]));
-#elif defined(AFS_SGI62_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
savecontext(Dispatcher, &(temp->context),
&(LWPANCHOR.
dsptchstack[(sizeof LWPANCHOR.dsptchstack) - 8]));
/*
* Magic stack pointer
*/
-#if defined(AFS_SGI64_ENV)
+#if defined(AFS_SGI_ENV)
# ifdef _BSD_COMPAT
# define LWP_SP 34
# else
* differs based on the ISA chosen. It is int for mips1 and mips2 and
* __uint64_t for mips3 and mips4
*/
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
typedef __uint64_t jmp_buf_type;
#endif
#ifndef _RX_KMUTEX_H_
#define _RX_KMUTEX_H_
-#ifdef AFS_SGI62_ENV
-
#ifdef MP
#define RX_ENABLE_LOCKS 1
#define MUTEX_DEFAULT 0
#endif
-#ifdef AFS_SGI62_ENV
#define MUTEX_INIT(m, nm, type , a) mutex_init(m, type, nm)
-#else
-#define MUTEX_INIT(a,b,c,d) mutex_init(a,b,c,d)
-#endif
#define MUTEX_DESTROY(a) mutex_destroy(a)
#define MUTEX_ASSERT(a)
#define CV_INIT(cv, a,b,c) cv_init(cv, a, b, c)
#define CV_SIGNAL(_cv) cv_signal(_cv)
#define CV_BROADCAST(_cv) cv_broadcast(_cv)
#define CV_DESTROY(_cv) cv_destroy(_cv)
-#ifdef AFS_SGI64_ENV
/* Add PLTWAIT for afsd's to wait so we don't rack up the load average. */
-#ifdef AFS_SGI65_ENV
#define AFSD_PRI() ((kt_basepri(curthreadp) == PTIME_SHARE) ? PZERO : (PZERO|PLTWAIT))
-#else
-#define AFSD_PRI() ((curprocp && curprocp->p_rss==0) ? (PZERO|PLTWAIT) : PZERO)
-#endif /* SGI65 */
#undef cv_wait
#define cv_wait(cv, mp) { \
sv_wait(cv, AFSD_PRI(), mp, 0); \
AFS_MUTEX_ENTER(mp); \
}
-#endif /* AFS_SGI64_ENV */
#ifdef RX_LOCKS_DB
#define MUTEX_ENTER(a) do { \
AFS_MUTEX_ENTER(a); \
#endif /* MP */
-#endif /* SGI62 */
-
#endif /* _RX_KMUTEX_H_ */
struct mbuf *maddr = NULL;
struct sockaddr_in *taddr;
struct iovec tmpvec[RX_MAXWVECS + 2];
-#ifdef AFS_SGI65_ENV
bhv_desc_t bhv;
BHV_PDATA(&bhv) = (void *)so;
-#endif
memset(&tuio, 0, sizeof(tuio));
memset(&tmpvec, 0, sizeof(tmpvec));
osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", nvecs);
}
memcpy(tmpvec, (char *)dvec, (RX_MAXWVECS + 1) * sizeof(struct iovec));
-#ifdef AFS_SGI65_ENV
code = soreceive(&bhv, &maddr, &tuio, NULL, NULL);
-#else
- code = soreceive(so, &maddr, &tuio, NULL, NULL);
-#endif
if (code) {
-#ifdef AFS_SGI65_ENV
/* Clear the error before using the socket again. I've tried being nice
* and blocking SIGKILL and SIGSTOP from the kernel, but they get
* delivered anyway. So, time to be crude and just clear the signals
ut_unlock(ut, s);
rxk_nSignalsCleared++;
}
-#endif
/* Clear the error before using the socket again. */
so->so_error = 0;
rxk_lastSocketError = code;
* RX input, fast timer and initialization routines.
*/
-#ifdef AFS_SGI64_ENV
static void
rxk_input(struct mbuf *am, struct ifnet *aif, struct ipsec *spec)
-#else
-static void
-rxk_input(struct mbuf *am, struct ifnet *aif)
-#endif
{
void (*tproc) ();
unsigned short *tsp;
#define _MP_NETLOCKS
#endif
-#ifdef AFS_SGI65_ENV
osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
osi_socket *asocket;
struct iovec *dvec;
m_freem(to);
return code;
}
-#else /* AFS_SGI65_ENV */
-
-int
-dummy_sblock(struct sockbuf *a, int b, struct socket *c, int *d, int e)
-{
- afs_warn
- ("sblock was called before it was installed. Install proper afsd.\n");
-}
-
-void
-dummy_sbunlock(struct sockbuf *a, int b, struct socket *c, int d)
-{
- afs_warn
- ("sbunlock was called before it was installed. Install proper afsd.\n");
-}
-
-int (*afs_sblockp) (struct sockbuf *, int, struct socket *, int *, int) =
- dummy_sblock;
-void (*afs_sbunlockp) (struct sockbuf *, int, struct socket *, int) =
- dummy_sbunlock;
-#define AFS_SBUNLOCK(SB, EV, SO, O) (*afs_sbunlockp)(SB, EV, SO, O)
-
-/* osi_NetSend - send asize bytes at adata from asocket to host at addr.
- *
- * Now, why do we allocate a new buffer when we could theoretically use the one
- * pointed to by adata? Because PRU_SEND returns after queueing the message,
- * not after sending it. If the sender changes the data after queueing it,
- * we'd see the already-queued data change. One attempt to fix this without
- * adding a copy would be to have this function wait until the datagram is
- * sent; however this doesn't work well. In particular, if a host is down, and
- * an ARP fails to that host, this packet will be queued until the ARP request
- * comes back, which could be hours later. We can't block in this routine that
- * long, since it prevents RPC timeouts from happening.
- */
-/* XXX In the brave new world, steal the data bufs out of the rx_packet iovec,
- * and just queue those. XXX
- */
-int
-osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
- struct socket *asocket;
- struct iovec *dvec;
- int nvec;
- afs_int32 asize;
- struct sockaddr_in *addr;
- int istack;
-{
- struct mbuf *tm, *um;
- afs_int32 code;
- int s;
- struct mbuf *top = 0;
- struct mbuf *m, **mp;
- int len;
- char *tdata;
- caddr_t tpa;
- int i, tl, rlen;
-
- NETSPL_DECL(s1)
- AFS_STATCNT(osi_NetSend);
-
- (*afs_sblockp) (&asocket->so_snd, NETEVENT_SODOWN, asocket, &s1, istack);
-
- s = splnet();
- mp = ⊤
- i = 0;
- tdata = dvec[i].iov_base;
- tl = dvec[i].iov_len;
- while (1) {
- if ((m = m_vget(M_DONTWAIT, MIN(asize, VCL_MAX), MT_DATA)) == NULL) {
- if (top)
- m_freem(top);
- splx(s);
- AFS_SBUNLOCK(&asocket->so_snd, NETEVENT_SODOWN, asocket, s1);
- return 1;
- }
- len = MIN(m->m_len, asize);
- m->m_len = 0;
- tpa = mtod(m, caddr_t);
- while (len) {
- rlen = MIN(len, tl);
- memcpy(tpa, tdata, rlen);
- asize -= rlen;
- len -= rlen;
- tpa += rlen;
- m->m_len += rlen;
- tdata += rlen;
- tl -= rlen;
- if (tl <= 0) {
- i++;
- if (i > nvec) {
- /* shouldn't come here! */
- asize = 0; /* so we make progress toward completion */
- break;
- }
- tdata = dvec[i].iov_base;
- tl = dvec[i].iov_len;
- }
- }
- *mp = m;
- mp = &m->m_next;
- if (asize <= 0)
- break;
- }
- tm = top;
-
- tm->m_act = NULL;
-
- /* setup mbuf corresponding to destination address */
- um = m_get(M_DONTWAIT, MT_SONAME);
- if (!um) {
- if (top)
- m_freem(top); /* free mbuf chain */
- /* if this were vfs40, we'd do sbunlock(asocket, &asocket->so_snd), but
- * we don't do the locking at all for vfs40 systems */
- splx(s);
- AFS_SBUNLOCK(&asocket->so_snd, NETEVENT_SODOWN, asocket, s1);
- return 1;
- }
- memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
- um->m_len = sizeof(*addr);
- /* note that udp_usrreq frees funny mbuf. We hold onto data, but mbuf
- * around it is gone. we free address ourselves. */
- code = (*asocket->so_proto->pr_usrreq) (asocket, PRU_SEND, tm, um, 0);
- splx(s);
- m_free(um);
- AFS_SBUNLOCK(&asocket->so_snd, NETEVENT_SODOWN, asocket, s1);
-
- return code;
-}
-#endif /* AFS_SGI65_ENV */
int rxk_initDone = 0;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_SGI62_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
# define ADDRSPERSITE 16
static afs_uint32 myNetAddrs[ADDRSPERSITE];
static int myNetMTUs[ADDRSPERSITE];
RX_NET_EPOCH_ENTER();
-# if !defined(AFS_SGI62_ENV)
+# if !defined(AFS_SGI_ENV)
if (numMyNetAddrs == 0)
(void)rxi_GetIFInfo();
# endif
}
#endif /* !AIX && !SUN && !NCR && !UKERNEL */
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_SGI62_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
/* Determine what the network interfaces are for this machine. */
# ifdef AFS_USERSPACE_IP_ADDR
}
# endif /* else DARWIN || XBSD */
# endif /* else AFS_USERSPACE_IP_ADDR */
-#endif /* !SUN5 && !SGI62 */
+#endif /* !SUN5 && !SGI */
/* rxk_NewSocket, rxk_FreeSocket and osi_NetSend are from the now defunct
struct file *fp;
extern struct fileops socketops;
# endif
-# ifdef AFS_SGI65_ENV
+# ifdef AFS_SGI_ENV
bhv_desc_t bhv;
# endif
# else /* AFS_HPUX110_ENV */
code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0, SS_NOWAIT);
# endif /* else AFS_HPUX110_ENV */
-# elif defined(AFS_SGI65_ENV) || defined(AFS_OBSD_ENV)
+# elif defined(AFS_SGI_ENV) || defined(AFS_OBSD_ENV)
code = socreate(AF_INET, &newSocket, SOCK_DGRAM, IPPROTO_UDP);
# elif defined(AFS_FBSD_ENV)
code = socreate(AF_INET, &newSocket, SOCK_DGRAM, IPPROTO_UDP,
}
nam->m_len = sizeof(myaddr);
memcpy(mtod(nam, caddr_t), &myaddr, sizeof(myaddr));
-# if defined(AFS_SGI65_ENV)
+# if defined(AFS_SGI_ENV)
BHV_PDATA(&bhv) = (void *)newSocket;
code = sobind(&bhv, nam);
m_freem(nam);
if (code) {
dpf(("sobind fails (%d)\n", (int)code));
soclose(newSocket);
-# ifndef AFS_SGI65_ENV
+# ifndef AFS_SGI_ENV
m_freem(nam);
# endif
goto bad;
#endif
#endif /* !defined(AFS_SUN5_ENV) && !defined(AFS_XBSD_ENV) */
#endif /* !defined(AFS_LINUX_ENV) && !defined(AFS_OBSD_ENV) */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#include "h/hashing.h"
#endif
#ifdef AFS_FBSD_ENV
#include "netinet/ip_icmp.h"
#endif /* AFS_LINUX_ENV */
#include "netinet/udp.h"
-#if !defined(AFS_SGI62_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_LINUX_ENV) && !defined(AFS_DARWIN_ENV)
#include "netinet/udp_var.h"
#endif
-#if defined(AFS_HPUX102_ENV) || (defined(AFS_SGI62_ENV) && !defined(AFS_SGI64_ENV))
+#if defined(AFS_HPUX102_ENV)
#include "h/user.h"
#endif
#ifdef AFS_LINUX_ENV
* RX_LOCKS_DB versions of MUTEX_{ENTER, EXIT, TRYENTER} and CV_*WAIT to
* rx_kmutex.h and define lock macros below.
*/
-#if (defined(AFS_AIX41_ENV) || (defined(AFS_SGI53_ENV) && defined(MP))) && defined(KERNEL)
+#if (defined(AFS_AIX41_ENV) || (defined(AFS_SGI_ENV) && defined(MP))) && defined(KERNEL)
#ifdef AFS_AIX41_ENV
Simple_lock rxdb_lock;
#define RXDB_LOCK_ENTER() simple_lock(&rxdb_lock)
#define RXDB_LOCK_EXIT() simple_unlock(&rxdb_lock)
#else /* AFS_AIX41_ENV */
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
afs_kmutex_t rxdb_lock;
#define RXDB_LOCK_INIT() mutex_init(&rxdb_lock, "rxdb lock", 0, 0)
#define RXDB_LOCK_ENTER() AFS_MUTEX_ENTER(&rxdb_lock)
#define RXDB_LOCK_EXIT() mutex_exit(&rxdb_lock)
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
#endif /* AFS_AIX41_ENV */
RXDB_LOCK_EXIT();
}
-#endif /* (AIX41 || SGI53) && KERNEL */
+#endif /* (AIX41 || SGI) && KERNEL */
#endif /* RX_LOCKS_DB */
#else /* AFS_NAMEI_ENV */
#ifdef AFS_64BIT_IOPS_ENV
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
typedef uint64_t Inode;
#else
#include <sys/types.h>
typedef afs_uint64 Inode;
-#endif /* AFS_SGI62_ENV */
+#endif /* AFS_SGI_ENV */
#else /* AFS_64BIT_IOPS_ENV */
typedef unsigned int Inode;
#endif
{
int inode;
struct stat status;
-#ifdef AFS_SGI61_ENV
+#ifdef AFS_SGI_ENV
int vnode, unique, datav;
-#else /* AFS_SGI61_ENV */
+#else /* AFS_SGI_ENV */
afs_int32 vnode, unique, datav;
-#endif /* AFS_SGI61_ENV */
+#endif /* AFS_SGI_ENV */
if (stat("/vicepa", &status) == -1) {
perror("stat");
#if ICL_LONG == 2
int afs_64bit_kernel = 1; /* Default for 6.2+, and always for 6.1 */
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
/* If _SC_KERN_POINTERS not in sysconf, then we can assume a 32 bit abi. */
void
}
}
-#endif /* AFS_SGI62_ENV */
+#endif /* AFS_SGI_ENV */
#endif /* ICL_LONG == 2 */
int afs_syscall(long call, long parm0, long parm1, long parm2, long parm3,
* alp points at the first word in the array to be interpreted
* rsize gives the # of words in the array
*/
-#if defined(AFS_SGI61_ENV) && !defined(AFS_SGI62_ENV)
-#define uint64_t long long
-#endif
static void
DisplayRecord(FILE *outFilep, afs_int32 *alp, afs_int32 rsize)
{
return 1;
}
}
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
startTime = time((time_t *) 0);
#else
startTime = time(0);
main(int argc, char *argv[])
{
setlocale(LC_ALL, "");
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
set_kernel_sizeof_long();
#endif
#include <netdb.h>
#endif
-/* For AFS_SGI61_ENV and a 64 bit OS, _KMEMUSER should be defined on the
+/* For AFS_SGI_ENV and a 64 bit OS, _KMEMUSER should be defined on the
* compile line for kdump.o in the Makefile. This lets us pick up
* app32_ptr_t from types.h when included from afs/param.h.
*/
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
#define _KERNEL 1
#endif
struct vnode foo;
#endif
-#ifdef AFS_SGI53_ENV
+#ifdef AFS_SGI_ENV
#define _KERNEL 1
#include <sys/sema.h>
-#ifndef AFS_SGI62_ENV
-#undef _KERNEL 1
-#endif
-#endif
-
-#ifdef AFS_SGI62_ENV
#include <sys/fcntl.h>
#ifndef L_SET
#define L_SET 0
#include <sys/param.h>
-#ifndef AFS_SGI64_ENV
+#ifndef AFS_SGI_ENV
#include <sys/user.h>
#endif
typedef char *afs_kcondvar_t;
#endif /* AFS_HPUX110_ENV */
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
#define RX_ENABLE_LOCKS 1
typedef struct {
__psunsigned_t opaque1;
typedef struct {
__psunsigned_t opaque;
} afs_kcondvar_t;
-#endif /* AFS_SGI65_ENV */
+#endif /* AFS_SGI_ENV */
#ifdef AFS_LINUX_ENV
#include <asm/atomic.h>
#endif
-#ifdef AFS_SGI61_ENV
+#ifdef AFS_SGI_ENV
extern off64_t lseek64();
#define KDUMP_SIZE_T size_t
-#else /* AFS_SGI61_ENV */
+#else /* AFS_SGI_ENV */
#define KDUMP_SIZE_T int
-#endif /* AFS_SGI61_ENV */
+#endif /* AFS_SGI_ENV */
#include "afs/afs.h" /* XXXX Getting it from the obj tree XXX */
#include "afs/afs_axscache.h" /* XXXX Getting it from the obj tree XXX */
#define afs_nlist nlist64
#define AFSNLIST(N, C) nlist64((N), (C))
#else /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
-#ifdef AFS_SGI61_ENV
+#ifdef AFS_SGI_ENV
#ifdef AFS_32BIT_KERNEL_ENV
#define afs_nlist nlist
#define AFSNLIST(N, C) nlist((N), (C))
#define afs_nlist nlist64
#define AFSNLIST(N, C) nlist64((N), (C))
#endif /* AFS_32BIT_KERNEL_ENV */
-#else /* AFS_SGI61_ENV */
+#else /* AFS_SGI_ENV */
#ifdef AFS_LINUX_ENV
struct afs_nlist {
char *n_name;
#define afs_nlist nlist
#endif /* AFS_LINUX_ENV */
#define AFSNLIST(N, C) nlist((N), (C))
-#endif /* AFS_SGI61_ENV */
+#endif /* AFS_SGI_ENV */
#endif /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
char *obj = UNIX, *core = CORE;
#ifdef KDUMP_RX_LOCK
/* Test to see if kernel is using RX_ENABLE_LOCKS in rx structs. */
-#ifdef AFS_SGI53_ENV
-#ifdef AFS_SGI64_ENV
+#ifdef AFS_SGI_ENV
use_rx_lock = 1; /* Always using fine gain locking. */
-#else
- use_rx_lock = (sysmp(MP_NPROCS) > 1) ? 1 : 0;
-#endif
-#endif /* AFS_SGI53_ENV */
+#endif /* AFS_SGI_ENV */
#endif /* KDUMP_RX_LOCK */
if (Dcells || Dall) {
kread(kmem, table, buffers, count * sizeof(struct buffer));
bp = (struct buffer *)buffers;
for (i = 0, j = 0; i < count; i++, bp++) {
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
if (pnt)
printf
("Buffer #%d:\tfid=%llu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
#endif
#endif
#if ! defined(AFS_SUN5_ENV)
-#if defined(AFS_SGI61_ENV) && !defined(AFS_32BIT_KERNEL_ENV)
+#if defined(AFS_SGI_ENV) && !defined(AFS_32BIT_KERNEL_ENV)
if (lseek64(kmem, loc, L_SET /*0 */ ) != loc)
#else
if (lseek(kmem, loc, L_SET /*0 */ ) != loc)
#ifdef AFS_AIX_ENV
vep->v_gnode = save_gnode;
#endif /* AFS_AIX_ENV */
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
#if defined(AFS_32BIT_KERNEL_ENV)
printf("%lx: v_mreg=0x%lx", ptr, vep->v_mreg);
#else
printf("\tf.hvn=%d, f.hcn=%d, f.modtime=%d, f.versNo=%d\n",
dcp->f.hvNextp, dcp->f.hcNextp, dcp->f.modTime, dcp->f.versionNo);
#endif
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
printf
("\tf.chunk=%d, f.inode=%" AFS_INT64_FMT ", f.chunkBytes=%d, f.states=%x",
dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
kread(kmem, (off_t) addr, sysname, (KDUMP_SIZE_T) 30);
printf("\tafs_sysname = %s\n", sysname);
#endif
-#ifdef AFS_SGI65_ENV
+#ifdef AFS_SGI_ENV
findsym("afs_ipno", &symoff);
kread(kmem, symoff, (char *)&count, sizeof count);
printf("\tCPU BOARD = IP%d\n", count);
off_t symoff;
char sysname[100];
afs_int32 count;
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
ino64_t inode;
#endif
#ifndef AFS32
findsym("afs_freeDSList", &symoff);
kread(kmem, symoff, (char *)&count, sizeof count);
printf("\tfreeDSList= 0x%x XXXX\n", count);
-#ifdef AFS_SGI62_ENV
+#ifdef AFS_SGI_ENV
findsym("cacheInode", &symoff);
kread(kmem, symoff, (char *)&inode, sizeof inode);
printf("\tcacheInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
else if (stackSize > 44000)
stackSize = 44000;
#endif
-#if defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SGI51_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_XBSD_ENV)
rx_SetStackSize(1, stackSize);
#endif
if (udpBufSize)