/*
* osi_inode.h
*
- * Inode information required for DUX servers and salvager.
+ * Inode information required for FreeBSD servers and salvager.
*/
#ifndef _OSI_INODE_H_
#define _OSI_INODE_H_
/*
* osi_inode.h
*
- * Inode information required for DUX servers and salvager.
+ * Inode information required for NetBSD servers and salvager.
*/
#ifndef _OSI_INODE_H_
#define _OSI_INODE_H_
/*
*
- * DUX OSI header file. Extends afs_osi.h.
+ * NetBSD OSI header file. Extends afs_osi.h.
*
* afs_osi.h includes this file, which is the only way this file should
* be included in a source file. This file can redefine macros declared in
*/
/*
- * osi_vfsops.c for DUX
+ * osi_vfsops.c for NetBSD
*/
#include <afsconfig.h>
#include "afs/param.h"
#endif /* UKERNEL */
struct min_direct {
-#if defined(AFS_OFS_ENV) || defined(AFS_USR_OSF_ENV)
+#if defined(AFS_USR_OSF_ENV)
unsigned int d_fileno;
#else /* AFS_OFS_ENV || AFS_USR_OSF_ENV */
unsigned long d_fileno;
if (amode & VEXEC) {
code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS);
if (code) {
-#ifdef AFS_OSF_ENV
- /*
- * The nfs server in read operations for non-owner of a file
- * will also check the access with the VEXEC (along with VREAD)
- * because for them exec is the same as read over the net because of
- * demand loading. But this means if the mode bit is '-rw' the call
- * will fail below; so for this particular case where both modes are
- * specified (only in rfs_read so far) and from the xlator requests
- * we return succes.
- */
- if (!((amode & VREAD) && AFS_NFSXLATORREQ(acred)))
-#endif
if ((avc->f.m.Mode & 0100) == 0)
code = 0;
} else if (avc->f.m.Mode & 0100)
attrs->va_gid = fakedir ? 0 : avc->f.m.Group; /* yeah! */
#if defined(AFS_SUN56_ENV)
attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
-#elif defined(AFS_OSF_ENV)
- attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0];
#elif defined(AFS_DARWIN80_ENV)
VATTR_RETURN(attrs, va_fsid, vfs_statfs(vnode_mount(AFSTOV(avc)))->f_fsid.val[0]);
#elif defined(AFS_DARWIN70_ENV)
attrs->va_atime.tv_usec = attrs->va_mtime.tv_usec =
attrs->va_ctime.tv_usec = (hgetlo(avc->f.m.DataVersion) & 0x7ffff);
#endif
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
attrs->va_flags = 0;
#endif
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
* Below return 0 (and not 1) blocks if the file is zero length. This conforms
* better with the other filesystems that do return 0.
*/
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
attrs->va_bytes = (attrs->va_size ? (attrs->va_size + 1023) : 1024);
#ifdef va_bytes_rsv
attrs->va_bytes_rsv = -1;
if (attrs->va_mask & ATTR_SIZE) {
#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (attrs->va_mask & AT_SIZE) {
-#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_XBSD_ENV)
if (attrs->va_size != VNOVAL) {
#elif defined(AFS_AIX41_ENV)
if (attrs->va_size != -1) {
if (attrs->va_mask & ATTR_SIZE) {
#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (attrs->va_mask & AT_SIZE) {
-#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_XBSD_ENV)
if (attrs->va_size != VNOVAL) {
#elif defined(AFS_AIX41_ENV)
if (attrs->va_size != -1) {
afs_PutDCache(tdc);
}
ReleaseWriteLock(&adp->lock);
-#if !(defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV))
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
+
+
#if defined(AFS_SGI64_ENV)
code = afs_lookup(VNODE_TO_FIRST_BHV((vnode_t *) adp), aname, avcp,
NULL, 0, NULL, acred);
-#else
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
code = afs_lookup(adp, aname, avcp, NULL, 0, NULL, acred);
-#endif /* AFS_SGI64_ENV */
-#else /* SUN5 || SGI */
-#if defined(UKERNEL)
+#elif defined(UKERNEL)
code = afs_lookup(adp, aname, avcp, acred, 0);
-#else /* UKERNEL */
+#elif !defined(AFS_DARWIN_ENV)
code = afs_lookup(adp, aname, avcp, acred);
-#endif /* UKERNEL */
-#endif /* SUN5 || SGI */
-#endif /* !(AFS_OSF_ENV || AFS_DARWIN_ENV) */
+#endif
goto done;
}
/* return the new status in vattr */
afs_CopyOutAttrs(*avcp, attrs);
}
-#ifdef AFS_OSF_ENV
- if (!code && !strcmp(aname, "core"))
- tvc->f.states |= CCore1;
-#endif
afs_PutFakeStat(&fakestate);
code = afs_CheckCode(code, &treq, 20);
* Implements:
* afs_fid
*
- * afs_vptofh (DUX) is now in DUX/osi_vfsops.c
*/
#include <afsconfig.h>
#include "afs/param.h"
-#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV)
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
int
#ifdef AFS_AIX41_ENV
afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp)
-#elif defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV)
+#elif defined(AFS_SUN54_ENV)
afs_fid(OSI_VC_DECL(avc), struct fid *fidpp)
#else
afs_fid(OSI_VC_DECL(avc), struct fid **fidpp)
#endif
-#endif /* !AFS_DUX40_ENV && !AFS_LINUX20_ENV */
+#endif /* !AFS_LINUX20_ENV */
flock->l_pid = procp->p_epid;
# endif
}
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
void
lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid)
{
}
-#ifdef AFS_OSF_ENV
-int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
- afs_ucred_t * acred, pid_t clid, off_t offset)
-#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
afs_ucred_t * acred, pid_t clid)
#else
{
struct vrequest treq;
afs_int32 code;
-#ifdef AFS_OSF_ENV
- int acmd = 0;
-#endif
struct afs_fakestat_state fakestate;
AFS_STATCNT(afs_lockctl);
if (code) {
goto done;
}
-#ifdef AFS_OSF_ENV
- if (flag & VNOFLCK) {
- code = 0;
- goto done;
- }
- if (flag & CLNFLCK) {
- acmd = LOCK_UN;
- } else if ((flag & GETFLCK) || (flag & RGETFLCK)) {
- acmd = F_GETLK;
- } else if ((flag & SETFLCK) || (flag & RSETFLCK)) {
- acmd = F_SETLK;
- }
-#endif
#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
if ((acmd == F_GETLK) || (acmd == F_RGETLK)) {
#else
code = 0;
goto done;
}
-#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */
code = HandleGetLock(avc, af, &treq, clid);
-#endif
code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */
goto done;
} else if ((acmd == F_SETLK) || (acmd == F_SETLKW)
#endif
) && code != LOCK_UN)
code |= LOCK_NB; /* non-blocking, s.v.p. */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_DARWIN_ENV)
code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ );
#elif defined(AFS_SGI_ENV)
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
* 2. Asking for write lock, and only the current
* PID has the file read locked.
*/
-#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */
static int
HandleGetLock(register struct vcache *avc, register struct AFS_FLOCK *af,
register struct vrequest *areq, int clid)
return ((int)OutStatus.lockCount);
}
}
-#endif
-
-
-#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
-/* Flock not support on System V systems */
-#ifdef AFS_OSF_ENV
-extern struct fileops afs_fileops;
-
-int
-afs_xflock(afs_proc_t *p, void *args, int *retval)
-#else /* AFS_OSF_ENV */
-int
-afs_xflock(void)
-#endif
-{
- int code = 0;
- struct a {
- int fd;
- int com;
- } *uap;
- struct file *fd;
- struct vrequest treq;
- struct vcache *tvc;
- int flockDone;
- struct afs_fakestat_state fakestate;
- afs_InitFakeStat(&fakestate);
- AFS_STATCNT(afs_xflock);
- flockDone = 0;
-#ifdef AFS_OSF_ENV
- uap = (struct a *)args;
- getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state);
-#else /* AFS_OSF_ENV */
- uap = (struct a *)u.u_ap;
- fd = getf(uap->fd);
-#endif
- if (!fd) {
- afs_PutFakeStat(&fakestate);
- return;
- }
-
- if (flockDone = afs_InitReq(&treq, u.u_cred)) {
- afs_PutFakeStat(&fakestate);
- return flockDone;
- }
-
- AFS_DISCON_LOCK();
-
- /* first determine whether this is any sort of vnode */
- if (fd->f_type == DTYPE_VNODE) {
- /* good, this is a vnode; next see if it is an AFS vnode */
- tvc = VTOAFS(fd->f_data); /* valid, given a vnode */
- if (IsAfsVnode(AFSTOV(tvc))) {
- /* This is an AFS vnode, so do the work */
- code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
- if (code) {
- AFS_DISCON_UNLOCK();
- afs_PutFakeStat(&fakestate);
- return code;
- }
- if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) {
- /* First, if fd already has lock, release it for relock path */
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
- HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid,
- 0 /*!onlymine */ );
-#else
- HandleFlock(tvc, LOCK_UN, &treq, 0, 0 /*!onlymine */ );
-#endif
- fd->f_flag &= ~(FEXLOCK | FSHLOCK);
- }
- /* now try the requested operation */
-
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
- code =
- HandleFlock(tvc, uap->com, &treq, u.u_procp->p_pid,
- 0 /*!onlymine */ );
-#else
- code = HandleFlock(tvc, uap->com, &treq, 0, 0 /*!onlymine */ );
-#endif
-#ifndef AFS_OSF_ENV
- u.u_error = code;
-#endif
-
- if (uap->com & LOCK_UN) {
- /* gave up lock */
- fd->f_flag &= ~(FEXLOCK | FSHLOCK);
- } else {
-#ifdef AFS_OSF_ENV
- if (!code) {
-#else /* AFS_OSF_ENV */
- if (!u.u_error) {
-#endif
- if (uap->com & LOCK_SH)
- fd->f_flag |= FSHLOCK;
- else if (uap->com & LOCK_EX)
- fd->f_flag |= FEXLOCK;
- }
- }
- flockDone = 1;
- fd->f_ops = &afs_fileops;
- }
- }
-#ifdef AFS_OSF_ENV
- if (!flockDone)
- code = flock(p, args, retval);
-#ifdef AFS_OSF30_ENV
- FP_UNREF_ALWAYS(fd);
-#else
- FP_UNREF(fd);
-#endif
- AFS_DISCON_UNLOCK();
- afs_PutFakeStat(&fakestate);
- return code;
-#else /* AFS_OSF_ENV */
- if (!flockDone)
- flock();
- AFS_DISCON_UNLOCK();
- afs_PutFakeStat(&fakestate);
- return;
-#endif
-}
-#endif /* !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) */
#endif
int
-#ifdef AFS_OSF_ENV
-afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acred, int opflag, int wantparent)
-#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct pathname *pnp, int flags, struct vnode *rdir, afs_ucred_t *acred)
#elif defined(UKERNEL)
afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acred, int flags)
if ((code = afs_InitReq(&treq, acred)))
goto done;
-#ifdef AFS_OSF_ENV
- ndp->ni_dvp = AFSTOV(adp);
-#endif /* AFS_OSF_ENV */
-
if (afs_fakestat_enable && adp->mvstat == 1) {
if (strcmp(aname, ".directory") == 0)
tryEvalOnly = 1;
if (adp->mvstat == 2 && aname[0] == '.' && aname[1] == '.' && !aname[2]) {
/* looking up ".." in root via special hacks */
if (adp->mvid == (struct VenusFid *)0 || adp->mvid->Fid.Volume == 0) {
-#ifdef AFS_OSF_ENV
- if (adp == afs_globalVp) {
- struct vnode *rvp = AFSTOV(adp);
-/*
- ndp->ni_vp = rvp->v_vfsp->vfs_vnodecovered;
- ndp->ni_dvp = ndp->ni_vp;
- VN_HOLD(*avcp);
-*/
- code = ENODEV;
- goto done;
- }
-#endif
code = ENODEV;
goto done;
}
if (tname != aname && tname)
osi_FreeLargeSpace(tname);
if (code == 0) {
-#ifdef AFS_OSF_ENV
- /* Handle RENAME; only need to check rename "." */
- if (opflag == RENAME && wantparent && *ndp->ni_next == 0) {
- if (!FidCmp(&(tvc->f.fid), &(adp->f.fid))) {
- afs_PutVCache(*avcp);
- *avcp = NULL;
- afs_PutFakeStat(&fakestate);
- return afs_CheckCode(EISDIR, &treq, 18);
- }
- }
-#endif /* AFS_OSF_ENV */
if (afs_mariner)
afs_AddMarinerName(aname, tvc);
code);
AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_READ);
AFS_GLOCK();
-#elif defined(AFS_OSF_ENV)
- tuio.uio_rw = UIO_READ;
- AFS_GUNLOCK();
- VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp, code);
- AFS_GLOCK();
#elif defined(AFS_HPUX100_ENV)
AFS_GUNLOCK();
code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp);
* afs_readdir_move
* afs_bulkstat_send
* afs_readdir/afs_readdir2(HP)
- * afs_readdir1 - HP and DUX NFS versions
+ * afs_readdir1 - HP NFS version
*
*/
};
#endif /* AFS_SGI_ENV */
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_HPUX_ENV)
struct minnfs_direct {
afs_int32 d_off; /* XXX */
afs_uint32 d_fileno;
*/
int
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred,
int *eofp)
#else
#endif /* AFS_SGI61_ENV */
#endif /* defined(AFS_SGI53_ENV) */
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_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 */
if (eofp)
*eofp = 0;
} else {
/* nothin to hand over */
}
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
if (eofp)
*eofp = 1; /* Set it properly */
#endif
return code;
}
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
-#ifdef AFS_OSF_ENV
-int
-afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred,
- int *eofp)
-#else
+#if defined(AFS_HPUX_ENV)
int
afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred)
-#endif
{
struct vrequest treq;
register struct dcache *tdc;
struct DirEntry *ode = 0, *nde = 0;
int o_slen = 0, n_slen = 0;
afs_uint32 us;
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
/*
- * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling
- * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
+ * XXX All the hacks for alloced sdirEntry and inlining of
+ * afs_readdir_move instead of calling it is necessary for hpux due to
+ * stack problems that seem to occur when coming thru the nfs
* translator side XXX
*/
struct minnfs_direct *sdirEntry = (struct minnfs_direct *)
osi_AllocSmallSpace(sizeof(struct min_direct));
afs_int32 rlen;
-#endif
+
struct afs_fakestat_state fakestate;
AFS_STATCNT(afs_readdir);
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
- if (eofp)
- *eofp = 0;
-#endif
if (code = afs_InitReq(&treq, acred)) {
-#ifdef AFS_HPUX_ENV
osi_FreeSmallSpace((char *)sdirEntry);
-#endif
return code;
}
afs_InitFakeStat(&fakestate);
AFS_DISCON_LOCK();
code = afs_EvalFakeStat(&avc, &fakestate, &treq);
if (code) {
-#ifdef AFS_HPUX_ENV
osi_FreeSmallSpace((char *)sdirEntry);
-#endif
AFS_DISCON_UNLOCK();
afs_PutFakeStat(&fakestate);
return code;
}
len = 0;
-#ifdef AFS_HPUX_ENV
auio->uio_fpflags = 0;
-#endif
while (code == 0) {
origOffset = AFS_UIO_OFFSET(auio);
- /* scan for the next interesting entry scan for in-use blob otherwise up point at
- * this blob note that ode, if non-zero, also represents a held dir page */
+ /* scan for the next interesting entry scan for in-use blob
+ * otherwise up point at this blob note that ode, if non-zero,
+ * also represents a held dir page */
if (!(us = BlobScan(tdc, (origOffset >> 5)))
|| !(nde = (struct DirEntry *)afs_dir_GetBlob(tdc, us))) {
/* failed to setup nde, return what we've got, and release ode */
if (len) {
/* something to hand over. */
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
sdirEntry->d_fileno =
(avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
rlen -= minLen;
}
}
-#else
- code =
- afs_readdir_move(ode, avc, auio, o_slen,
- AFS_UIO_RESID(auio), origOffset);
-#endif /* AFS_HPUX_ENV */
AFS_UIO_SETRESID(auio, 0);
} else {
/* nothin to hand over */
}
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
- if (eofp)
- *eofp = 1;
-#endif
if (ode)
DRelease(ode, 0);
goto dirend;
/* by here nde is set */
/* Do we have enough user space to carry out our mission? */
-#if defined(AFS_SGI_ENV)
- n_slen = strlen(nde->name) + 1; /* NULL terminate */
-#else
n_slen = strlen(nde->name);
-#endif
if (NDIRSIZ_LEN(n_slen) >= (AFS_UIO_RESID(auio) - len)) {
/* No can do no more now; ya know... at this time */
DRelease(nde, 0); /* can't use this one. */
if (len) {
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
sdirEntry->d_fileno =
(avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
rlen -= minLen;
}
}
-#else
- code =
- afs_readdir_move(ode, avc, auio, o_slen,
- AFS_UIO_RESID(auio), origOffset);
-#endif /* AFS_HPUX_ENV */
/* this next line used to be AFSVFS40 or AIX 3.1, but is really generic */
AFS_UIO_SETOFFSET(auio, origOffset);
AFS_UIO_SETRESID(auio, 0);
* to set up for the next one.
*/
if (len) {
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
sdirEntry->d_fileno =
(avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode);
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
rlen -= minLen;
}
}
-#else
- code = afs_readdir_move(ode, avc, auio, o_slen, len, origOffset);
-#endif /* AFS_HPUX_ENV */
}
len = NDIRSIZ_LEN(o_slen = n_slen);
if (ode)
ReleaseReadLock(&avc->lock);
done:
-#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
osi_FreeSmallSpace((char *)sdirEntry);
-#endif
AFS_DISCON_UNLOCK();
afs_PutFakeStat(&fakestate);
code = afs_CheckCode(code, &treq, 29);
/*
* Implements:
- * afs_Wire (DUX)
* FetchWholeEnchilada
- * afs_IsWired (DUX)
* afsremove
* afs_remove
* afs_newname
extern afs_rwlock_t afs_xcbhash;
-#ifdef AFS_OSF_ENV
-/*
- * Wire down file in cache: prefetch all data, and turn on CWired flag
- * so that callbacks/callback expirations are (temporarily) ignored
- * and cache file(s) are kept in cache. File will be unwired when
- * afs_inactive is called (ie no one has VN_HOLD on vnode), or when
- * afs_IsWired notices that the file is no longer Active.
- */
-afs_Wire(avc, areq)
-#else /* AFS_OSF_ENV */
static void
FetchWholeEnchilada(register struct vcache *avc, struct vrequest *areq)
-#endif
{
register afs_int32 nextChunk;
register struct dcache *tdc;
return; /* don't know size */
for (nextChunk = 0; nextChunk < 1024; nextChunk++) { /* sanity check on N chunks */
pos = AFS_CHUNKTOBASE(nextChunk);
-#if defined(AFS_OSF_ENV)
- if (pos >= avc->f.m.Length)
- break; /* all done */
-#else /* AFS_OSF_ENV */
if (pos >= avc->f.m.Length)
return; /* all done */
-#endif
tdc = afs_GetDCache(avc, pos, areq, &offset, &len, 0);
if (!tdc)
-#if defined(AFS_OSF_ENV)
- break;
-#else /* AFS_OSF_ENV */
return;
-#endif
afs_PutDCache(tdc);
}
-#if defined(AFS_OSF_ENV)
- avc->f.states |= CWired;
-#endif /* AFS_OSF_ENV */
-}
-
-#if defined(AFS_OSF_ENV)
-/*
- * Tests whether file is wired down, after unwiring the file if it
- * is found to be inactive (ie not open and not being paged from).
- */
-afs_IsWired(register struct vcache *avc)
-{
- if (avc->f.states & CWired) {
- if (osi_Active(avc)) {
- return 1;
- }
- avc->f.states &= ~CWired;
- }
- return 0;
}
-#endif /* AFS_OSF_ENV */
int
afsremove(register struct vcache *adp, register struct dcache *tdc,
afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
-#ifdef AFS_OSF_ENV
- tvc = (struct vcache *)ndp->ni_vp; /* should never be null */
-#endif
if ((code = afs_InitReq(&treq, acred))) {
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
return code;
}
code = afs_EvalFakeStat(&adp, &fakestate, &treq);
if (code) {
afs_PutFakeStat(&fakestate);
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
return code;
}
if (afs_IsDynroot(adp)) {
code = afs_DynrootVOPRemove(adp, acred, aname);
afs_PutFakeStat(&fakestate);
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
return code;
}
if (afs_IsDynrootMount(adp)) {
if (strlen(aname) > AFSNAMEMAX) {
afs_PutFakeStat(&fakestate);
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
return ENAMETOOLONG;
}
tagain:
code = afs_VerifyVCache(adp, &treq);
-#ifdef AFS_OSF_ENV
- tvc = VTOAFS(ndp->ni_vp); /* should never be null */
- if (code) {
- afs_PutVCache(tvc);
- afs_PutFakeStat(&fakestate);
- return afs_CheckCode(code, &treq, 22);
- }
-#else /* AFS_OSF_ENV */
tvc = NULL;
if (code) {
code = afs_CheckCode(code, &treq, 23);
afs_PutFakeStat(&fakestate);
return code;
}
-#endif
/** If the volume is read-only, return error without making an RPC to the
* fileserver
*/
if (adp->f.states & CRO) {
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
code = EROFS;
afs_PutFakeStat(&fakestate);
return code;
/* If we're running disconnected without logging, go no further... */
if (AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW) {
-#ifdef AFS_OSF_ENV
- afs_PutVCache(tvc);
-#endif
code = ENETDOWN;
afs_PutFakeStat(&fakestate);
return code;
if (tdc)
ReleaseSharedLock(&tdc->lock);
ObtainWriteLock(&tvc->lock, 143);
-#if defined(AFS_OSF_ENV)
- afs_Wire(tvc, &treq);
-#else /* AFS_OSF_ENV */
FetchWholeEnchilada(tvc, &treq);
-#endif
ReleaseWriteLock(&tvc->lock);
ObtainWriteLock(&adp->lock, 144);
/* Technically I don't think we need this back, but let's hold it
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int afs_ustrategy(register struct buf *abp, afs_ucred_t *credp)
#else
int afs_ustrategy(register struct buf *abp)
struct iovec tiovec[1];
register struct vcache *tvc = VTOAFS(abp->b_vp);
register afs_int32 len = abp->b_bcount;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
#ifdef AFS_AIX41_ENV
struct ucred *credp;
-#else
+#elif !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
afs_ucred_t *credp = u.u_cred;
#endif
-#endif
AFS_STATCNT(afs_ustrategy);
#ifdef AFS_AIX41_ENV
*/
tuio.afsio_iov = tiovec;
tuio.afsio_iovcnt = 1;
-#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
-#ifdef AFS_64BIT_CLIENT
-#ifdef AFS_SUN5_ENV
+#if defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
+# ifdef AFS_64BIT_CLIENT
+# ifdef AFS_SUN5_ENV
tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno);
-#else
+# else
tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno);
-#endif
-#else /* AFS_64BIT_CLIENT */
+# endif
+# else /* AFS_64BIT_CLIENT */
tuio.afsio_offset = (u_int) dbtob(abp->b_blkno);
-#endif /* AFS_64BIT_CLIENT */
+# endif /* AFS_64BIT_CLIENT */
#else
tuio.afsio_offset = DEV_BSIZE * abp->b_blkno;
#endif
} else {
tuio.afsio_iov = tiovec;
tuio.afsio_iovcnt = 1;
-#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV)
+#if defined(AFS_SUN5_ENV)
#ifdef AFS_64BIT_CLIENT
#ifdef AFS_SUN5_ENV
tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno);
*/
len = MIN(len, tvc->f.m.Length - dbtob(abp->b_blkno));
#endif
-#ifdef AFS_OSF_ENV
- len =
- MIN(abp->b_bcount,
- (VTOAFS(abp->b_vp))->f.m.Length - dbtob(abp->b_blkno));
-#endif /* AFS_OSF_ENV */
tuio.afsio_resid = len;
#if defined(AFS_XBSD_ENV)
tiovec[0].iov_base = abp->b_saveaddr;
#endif
}
-#if defined(AFS_DUX40_ENV) || defined (AFS_XBSD_ENV)
+#if defined (AFS_XBSD_ENV)
if (code) {
abp->b_error = code;
#if !defined(AFS_FBSD50_ENV)
#if defined(AFS_AIX32_ENV)
crfree(credp);
-#elif defined(AFS_DUX40_ENV)
- biodone(abp);
- if (code && !(abp->b_flags & B_READ)) {
- /* prevent ubc from retrying writes */
- AFS_GUNLOCK();
- ubc_invalidate(AFSTOV(tvc)->v_object,
- (vm_offset_t) dbtob(abp->b_blkno), PAGE_SIZE, B_INVAL);
- AFS_GLOCK();
- }
#elif defined(AFS_FBSD60_ENV)
(*abp->b_iodone)(abp);
#elif defined(AFS_FBSD50_ENV)
* afs_MemWrite
* afs_StoreOnLastReference
* afs_close
- * afs_closex
* afs_fsync
*/
AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_WRITE);
avc->f.states &= ~CWritingUFS;
AFS_GLOCK();
-#elif defined(AFS_OSF_ENV)
- {
- struct ucred *tmpcred = u.u_cred;
- u.u_cred = afs_osi_credp;
- tuio.uio_rw = UIO_WRITE;
- AFS_GUNLOCK();
- VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp, code);
- AFS_GLOCK();
- u.u_cred = tmpcred;
- }
#elif defined(AFS_HPUX100_ENV)
{
AFS_GUNLOCK();
return code;
}
-#ifdef AFS_OSF_ENV
-#ifdef AFS_DUX50_ENV
-#define vno_close(X) vn_close((X), 0, NOCRED)
-#elif defined(AFS_DUX40_ENV)
-#define vno_close vn_close
-#endif
-/* We don't need this for AIX since:
- * (1) aix doesn't use fileops and it call close directly intead
- * (where the unlocking should be done) and
- * (2) temporarily, the aix lockf isn't supported yet.
- *
- * this stupid routine is used to release the flocks held on a
- * particular file descriptor. Sun doesn't pass file descr. info
- * through to the vnode layer, and yet we must unlock flocked files
- * on the *appropriate* (not first, as in System V) close call. Thus
- * this code.
- * How does this code get invoked? The afs AFS_FLOCK plugs in the new afs
- * file ops structure into any afs file when it gets flocked.
- * N.B: Intercepting close syscall doesn't trap aborts or exit system
- * calls.
-*/
-int
-afs_closex(register struct file *afd)
-{
- struct vrequest treq;
- struct vcache *tvc;
- afs_int32 flags;
- int closeDone;
- afs_int32 code = 0;
- struct afs_fakestat_state fakestat;
-
- AFS_STATCNT(afs_closex);
- /* setup the credentials */
- if ((code = afs_InitReq(&treq, u.u_cred)))
- return code;
- afs_InitFakeStat(&fakestat);
-
- closeDone = 0;
- /* we're the last one. If we're an AFS vnode, clear the flags,
- * close the file and release the lock when done. Otherwise, just
- * let the regular close code work. */
- if (afd->f_type == DTYPE_VNODE) {
- tvc = VTOAFS(afd->f_data);
- if (IsAfsVnode(AFSTOV(tvc))) {
- code = afs_EvalFakeStat(&tvc, &fakestat, &treq);
- if (code) {
- afs_PutFakeStat(&fakestat);
- return code;
- }
- VN_HOLD(AFSTOV(tvc));
- flags = afd->f_flag & (FSHLOCK | FEXLOCK);
- afd->f_flag &= ~(FSHLOCK | FEXLOCK);
- code = vno_close(afd);
- if (flags)
- HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid,
- 1 /*onlymine */ );
- AFS_RELE(AFSTOV(tvc));
- closeDone = 1;
- }
- }
- /* now, if close not done, do it */
- if (!closeDone) {
- code = vno_close(afd);
- }
- afs_PutFakeStat(&fakestat);
- return code; /* return code from vnode layer */
-}
-#endif
-
-
/* handle any closing cleanup stuff */
int
#if defined(AFS_SGI65_ENV)
}
/* unlock any locks for pid - could be wrong for child .. */
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
-#ifdef AFS_SGI65_ENV
+# 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
+# else
+# ifdef AFS_SGI64_ENV
cleanlocks((vnode_t *) avc, flp);
-#else /* AFS_SGI64_ENV */
+# else /* AFS_SGI64_ENV */
cleanlocks((vnode_t *) avc, u.u_procp->p_epid, u.u_procp->p_sysid);
-#endif /* AFS_SGI64_ENV */
+# endif /* AFS_SGI64_ENV */
HandleFlock(avc, LOCK_UN, &treq, OSI_GET_CURRENT_PID(), 1 /*onlymine */ );
-#endif /* AFS_SGI65_ENV */
+# 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)
+#elif defined(AFS_SUN5_ENV)
if (count > 1) {
- /* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
+ /* The vfs layer may call this repeatedly with higher "count"; only
+ * on the last close (i.e. count = 1) we should actually proceed
+ * with the close. */
afs_PutFakeStat(&fakestat);
AFS_DISCON_UNLOCK();
return 0;
}
-#else /* AFS_SGI_ENV */
- if (avc->flockCount) { /* Release Lock */
-#if defined(AFS_OSF_ENV)
- HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ );
#else
+ if (avc->flockCount) { /* Release Lock */
HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ );
-#endif
}
-#endif /* AFS_SGI_ENV */
+#endif
if (aflags & (FWRITE | FTRUNC)) {
if (afs_BBusy() || (AFS_NFSXLATORREQ(acred)) || AFS_IS_DISCONNECTED) {
/* do it yourself if daemons are all busy */
avc->opens--;
ReleaseWriteLock(&avc->lock);
}
-#ifdef AFS_OSF_ENV
- if ((VREFCOUNT(avc) <= 2) && (avc->f.states & CUnlinked)) {
- afs_remunlink(avc, 1); /* ignore any return code */
- }
-#endif
AFS_DISCON_UNLOCK();
afs_PutFakeStat(&fakestat);
code = afs_CheckCode(code, &treq, 5);
int
-#ifdef AFS_OSF_ENV
-afs_fsync(OSI_VC_DECL(avc), int fflags, afs_ucred_t *acred, int waitfor)
-#else /* AFS_OSF_ENV */
#if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV)
afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred
-#ifdef AFS_SGI65_ENV
+# ifdef AFS_SGI65_ENV
, off_t start, off_t stop
-#endif /* AFS_SGI65_ENV */
+# endif /* AFS_SGI65_ENV */
)
-#else /* !OSF && !SUN53 && !SGI */
+#else /* !SUN53 && !SGI */
afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred)
#endif
-#endif
{
register afs_int32 code;
struct vrequest treq;
#define CNSHARE 0x00000100 /* support O_NSHARE semantics */
#define CLied 0x00000200
#define CTruth 0x00000400
-#ifdef AFS_OSF_ENV
-#define CWired 0x00000800 /* OSF hack only */
-#else
-#ifdef AFS_DARWIN80_ENV
+
+#if defined(AFS_DARWIN80_ENV)
#define CDeadVnode 0x00000800
-#else
-#ifdef AFS_DARWIN_ENV
+#elif defined(AFS_DARWIN_ENV)
#define CUBCinit 0x00000800
#else
#define CWRITE_IGN 0x00000800 /* Next OS hack only */
#endif
-#endif
-#endif
+
#define CUnique 0x00001000 /* vc's uniquifier - latest unifiquier for fid */
#define CForeign 0x00002000 /* this is a non-afs vcache */
#define CReadDir 0x00004000 /* readdir in progress */
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToInumber(V) VnodeToIno(V)
#else
-#ifdef AFS_DECOSF_ENV
-#define afs_vnodeToInumber(V) osi_vnodeToInumber(V)
-#else
#define afs_vnodeToInumber(V) (VTOI(V)->i_number)
-#endif /* AFS_DECOSF_ENV */
#endif /* AFS_SGI62_ENV */
#endif
#ifndef afs_vnodeToDev
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToDev(V) VnodeToDev(V)
-#elif defined(AFS_DECOSF_ENV)
-#define afs_vnodeToDev(V) osi_vnodeToDev(V)
#else
#define afs_vnodeToDev(V) (VTOI(V)->i_dev)
#endif
#endif
-
-/* Note: this should agree with the definition in kdump.c */
-#if defined(AFS_OSF_ENV)
-#if !defined(UKERNEL)
-#define AFS_USEBUFFERS 1
-#endif
-#endif
-
#if !defined(UKERNEL) && !defined(HAVE_STRUCT_BUF)
/* declare something so that prototypes don't flip out */
/* appears struct buf stuff is only actually passed around as a pointer,
#endif
&& (parm != AFSOP_GETMTU) && (parm != AFSOP_GETMASK)) {
/* only root can run this code */
-#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(KERNEL_HAVE_UERROR)
+#if defined(AFS_SUN5_ENV) || defined(KERNEL_HAVE_UERROR)
#if defined(KERNEL_HAVE_UERROR)
setuerror(EACCES);
#endif
shutdown_osifile();
shutdown_vnodeops();
shutdown_memcache();
-#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
+#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV))
shutdown_exporter();
shutdown_nfsclnt();
#endif
a_result->lock.pid_last_reader = 0;
a_result->lock.pid_writer = 0;
a_result->lock.src_indicator = 0;
-#endif /* AFS_OSF20_ENV */
+#endif /* INSTRUMENT_LOCKS */
#ifdef AFS_64BIT_CLIENT
a_result->Length = (afs_int32) tvc->f.m.Length & 0xffffffff;
#else /* AFS_64BIT_CLIENT */
a_result->lock.pid_last_reader = 0;
a_result->lock.pid_writer = 0;
a_result->lock.src_indicator = 0;
-#endif /* AFS_OSF20_ENV */
+#endif /* INSTRUMENT_LOCKS */
#if !defined(AFS_64BIT_ENV)
a_result->Length.high = 0;
a_result->Length.low = tvc->f.m.Length;
goto loop1;
}
#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
VN_HOLD(AFSTOV(tvc));
#else
#ifdef AFS_DARWIN80_ENV
goto loop2;
}
#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
VN_HOLD(AFSTOV(tvc));
#else
#ifdef AFS_DARWIN80_ENV
*/
/* Sanity check on the callback queue. Allow for slop in the computation. */
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
#define CBQ_LIMIT (afs_maxvcount + 10)
#else
#define CBQ_LIMIT (afs_cacheStats + afs_stats_cmperf.vcacheXAllocs + 10)
#endif /* AFS_SGI_ENV */
if (AFS_CHUNKTOBASE(chunk) + adjustsize >= avc->f.m.Length &&
#else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SUN5_ENV)
if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->f.m.Length)) &&
#else
if (AFS_CHUNKTOBASE(chunk) >= avc->f.m.Length &&
struct afs_icl_set *afs_iclSetp = (struct afs_icl_set *)0;
struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0;
-#if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV)
+#if defined(AFS_SGI61_ENV)
/* For SGI 6.2, this can is changed to 1 if it's a 32 bit kernel. */
#if defined(AFS_SGI62_ENV) && defined(KERNEL) && !defined(_K64U64)
int afs_icl_sizeofLong = 1;
(lp)->logElements++; \
MACRO_END
-#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__)
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__)
#define ICL_APPENDLONG(lp, x) \
MACRO_BEGIN \
ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \
ICL_APPENDINT32((lp), (x) & 0xffffffffL); \
MACRO_END
-#else /* AFS_OSF_ENV */
+#else
#define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x))
-#endif /* AFS_OSF_ENV */
+#endif
/* routine to tell whether we're dealing with the address or the
* object itself
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[3]);
}
-#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t1 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p1);
-#endif /* AFS_OSF_ENV */
+#endif
else
ICL_APPENDLONG(logp, p1);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[3]);
}
-#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t2 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p2);
-#endif /* AFS_OSF_ENV */
+#endif
else
ICL_APPENDLONG(logp, p2);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[3]);
}
-#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t3 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p3);
-#endif /* AFS_OSF_ENV */
+#endif
else
ICL_APPENDLONG(logp, p3);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[3]);
}
-#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t4 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p4);
-#endif /* AFS_OSF_ENV */
+#endif
else
ICL_APPENDLONG(logp, p4);
}
/* Exported variables */
struct osi_dev cacheDev; /*Cache device */
afs_int32 cacheInfoModTime; /*Last time cache info modified */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
struct mount *afs_cacheVfsp = 0;
#elif defined(AFS_LINUX20_ENV)
struct super_block *afs_cacheSBp = 0;
struct k_statvfs st;
#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) ||defined(AFS_HPUX100_ENV)
struct statvfs st;
-#elif defined(AFS_DUX40_ENV)
- struct nstatfs st;
#elif defined(AFS_DARWIN80_ENV)
struct vfsstatfs st;
#else
#endif /* AFS_SGI65_ENV */
#elif defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV)
if (!VFS_STATVFS(filevp->v_vfsp, &st))
-#elif defined(AFS_OSF_ENV)
-
- VFS_STATFS(filevp->v_vfsp, code);
- /* struct copy */
- st = filevp->v_vfsp->m_stat;
- if (code == 0)
#elif defined(AFS_AIX41_ENV)
if (!VFS_STATFS(filevp->v_vfsp, &st, &afs_osi_cred))
#elif defined(AFS_LINUX20_ENV)
taddr.sin_port = htons(2106);
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
taddr.sin_len = sizeof(taddr);
-#endif /* AFS_OSF_ENV */
+#endif
tp = tp1 = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
strcpy(tp, "fetch$Fetching ");
tp += 15; /* change it if string changes */
taddr.sin_port = htons(2106);
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
taddr.sin_len = sizeof(taddr);
-#endif /* AFS_OSF_ENV */
+#endif
tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
strcpy(tp, astring);
#ifndef AFS_LINUX22_ENV
#include "rpc/types.h"
#endif
-#ifdef AFS_OSF_ENV
-#undef kmem_alloc
-#undef kmem_free
-#undef mem_alloc
-#undef mem_free
-#undef register
-#endif /* AFS_OSF_ENV */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
uid = (*cred)->cr_uid;
#endif
/* Do this early, so pag management knows */
-#ifdef AFS_OSF_ENV
- (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
-#else
(*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
-#endif
if ((afs_nfsexporter->exp_states & EXP_CLIPAGS) && pag != NOPAG) {
uid = pag;
} else if (pag != NOPAG) {
* that the translator rebooted and therefore we ignore all older
* pag values
*/
-#ifdef AFS_OSF_ENV
- if (code = setpag(u.u_procp, cred, -1, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */
-#else
if ((code = setpag(cred, -1, &pag, 0))) {
-#endif
if (au)
afs_PutUser(au, READ_LOCK);
/* ReleaseWriteLock(&afs_xnfsreq); */
np->client_uid = (*cred)->cr_uid;
} else {
if (pag == NOPAG) {
-#ifdef AFS_OSF_ENV
- if (code = setpag(u.u_procp, cred, np->pag, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */
-#else
if ((code = setpag(cred, np->pag, &pag, 0))) {
-#endif
afs_PutNfsClientPag(np);
/* ReleaseWriteLock(&afs_xnfsreq); */
#if defined(KERNEL_HAVE_UERROR)
tnp = (struct nfsclientpag *)au->exporter;
if (tnp->uid && (tnp->uid != (afs_int32) - 2)) { /* allow "root" initiators */
/* Pag doesn't belong to caller; treat it as an unpaged call too */
-#ifdef AFS_OSF_ENV
- if (code = setpag(u.u_procp, cred, np->pag, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */
-#else
if ((code = setpag(cred, np->pag, &pag, 0))) {
-#endif
afs_PutNfsClientPag(np);
afs_PutUser(au, READ_LOCK);
/* ReleaseWriteLock(&afs_xnfsreq); */
long afs_global_owner;
#endif
-#if defined(AFS_OSF_ENV)
-simple_lock_data_t afs_global_lock;
-#endif
-
#if defined(AFS_DARWIN_ENV)
#ifdef AFS_DARWIN80_ENV
lck_mtx_t *afs_global_lock;
struct mtx afs_global_mtx;
#endif
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_DARWIN_ENV)
thread_t afs_global_owner;
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_DARWIN_ENV */
#if defined(AFS_AIX41_ENV)
simple_lock_data afs_global_lock;
#if defined(AFS_GLOBAL_SUNLOCK)
#if defined(AFS_SGI62_ENV)
mutex_init(&afs_global_lock, MUTEX_DEFAULT, "afs_global_lock");
-#elif defined(AFS_OSF_ENV)
- usimple_lock_init(&afs_global_lock);
- afs_global_owner = (thread_t) 0;
#elif defined(AFS_FBSD50_ENV)
#if defined(AFS_FBSD80_ENV) && defined(WITNESS)
/* "lock_initalized" (sic) can panic, checks a flag bit
AFS_GLOCK(); \
} while(0)
#else
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
int haveGlock = ISAFS_GLOCK(); \
uio_setrw((UIO),(RW)); \
CODE = uiomove((SRC),(LEN),(UIO)); \
} while(0)
-#else /* AFS_OSF_ENV || AFS_FBSD_ENV */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
(UIO)->uio_rw = (RW); \
CODE = uiomove((SRC),(LEN),(UIO)); \
} while(0)
-#else /* AFS_OSF_ENV || AFS_FBSD_ENV */
+#else
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
CODE = uiomove((SRC),(LEN),(RW),(UIO)); \
} while(0)
-#endif /* AFS_OSF_ENV || AFS_FBSD_ENV */
-#endif /* AFS_DARWIN80_ENV */
+#endif
#endif /* AFS_GLOBAL_SUNLOCK */
}
#endif
-#if defined(AFS_OSF_ENV)
-
-#ifdef AFS_DUX50_ENV
-extern struct pid_entry *pidtab;
-extern int npid;
-#endif
-
-void
-afs_osi_TraverseProcTable(void)
-{
- struct pid_entry *pe;
-#ifdef AFS_DUX50_ENV
-#define pidNPID (pidtab + npid)
-#define PID_LOCK()
-#define PID_UNLOCK()
-#endif
- PID_LOCK();
- for (pe = pidtab; pe < pidNPID; ++pe) {
- if (pe->pe_proc != PROC_NULL)
- afs_GCPAGs_perproc_func(pe->pe_proc);
- }
- PID_UNLOCK();
-}
-#endif
-
#if (defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN80_ENV)) || defined(AFS_FBSD_ENV)
void
afs_osi_TraverseProcTable(void)
return pcred;
}
-#elif defined(AFS_OSF_ENV)
-const afs_ucred_t *
-afs_osi_proc2cred(afs_proc_t * pr)
-{
- afs_ucred_t *rv = NULL;
-
- if (pr == NULL) {
- return NULL;
- }
-
- if ((pr->p_stat == SSLEEP) || (pr->p_stat == SRUN)
- || (pr->p_stat == SSTOP))
- rv = pr->p_rcred;
-
- return rv;
-}
#elif defined(AFS_DARWIN80_ENV)
const afs_ucred_t *
afs_osi_proc2cred(afs_proc_t * pr)
int
#if defined(AFS_SUN5_ENV)
afs_setpag(afs_ucred_t **credpp)
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_setpag(afs_proc_t *p, void *args, int *retval)
#else
afs_setpag(void)
#if defined(AFS_SUN5_ENV)
code = AddPag(genpag(), credpp);
-#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_XBSD_ENV)
code = AddPag(p, genpag(), &p->p_rcred);
#elif defined(AFS_AIX41_ENV)
{
int
#if defined(AFS_SUN5_ENV)
afs_setpag_val(afs_ucred_t **credpp, int pagval)
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_setpag_val(afs_proc_t *p, void *args, int *retval, int pagval)
#else
afs_setpag_val(int pagval)
#if defined(AFS_SUN5_ENV)
code = AddPag(pagval, credpp);
-#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_XBSD_ENV)
code = AddPag(p, pagval, &p->p_rcred);
#elif defined(AFS_AIX41_ENV)
{
/* Note - needs to be available on AIX, others can be static - rework this */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
AddPag(afs_proc_t *p, afs_int32 aval, afs_ucred_t **credpp)
#else
afs_uint32 newpag;
AFS_STATCNT(AddPag);
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
if ((code = setpag(p, credpp, aval, &newpag, 0)))
#else
if ((code = setpag(credpp, aval, &newpag, 0)))
pag = NOPAG;
goto out;
}
-#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
#if defined(AFS_SUN510_ENV)
if (ngroups < 2) {
#else
#else
pag = (afs_int32) afs_get_pag_from_groups(g0, g1);
#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
out:
#endif
#if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT)
afs_int32 ret;
memcpy((char *)&Sfid, afidp->fid_data, SIZEOF_SMALLFID);
-#ifdef AFS_OSF_ENV
- Sfid.Vnode = afidp->fid_reserved;
-#endif
/* Need to extract fid from SmallFid. Will need a wild card option for
* finding the right vcache entry.
osi_Active(register struct vcache *avc)
{
AFS_STATCNT(osi_Active);
-#if defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
if ((avc->opens > 0) || (avc->f.states & CMAPPED))
return 1; /* XXX: Warning, verify this XXX */
#elif defined(AFS_SGI_ENV)
ma_critical_exit();
return 0;
}
-#ifdef AFS_OSF_ENV
- VN_HOLD((vnode_t *) tvc);
-#else
-#ifdef AFS_DARWIN80_ENV
+#if defined(AFS_DARWIN80_ENV)
tvp = AFSTOV(tvc);
if (vnode_get(tvp)) {
ReleaseReadLock(&afs_xvcache);
ma_critical_exit();
return 0;
}
-#else
-#ifdef AFS_FBSD50_ENV
+#elif defined(AFS_FBSD50_ENV)
/* can't sleep in a critical section */
ma_critical_exit();
osi_vnhold(tvc, 0);
ma_critical_enter();
#else
osi_vnhold(tvc, 0);
-#endif /* AFS_FBSD80_ENV */
-#endif
#endif
ReleaseReadLock(&afs_xvcache);
if (!tcell) return ESRCH;
if (set_parent_pag) {
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-#if defined(AFS_DARWIN_ENV)
+# if defined(AFS_DARWIN_ENV)
afs_proc_t *p = current_proc(); /* XXX */
-#else
+# else
afs_proc_t *p = curproc; /* XXX */
-#endif
-#ifndef AFS_DARWIN80_ENV
+# endif
+# ifndef AFS_DARWIN80_ENV
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
p->p_pid, p->p_comm);
-#endif
+# endif
setpag(p, acred, -1, &pag, 1);
#else
-#ifdef AFS_OSF_ENV
- setpag(u.u_procp, acred, -1, &pag, 1); /* XXX u.u_procp is a no-op XXX */
-#else
setpag(acred, -1, &pag, 1);
#endif
-#endif
}
pag = PagInCred(*acred);
uid = (pag == NOPAG) ? (*acred)->cr_uid : pag;
*/
/* AFS_HPUX102 and up uses VNODE ioctl instead */
#if !defined(AFS_HPUX102_ENV) && !defined(AFS_DARWIN80_ENV)
-#if !defined(AFS_SGI_ENV)
-#ifdef AFS_AIX32_ENV
-#ifdef AFS_AIX51_ENV
-#ifdef __64BIT__
+# if !defined(AFS_SGI_ENV)
+# ifdef AFS_AIX32_ENV
+# ifdef AFS_AIX51_ENV
+# ifdef __64BIT__
int
kioctl(int fdes, int com, caddr_t arg, caddr_t ext, caddr_t arg2,
caddr_t arg3)
-#else /* __64BIT__ */
+# else /* __64BIT__ */
int
kioctl32(int fdes, int com, caddr_t arg, caddr_t ext, caddr_t arg2,
caddr_t arg3)
-#endif /* __64BIT__ */
-#else
+# endif /* __64BIT__ */
+# else
int
kioctl(int fdes, int com, caddr_t arg, caddr_t ext)
-#endif
+# endif
{
struct a {
int fd, com;
caddr_t arg, ext;
-#ifdef AFS_AIX51_ENV
+# ifdef AFS_AIX51_ENV
caddr_t arg2, arg3;
-#endif
+# endif
} u_uap, *uap = &u_uap;
-#else
-#if defined(AFS_SUN5_ENV)
+# else
+# if defined(AFS_SUN5_ENV)
struct afs_ioctl_sys {
int fd;
int
afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp)
{
-#elif defined(AFS_OSF_ENV)
-int
-afs_xioctl(afs_proc_t *p, void *args, long *retval)
-{
- struct a {
- long fd;
- u_long com;
- caddr_t arg;
- } *uap = (struct a *)args;
-#elif defined(AFS_FBSD50_ENV)
-#define arg data
+# elif defined(AFS_FBSD50_ENV)
+# define arg data
int
afs_xioctl(struct thread *td, register struct ioctl_args *uap,
register_t *retval)
{
afs_proc_t *p = td->td_proc;
-#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+# elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
struct ioctl_args {
int fd;
u_long com;
int
afs_xioctl(afs_proc_t *p, register struct ioctl_args *uap, register_t *retval)
{
-#elif defined(AFS_LINUX22_ENV)
+# elif defined(AFS_LINUX22_ENV)
struct afs_ioctl_sys {
unsigned int com;
unsigned long arg;
unsigned long arg)
{
struct afs_ioctl_sys ua, *uap = &ua;
-#else
+# else
int
afs_xioctl(void)
{
int com;
caddr_t arg;
} *uap = (struct a *)u.u_ap;
-#endif /* AFS_SUN5_ENV */
-#endif
-#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
+# endif /* AFS_SUN5_ENV */
+# endif
+# if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
struct file *fd;
-#elif !defined(AFS_LINUX22_ENV)
+# elif !defined(AFS_LINUX22_ENV)
register struct file *fd;
-#endif
-#if defined(AFS_XBSD_ENV)
+# endif
+# if defined(AFS_XBSD_ENV)
register struct filedesc *fdp;
-#endif
+# endif
register struct vcache *tvc;
register int ioctlDone = 0, code = 0;
AFS_STATCNT(afs_xioctl);
-#if defined(AFS_DARWIN_ENV)
+# if defined(AFS_DARWIN_ENV)
if ((code = fdgetf(p, uap->fd, &fd)))
return code;
-#elif defined(AFS_XBSD_ENV)
+# elif defined(AFS_XBSD_ENV)
fdp = p->p_fd;
if ((u_int) uap->fd >= fdp->fd_nfiles
|| (fd = fdp->fd_ofiles[uap->fd]) == NULL)
return EBADF;
if ((fd->f_flag & (FREAD | FWRITE)) == 0)
return EBADF;
-#elif defined(AFS_LINUX22_ENV)
+# elif defined(AFS_LINUX22_ENV)
ua.com = com;
ua.arg = arg;
-#elif defined(AFS_AIX32_ENV)
+# elif defined(AFS_AIX32_ENV)
uap->fd = fdes;
uap->com = com;
uap->arg = arg;
-#ifdef AFS_AIX51_ENV
+# ifdef AFS_AIX51_ENV
uap->arg2 = arg2;
uap->arg3 = arg3;
-#endif
+# endif
if (setuerror(getf(uap->fd, &fd))) {
return -1;
}
-#elif defined(AFS_OSF_ENV)
- fd = NULL;
- if (code = getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state))
- return code;
-#elif defined(AFS_SUN5_ENV)
-# if defined(AFS_SUN57_ENV)
+# elif defined(AFS_SUN5_ENV)
+# if defined(AFS_SUN57_ENV)
fd = getf(uap->fd);
if (!fd)
return (EBADF);
-# elif defined(AFS_SUN54_ENV)
+# elif defined(AFS_SUN54_ENV)
fd = GETF(uap->fd);
if (!fd)
return (EBADF);
-# else
+# else
if (code = getf(uap->fd, &fd)) {
return (code);
}
-# endif /* AFS_SUN57_ENV */
-#else
+# endif /* AFS_SUN57_ENV */
+# else
fd = getf(uap->fd);
if (!fd)
return (EBADF);
-#endif
+# endif
/* first determine whether this is any sort of vnode */
-#if defined(AFS_LINUX22_ENV)
+# if defined(AFS_LINUX22_ENV)
tvc = VTOAFS(ip);
{
-#else
-#ifdef AFS_SUN5_ENV
+# else
+# ifdef AFS_SUN5_ENV
if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) {
-#else
+# else
if (fd->f_type == DTYPE_VNODE) {
-#endif
+# endif
/* good, this is a vnode; next see if it is an AFS vnode */
-#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
+# if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
tvc = VTOAFS(fd->f_vnode); /* valid, given a vnode */
-#elif defined(AFS_OBSD_ENV)
+# elif defined(AFS_OBSD_ENV)
tvc =
IsAfsVnode((struct vnode *)fd->
f_data) ? VTOAFS((struct vnode *)fd->f_data) : NULL;
-#else
+# else
tvc = VTOAFS((struct vnode *)fd->f_data); /* valid, given a vnode */
-#endif
-#endif /* AFS_LINUX22_ENV */
+# endif
+# endif /* AFS_LINUX22_ENV */
if (tvc && IsAfsVnode(AFSTOV(tvc))) {
/* This is an AFS vnode */
if (((uap->com >> 8) & 0xff) == 'V') {
if (code) {
osi_FreeSmallSpace(datap);
AFS_GUNLOCK();
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
- return code;
-#else
-#if defined(AFS_SUN5_ENV)
-#ifdef AFS_SUN54_ENV
+# if defined(AFS_AIX41_ENV)
+ ufdrele(uap->fd);
+# elif defined(AFS_SUN54_ENV)
releasef(uap->fd);
-#else
+# elif defined(AFS_SUN5_ENV)
releasef(fd);
-#endif
- return (EFAULT);
-#else
-#ifdef AFS_OSF_ENV
-#ifdef AFS_OSF30_ENV
- FP_UNREF_ALWAYS(fd);
-#else
- FP_UNREF(fd);
-#endif
+# endif
+
+# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
return code;
-#else /* AFS_OSF_ENV */
-#ifdef AFS_AIX41_ENV
- ufdrele(uap->fd);
-#endif
-#ifdef AFS_LINUX22_ENV
+# elif defined(AFS_SUN5_ENV)
+ return (EFAULT);
+# elif defined(AFS_LINUX22_ENV)
return -code;
-#else
+# else
return (setuerror(code), code);
-#endif
-#endif
-#endif
-#endif
+# endif
}
code = HandleIoctl(tvc, uap->com, datap);
osi_FreeSmallSpace(datap);
AFS_GUNLOCK();
ioctlDone = 1;
-#ifdef AFS_AIX41_ENV
+# if defined(AFS_AIX41_ENV)
ufdrele(uap->fd);
-#endif
-#ifdef AFS_OSF_ENV
-#ifdef AFS_OSF30_ENV
- FP_UNREF_ALWAYS(fd);
-#else
- FP_UNREF(fd);
-#endif
-#endif
+# endif
}
-#if defined(AFS_LINUX22_ENV)
+# if defined(AFS_LINUX22_ENV)
else
code = EINVAL;
-#endif
+# endif
}
}
if (!ioctlDone) {
-#ifdef AFS_AIX41_ENV
+# if defined(AFS_AIX41_ENV)
ufdrele(uap->fd);
-#ifdef AFS_AIX51_ENV
-#ifdef __64BIT__
+# ifdef AFS_AIX51_ENV
+# ifdef __64BIT__
code = okioctl(fdes, com, arg, ext, arg2, arg3);
-#else /* __64BIT__ */
+# else /* __64BIT__ */
code = okioctl32(fdes, com, arg, ext, arg2, arg3);
-#endif /* __64BIT__ */
-#else /* !AFS_AIX51_ENV */
+# endif /* __64BIT__ */
+# else /* !AFS_AIX51_ENV */
code = okioctl(fdes, com, arg, ext);
-#endif /* AFS_AIX51_ENV */
+# endif /* AFS_AIX51_ENV */
return code;
-#else /* !AFS_AIX41_ENV */
-#ifdef AFS_AIX32_ENV
+# elif defined(AFS_AIX32_ENV)
okioctl(fdes, com, arg, ext);
-#elif defined(AFS_SUN5_ENV)
-#if defined(AFS_SUN57_ENV)
+# elif defined(AFS_SUN5_ENV)
+# if defined(AFS_SUN57_ENV)
releasef(uap->fd);
-#elif defined(AFS_SUN54_ENV)
+# elif defined(AFS_SUN54_ENV)
RELEASEF(uap->fd);
-#else
+# else
releasef(fd);
-#endif
+# endif
code = ioctl(uap, rvp);
-#elif defined(AFS_FBSD50_ENV)
+# elif defined(AFS_FBSD50_ENV)
return ioctl(td, uap);
-#elif defined(AFS_FBSD_ENV)
+# elif defined(AFS_FBSD_ENV)
return ioctl(p, uap);
-#elif defined(AFS_OBSD_ENV)
+# elif defined(AFS_OBSD_ENV)
code = sys_ioctl(p, uap, retval);
-#elif defined(AFS_DARWIN_ENV)
+# elif defined(AFS_DARWIN_ENV)
return ioctl(p, uap, retval);
-#elif defined(AFS_OSF_ENV)
- code = ioctl(p, args, retval);
-#ifdef AFS_OSF30_ENV
- FP_UNREF_ALWAYS(fd);
-#else
- FP_UNREF(fd);
-#endif
- return code;
-#elif !defined(AFS_LINUX22_ENV)
+# elif !defined(AFS_LINUX22_ENV)
ioctl();
-#endif
-#endif
+# endif
}
-#ifdef AFS_SUN5_ENV
+# ifdef AFS_SUN5_ENV
if (ioctlDone)
-#ifdef AFS_SUN54_ENV
+# ifdef AFS_SUN54_ENV
releasef(uap->fd);
-#else
+# else
releasef(fd);
-#endif
+# endif
return (code);
-#else
-#ifdef AFS_LINUX22_ENV
+# elif defined(AFS_LINUX22_ENV)
return -code;
-#else
-#if defined(KERNEL_HAVE_UERROR)
+# elif defined(KERNEL_HAVE_UERROR)
if (!getuerror())
setuerror(code);
-#if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV)
+# if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV)
return (getuerror()? -1 : u.u_ioctlrv);
-#else
+# else
return getuerror()? -1 : 0;
-#endif
-#endif
-#endif /* AFS_LINUX22_ENV */
-#endif /* AFS_SUN5_ENV */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+# endif
+# endif
+
+# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
return (code);
-#else
+# else
return 0;
-#endif
+# endif
}
-#endif /* AFS_SGI_ENV */
+# endif /* AFS_SGI_ENV */
#endif /* AFS_HPUX102_ENV */
#if defined(AFS_SGI_ENV)
AFS_GLOCK();
code = afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow);
AFS_GUNLOCK();
-#ifdef AFS_SGI64_ENV
+# ifdef AFS_SGI64_ENV
return code;
-#else
+# else
return u.u_error;
-#endif
-}
-
-#elif defined(AFS_OSF_ENV)
-afs_pioctl(afs_proc_t *p, void *args, int *retval)
-{
- struct a {
- char *path;
- int cmd;
- caddr_t cmarg;
- int follow;
- } *uap = (struct a *)args;
-
- AFS_STATCNT(afs_pioctl);
- return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow));
+# endif
}
#elif defined(AFS_FBSD50_ENV)
} *uap = (struct a *)args;
AFS_STATCNT(afs_pioctl);
-#ifdef AFS_DARWIN80_ENV
+# ifdef AFS_DARWIN80_ENV
return (afs_syscall_pioctl
(uap->path, uap->cmd, uap->cmarg, uap->follow,
kauth_cred_get()));
-#else
+# else
return (afs_syscall_pioctl
(uap->path, uap->cmd, uap->cmarg, uap->follow,
p->p_cred->pc_ucred));
-#endif
+# endif
}
#endif
if (set_parent_pag) {
afs_uint32 pag;
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-#if defined(AFS_DARWIN_ENV)
+# if defined(AFS_DARWIN_ENV)
afs_proc_t *p = current_proc(); /* XXX */
-#else
+# else
afs_proc_t *p = curproc; /* XXX */
-#endif
-#ifndef AFS_DARWIN80_ENV
+# endif
+# ifndef AFS_DARWIN80_ENV
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
p->p_pid, p->p_comm);
-#endif
+# endif
if (!setpag(p, acred, -1, &pag, 1)) {
#else
-#ifdef AFS_OSF_ENV
- if (!setpag(u.u_procp, acred, -1, &pag, 1)) { /* XXX u.u_procp is a no-op XXX */
-#else
if (!setpag(acred, -1, &pag, 1)) {
#endif
-#endif
afs_InitReq(&treq, *acred);
areq = &treq;
}
goto loop;
}
#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
VN_HOLD(AFSTOV(tvc));
-#else
-#ifdef AFS_DARWIN80_ENV
+#elif defined(AFS_DARWIN80_ENV)
vp = AFSTOV(tvc);
if (vnode_get(vp))
continue;
AFS_GLOCK();
continue;
}
-#else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
osi_vnhold(tvc, 0);
#else
VREFCOUNT_INC(tvc); /* AIX, apparently */
#endif
-#endif
-#endif
ReleaseReadLock(&afs_xvcache);
#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */
newcred->cr_groups[i] = NOGROUP;
#endif
#endif
-#if !defined(AFS_OSF_ENV)
- afs_nfsclient_init(); /* before looking for exporter, ensure one exists */
-#endif
if (!(exporter = exporter_find(exporter_type))) {
/* Exporter wasn't initialized or an invalid exporter type */
crfree(newcred);
/* afs_osi_pag.c */
#if defined(AFS_SUN5_ENV)
extern int afs_setpag(afs_ucred_t **credpp);
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_setpag(afs_proc_t *p, void *args, int *retval);
#else
extern int afs_setpag(void);
extern afs_uint32 genpag(void);
extern afs_uint32 getpag(void);
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int AddPag(afs_proc_t *p, afs_int32 aval, afs_ucred_t **credpp);
#else
extern int AddPag(afs_int32 aval, afs_ucred_t **credpp);
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);
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_syscall_icreate(long, long, long, long, long, long, long*);
extern int afs_syscall_iopen(int dev, int inode, int usrmod, long *retval);
extern int afs_syscall_iincdec(int dev, int inode, int inode_p1, int amount);
/* ARCH/osi_vnodeops.c */
extern struct vnodeops Afs_vnodeops;
-#if defined(AFS_OSF_ENV)
-#if defined(AFS_OSF30_ENV)
-extern int max_vnodes; /* number of total system vnodes */
-#else
-extern int nvnode; /* number of total system vnodes */
-extern int numvnodes; /* number vnodes in use now */
-#endif
-#ifdef AFS_DUX40_ENV
-extern struct vfs_ubcops afs_ubcops;
-#endif
-#endif
extern int afs_inactive(struct vcache *avc, afs_ucred_t *acred);
/* afs_osifile.c */
extern afs_uint32 pagCounter;
/* OS/osi_vfsops.c */
-#if defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
extern struct mount *afs_globalVFS;
#else
extern struct vfs *afs_globalVFS;
#endif
/* VNOPS/afs_vnop_create.c */
-#ifdef AFS_OSF_ENV
-extern int afs_create(struct nameidata *ndp, struct vattr *attrs);
-#else /* AFS_OSF_ENV */
#ifdef AFS_SGI64_ENV
extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
int flags, int amode, struct vcache **avcp,
enum vcexcl aexcl, int amode, struct vcache **avcp,
afs_ucred_t *acred);
#endif /* AFS_SGI64_ENV */
-#endif /* AFS_OSF_ENV */
extern int afs_LocalHero(register struct vcache *avc,
register struct dcache *adc,
register AFSFetchStatus * astat, register int aincr);
#if !defined(AFS_ATHENA_ENV)
#ifdef AFS_AIX41_ENV
int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp);
-#elif defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV)
+#elif defined(AFS_SUN54_ENV)
int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp);
#else
int afs_fid(OSI_VC_DECL(avc), struct fid **fidpp);
extern int HandleFlock(register struct vcache *avc, int acom,
struct vrequest *areq, pid_t clid, int onlymine);
-#ifdef AFS_OSF_ENV
-extern int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
- afs_ucred_t * acred, pid_t clid, off_t offset);
-#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
afs_ucred_t * acred, pid_t clid);
#else
struct sysname_info *state);
extern int afs_DoBulkStat(struct vcache *adp, long dirCookie,
struct vrequest *areqp);
-#ifdef AFS_OSF_ENV
-extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp,
- afs_ucred_t *acred, int opflag, int wantparent);
-#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
+
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp,
struct pathname *pnp, int flags, struct vnode *rdir,
afs_ucred_t *acred);
/* VNOPS/afs_vnop_readdir.c */
extern int afs_rd_stash_i;
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio,
afs_ucred_t *acred, int *eofp);
#elif defined(AFS_HPUX100_ENV)
#endif
/* VNOPS/afs_vnop_strategy.c */
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_ustrategy(register struct buf *adp, afs_ucred_t *credp);
#else
extern int afs_ustrategy(register struct buf *adp);
afs_ucred_t *acred);
#endif
-#ifdef AFS_OSF_ENV
-extern int afs_fsync(OSI_VC_DECL(avc), int fflags, afs_ucred_t *acred,
- int waitfor);
-#elif defined(AFS_SGI65_ENV)
+#if defined(AFS_SGI65_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_SUN53_ENV)
extern afs_int32 afs_uuid_create(afsUUID * uuid);
extern u_short afs_uuid_hash(afsUUID * uuid);
-#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV)
#include "osi_prototypes.h"
#endif
* to accomodate both, *long* is used instead of afs_int32
*/
-#ifdef AFS_SUN57_ENV
+# ifdef AFS_SUN57_ENV
struct afssysa {
long syscall;
long parm1;
long parm5;
long parm6;
};
-#else
+# else
struct afssysa {
afs_int32 syscall;
afs_int32 parm1;
afs_int32 parm5;
afs_int32 parm6;
};
-#endif
+# endif
Afs_syscall(register struct afssysa *uap, rval_t * rvp)
{
int *retval = &rvp->r_val1;
-#else /* AFS_SUN5_ENV */
-#ifdef AFS_DARWIN100_ENV
+#elif defined(AFS_DARWIN100_ENV)
struct afssysa {
afs_int32 syscall;
afs_int32 parm1;
{
struct afssysa64 *uap64 = NULL;
struct afssysa *uap = NULL;
-#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
afs3_syscall(p, args, retval)
-#ifdef AFS_FBSD50_ENV
+# ifdef AFS_FBSD50_ENV
struct thread *p;
-#else
+# else
afs_proc_t *p;
-#endif
+# endif
void *args;
long *retval;
{
long parm5;
long parm6;
} *uap = (struct a *)args;
-#else /* AFS_OSF_ENV */
-#ifdef AFS_LINUX20_ENV
+#elif defined(AFS_LINUX20_ENV)
struct afssysargs {
long syscall;
long parm1;
long linux_ret = 0;
long *retval = &linux_ret;
long eparm[4]; /* matches AFSCALL_ICL in fstrace.c */
-#ifdef AFS_SPARC64_LINUX24_ENV
+# ifdef AFS_SPARC64_LINUX24_ENV
afs_int32 eparm32[4];
-#endif
+# endif
/* eparm is also used by AFSCALL_CALL in afsd.c */
#else
-#if defined(UKERNEL)
+# if defined(UKERNEL)
int
Afs_syscall()
{
long parm5;
long parm6;
} *uap = (struct a *)u.u_ap;
-#else /* UKERNEL */
+# else /* UKERNEL */
int
Afs_syscall()
{
long parm5;
long parm6;
} *uap = (struct a *)u.u_ap;
-#endif /* UKERNEL */
-#if defined(AFS_HPUX_ENV)
+# endif /* UKERNEL */
+# if defined(AFS_HPUX_ENV)
long *retval = &u.u_rval1;
-#else
+# else
int *retval = &u.u_rval1;
+# endif
#endif
-#endif /* AFS_LINUX20_ENV */
-#endif /* AFS_OSF_ENV */
-#endif /* AFS_SUN5_ENV */
register int code = 0;
AFS_STATCNT(afs_syscall);
AFS_GUNLOCK();
#else
AFS_GLOCK();
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
code = afs_setpag(p, args, retval);
-#else /* AFS_OSF_ENV */
+#else /* AFS_DARWIN_ENV || AFS_XBSD_ENV */
code = afs_setpag();
#endif
AFS_GUNLOCK();
afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1,
iparams.param2, iparams.param3,
iparams.param4
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
, retval
#endif
);
CRED());
#else
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
, retval
#endif
);
for (i = 0; i < VCSIZE; i++) {
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
if (tvc->f.states & CVInit) continue;
-#ifdef AFS_OSF_ENV
- if (VREFCOUNT(tvc) > 1)
-#else /* AFS_OSF_ENV */
#ifdef AFS_DARWIN80_ENV
if (vnode_isinuse(AFSTOV(tvc), 0))
#else
if (VREFCOUNT(tvc))
#endif
-#endif
afs_warn("Stat cache entry at %x is held\n", tvc);
if (CheckLock(&tvc->lock))
afs_warn("Stat entry at %x is locked\n", tvc);
afs_noop(void)
{
AFS_STATCNT(afs_noop);
-#ifdef AFS_OSF30_ENV
- return (EOPNOTSUPP);
-#else
return EINVAL;
-#endif
}
int
#include "afs/afs_cbqueue.h"
#include "afs/afs_osidnlc.h"
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
afs_int32 afs_maxvcount = 0; /* max number of vcache entries */
afs_int32 afs_vcount = 0; /* number of vcache in use now */
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_LINUX22_ENV */
#ifdef AFS_SGI_ENV
int afsvnumbers = 0;
AFS_STATCNT(afs_FlushVCache);
afs_Trace2(afs_iclSetp, CM_TRACE_FLUSHV, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, avc->f.states);
-#ifdef AFS_OSF_ENV
- AFS_GUNLOCK();
- VN_LOCK(AFSTOV(avc));
- AFS_GLOCK();
-#endif
code = osi_VM_FlushVCache(avc, slept);
if (code)
else
afs_evenZaps++;
-#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_LINUX22_ENV)
/* put the entry in the free list */
avc->nextfree = freeVCList;
freeVCList = avc;
afs_vcount--;
vSetType(avc, VREG);
if (VREFCOUNT_GT(avc,0)) {
-#if defined(AFS_OSF_ENV)
- VN_UNLOCK(AFSTOV(avc));
-#endif
AFS_RELE(AFSTOV(avc));
afs_stats_cmperf.vcacheXAllocs--;
} else {
if (afs_norefpanic) {
printf("flush vc refcnt < 1");
afs_norefpanic++;
-#if defined(AFS_OSF_ENV)
- (void)vgone(avc, VX_NOSLEEP, NULL);
- AFS_GLOCK();
- VN_UNLOCK(AFSTOV(avc));
-#endif
} else
osi_Panic("flush vc refcnt < 1");
}
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_LINUX22_ENV */
return 0;
bad:
-#ifdef AFS_OSF_ENV
- VN_UNLOCK(AFSTOV(avc));
-#endif
return code;
-
} /*afs_FlushVCache */
#ifndef AFS_SGI_ENV
int
afs_ShakeLooseVCaches(afs_int32 anumber)
{
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
afs_int32 i;
struct vcache *tvc;
struct afs_q *tq, *uq;
afs_AllocVCache(void)
{
struct vcache *tvc;
-#if defined(AFS_OSF30_ENV)
- struct vcache *nvc;
- AFS_GUNLOCK();
- if (getnewvnode(MOUNT_AFS, &Afs_vnodeops, &nvc)) {
- /* What should we do ???? */
- osi_Panic("afs_AllocVCache: no more vnodes");
- }
- AFS_GLOCK();
-
- tvc = nvc;
- tvc->nextfree = NULL;
- afs_vcount++;
-#elif defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
struct inode *ip;
AFS_GUNLOCK();
#ifdef AFS_AIX_ENV
struct gnode *gnodepnt;
#endif
-#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_LINUX22_ENV)
struct afs_q *tq, *uq;
int code, fv_slept;
#endif
afs_FlushReclaimedVcaches();
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
if(!afsd_dynamic_vcaches) {
afs_ShakeLooseVCaches(anumber);
if (afs_vcount >= afs_maxvcount) {
}
}
tvc = afs_AllocVCache();
-#else /* AFS_OSF_ENV */
+#else /* AFS_LINUX22_ENV */
/* pull out a free cache entry */
if (!freeVCList) {
int loop = 0;
tvc->nextfree = NULL;
} /* end of if (!freeVCList) */
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_LINUX22_ENV */
#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
if (tvc->v)
panic("afs_NewVCache(): free vcache with vnode attached");
#endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_LINUX22_ENV)
#if defined(AFS_DISCON_ENV)
/* We need to preserve the slot that we're being stored into on
}
#endif
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
/* Hold it for the LRU (should make count 2) */
VN_HOLD(AFSTOV(tvc));
-#else /* AFS_OSF_ENV */
-#if !(defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV))
+#elif !(defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV))
VREFCOUNT_SET(tvc, 1); /* us */
-#endif /* AFS_XBSD_ENV */
-#endif /* AFS_OSF_ENV */
+#endif
+
#ifdef AFS_AIX32_ENV
LOCK_INIT(&tvc->pvmlock, "vcache pvmlock");
tvc->vmh = tvc->segid = NULL;
tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us! */
gnodepnt->gn_vnode = &tvc->v;
#endif
-#if defined(AFS_DUX40_ENV)
- insmntque(tvc, afs_globalVFS, &afs_ubcops);
-#else
-#ifdef AFS_OSF_ENV
- /* Is this needed??? */
- insmntque(tvc, afs_globalVFS);
-#endif /* AFS_OSF_ENV */
-#endif /* AFS_DUX40_ENV */
#ifdef AFS_FBSD70_ENV
#ifndef AFS_FBSD80_ENV /* yup. they put it back. */
insmntque(AFSTOV(tvc), afs_globalVFS);
AFS_STATCNT(afs_VerifyVCache);
-#if defined(AFS_OSF_ENV)
- ObtainReadLock(&avc->lock);
- if (afs_IsWired(avc)) {
- ReleaseReadLock(&avc->lock);
- return 0;
- }
- ReleaseReadLock(&avc->lock);
-#endif /* AFS_OSF_ENV */
/* otherwise we must fetch the status info */
ObtainWriteLock(&avc->lock, 53);
ReleaseWriteLock(&tvc->lock);
return tvc;
}
-#if defined(AFS_OSF_ENV)
- if (afs_IsWired(tvc)) {
- ReleaseWriteLock(&tvc->lock);
- return tvc;
- }
-#endif /* AFS_OSF_ENV */
#ifdef AFS_DARWIN80_ENV
/* Darwin 8.0 only has bufs in nfs, so we shouldn't have to worry about them.
What about ubc? */
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
int origCBs = 0;
-#ifdef AFS_OSF_ENV
- int vg;
-#endif
#ifdef AFS_DARWIN80_ENV
vnode_t tvp;
#endif
afs_osi_Sleep(&tvc->f.states);
goto rootvc_loop;
}
-#ifdef AFS_OSF_ENV
- /* Grab this vnode, possibly reactivating from the free list */
- /* for the present (95.05.25) everything on the hash table is
- * definitively NOT in the free list -- at least until afs_reclaim
- * can be safely implemented */
- AFS_GUNLOCK();
- vg = vget(AFSTOV(tvc)); /* this bumps ref count */
- AFS_GLOCK();
- if (vg)
- continue;
-#endif /* AFS_OSF_ENV */
#ifdef AFS_DARWIN80_ENV
if (tvc->f.states & CDeadVnode) {
ReleaseSharedLock(&afs_xvcache);
if (!haveStatus && (!tvc || !(tvc->f.states & CStatd))) {
/* Mount point no longer stat'd or unknown. FID may have changed. */
-#ifdef AFS_OSF_ENV
- if (tvc)
- AFS_RELE(AFSTOV(tvc));
-#endif
getNewFid = 1;
ReleaseSharedLock(&afs_xvcache);
#ifdef AFS_DARWIN80_ENV
if (cached)
*cached = 1;
afs_stats_cmperf.vcacheHits++;
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN80_ENV)
+#if defined(AFS_DARWIN80_ENV)
/* we already bumped the ref count in the for loop above */
-#else /* AFS_OSF_ENV */
+#else /* AFS_DARWIN80_ENV */
osi_vnhold(tvc, 0);
#endif
UpgradeSToWLock(&afs_xvcache, 24);
register struct vcache *tvc;
afs_int32 i;
-#if defined( AFS_OSF_ENV)
- int vg;
-#endif
#ifdef AFS_DARWIN80_ENV
vnode_t tvp;
#endif
findvc_sleep(tvc, flag);
goto findloop;
}
-#ifdef AFS_OSF_ENV
- /* Grab this vnode, possibly reactivating from the free list */
- AFS_GUNLOCK();
- vg = vget(AFSTOV(tvc));
- AFS_GLOCK();
- if (vg)
- continue;
-#endif /* AFS_OSF_ENV */
#ifdef AFS_DARWIN80_ENV
if (tvc->f.states & CDeadVnode) {
findvc_sleep(tvc, flag);
if (tvc) {
if (retry)
*retry = 0;
-#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN80_ENV)
+#if !defined(AFS_DARWIN80_ENV)
osi_vnhold(tvc, retry); /* already held, above */
if (retry && *retry)
return 0;
afs_int32 i;
afs_int32 count = 0;
struct vcache *found_tvc = NULL;
-#ifdef AFS_OSF_ENV
- int vg;
-#endif
#ifdef AFS_DARWIN80_ENV
vnode_t tvp;
#endif
afs_osi_Sleep(&tvc->f.states);
goto loop;
}
-#ifdef AFS_OSF_ENV
- /* Grab this vnode, possibly reactivating from the free list */
- AFS_GUNLOCK();
- vg = vget(AFSTOV(tvc));
- AFS_GLOCK();
- if (vg) {
- /* This vnode no longer exists. */
- continue;
- }
-#endif /* AFS_OSF_ENV */
#ifdef AFS_DARWIN80_ENV
if (tvc->f.states & CDeadVnode) {
ReleaseSharedLock(&afs_xvcache);
count++;
if (found_tvc) {
/* Duplicates */
-#ifdef AFS_OSF_ENV
- /* Drop our reference counts. */
- vrele(AFSTOV(tvc));
- vrele(AFSTOV(found_tvc));
-#endif
afs_duplicate_nfs_fids++;
ReleaseSharedLock(&afs_xvcache);
#ifdef AFS_DARWIN80_ENV
goto loop;
}
#else
-#if !defined(AFS_OSF_ENV)
osi_vnhold(tvc, (int *)0); /* already held, above */
#endif
-#endif
/*
* We obtained the xvcache lock above.
*/
void
afs_vcacheInit(int astatSize)
{
-#if (!defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)) || defined(AFS_SGI_ENV)
+#if !defined(AFS_LINUX22_ENV)
register struct vcache *tvp;
#endif
int i;
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
- if (!afs_maxvcount) {
#if defined(AFS_LINUX22_ENV)
+ if (!afs_maxvcount) {
afs_maxvcount = astatSize; /* no particular limit on linux? */
-#elif defined(AFS_OSF30_ENV)
- afs_maxvcount = max_vnodes / 2; /* limit ourselves to half the total */
-#else
- afs_maxvcount = nvnode / 2; /* limit ourselves to half the total */
-#endif
if (astatSize < afs_maxvcount) {
afs_maxvcount = astatSize;
}
}
-#else /* AFS_OSF_ENV */
+#else /* AFS_LINUX22_ENV */
freeVCList = NULL;
#endif
AFS_RWLOCK_INIT(&afs_xvcache, "afs_xvcache");
LOCK_INIT(&afs_xvcb, "afs_xvcb");
-#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_LINUX22_ENV)
/* Allocate and thread the struct vcache entries */
tvp = (struct vcache *)afs_osi_Alloc(astatSize * sizeof(struct vcache));
memset(tvp, 0, sizeof(struct vcache) * astatSize);
tvp[i].nextfree = &(tvp[i + 1]);
}
tvp[astatSize - 1].nextfree = NULL;
-#ifdef KERNEL_HAVE_PIN
+# ifdef KERNEL_HAVE_PIN
pin((char *)tvp, astatSize * sizeof(struct vcache)); /* XXX */
-#endif
+# endif
#endif
#if defined(AFS_SGI_ENV)
}
afs_cbrSpace = 0;
-#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_LINUX22_ENV)
afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
-#endif
-#ifdef KERNEL_HAVE_PIN
+
+# ifdef KERNEL_HAVE_PIN
unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
-#endif
+# endif
-#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
freeVCList = Initial_freeVCList = 0;
#endif
+
AFS_RWLOCK_INIT(&afs_xvcache, "afs_xvcache");
LOCK_INIT(&afs_xvcb, "afs_xvcb");
QInit(&VLRU);
* up 2 bytes
*/
-#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL)
#define AFS_XLATOR_MAGIC 0x8765 /* XXX */
#else
#define AFS_XLATOR_MAGIC 0x87654321
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#define AFS_NFSXLATORREQ(cred) 0
#else
-#ifdef AFS_OSF_ENV
-#define AFS_NFSXLATORREQ(cred) ((cred)->cr_ruid == NFSXLATOR_CRED)
-#else
#define AFS_NFSXLATORREQ(cred) ((cred)->cr_rgid == NFSXLATOR_CRED)
#endif
-#endif
struct afs_exporter;
* LICENSED MATERIALS - PROPERTY OF IBM
*/
-#if (defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV)
+#if (defined(AFS_SUN5_ENV))
#define AFS_NOBOZO_LOCK
#endif
-#if !defined(AFS_OSF20_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_OSF32_ENV)
- /* We do not instrument locks on osf20 because the vcache structure
- ** exceeds the maximim possible limit for a vnode.
- */
#define INSTRUMENT_LOCKS
/* This is the max lock number in use. Please update it if you add any new
* lock numbers.
*/
#define MAX_LOCK_NUMBER 780
-#endif
struct afs_bozoLock {
short count; /* count of excl locks */
*/
#ifdef UKERNEL
-#include <UKERNEL/sysincludes.h>
+# include <UKERNEL/sysincludes.h>
#else
#ifndef __AFS_SYSINCLUDESH__
#define __AFS_SYSINCLUDESH__ 1
#ifdef AFS_OBSD_ENV
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/lock.h>
-#include <sys/queue.h>
-#include <sys/resourcevar.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/time.h>
-#include <sys/filedesc.h>
-#include <sys/file.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/dirent.h>
-#include <sys/user.h>
-#include <sys/uio.h>
-#include <sys/buf.h>
-#include <sys/stat.h>
-#include <sys/mount.h>
-#include <sys/vnode.h>
-#include <sys/malloc.h>
-#include <ufs/ffs/fs.h>
-#include <ufs/ufs/quota.h>
-#include <ufs/ufs/inode.h>
-#ifndef AFS_OBSD38_ENV
-#include <ufs/ufs/extattr.h>
-#endif
-#include <ufs/ufs/ufsmount.h>
-#ifndef MLEN
-#include <sys/mbuf.h>
-#include <net/if.h>
-#endif
-#include <sys/protosw.h>
-#include <sys/ioctl.h>
-#include <sys/timeout.h>
-#else /* AFS_OBSD_ENV */
-#ifdef AFS_LINUX22_ENV
-#include <linux/version.h>
-#ifdef CONFIG_H_EXISTS
-#include <linux/config.h>
-#endif
-#include <linux/linkage.h>
-#include <linux/limits.h>
-#include <linux/wait.h>
-#include <linux/types.h>
-#include <linux/vfs.h>
-#include <linux/net.h>
-#include <linux/kdev_t.h>
-#include <linux/ioctl.h>
-#if defined(AFS_LINUX26_ENV)
-#include <linux/backing-dev.h>
-#include <linux/pagemap.h>
-#include <linux/namei.h>
-#ifdef STRUCT_INODE_HAS_I_SECURITY
-#include <linux/security.h>
-#endif
-#include <linux/suspend.h>
-#if defined(LINUX_KEYRING_SUPPORT)
-#include <linux/rwsem.h>
-#include <linux/key.h>
-#if defined(KEY_TYPE_H_EXISTS)
-#include <linux/key-type.h>
-#endif
-#ifndef KEY_ALLOC_IN_QUOTA
-#define KEY_ALLOC_IN_QUOTA 1
-#endif
-#endif
-#endif
+# include <sys/errno.h>
+# include <sys/types.h>
+# include <sys/param.h>
+# include <sys/lock.h>
+# include <sys/queue.h>
+# include <sys/resourcevar.h>
+# include <sys/kernel.h>
+# include <sys/proc.h>
+# include <sys/time.h>
+# include <sys/filedesc.h>
+# include <sys/file.h>
+# include <sys/socket.h>
+# include <sys/socketvar.h>
+# include <sys/dirent.h>
+# include <sys/user.h>
+# include <sys/uio.h>
+# include <sys/buf.h>
+# include <sys/stat.h>
+# include <sys/mount.h>
+# include <sys/vnode.h>
+# include <sys/malloc.h>
+# include <ufs/ffs/fs.h>
+# include <ufs/ufs/quota.h>
+# include <ufs/ufs/inode.h>
+# ifndef AFS_OBSD38_ENV
+# include <ufs/ufs/extattr.h>
+# endif
+# include <ufs/ufs/ufsmount.h>
+# ifndef MLEN
+# include <sys/mbuf.h>
+# include <net/if.h>
+# endif
+# include <sys/protosw.h>
+# include <sys/ioctl.h>
+# include <sys/timeout.h>
+
+#elif defined(AFS_LINUX22_ENV)
+# include <linux/version.h>
+# ifdef CONFIG_H_EXISTS
+# include <linux/config.h>
+# endif
+# include <linux/linkage.h>
+# include <linux/limits.h>
+# include <linux/wait.h>
+# include <linux/types.h>
+# include <linux/vfs.h>
+# include <linux/net.h>
+# include <linux/kdev_t.h>
+# include <linux/ioctl.h>
+# if defined(AFS_LINUX26_ENV)
+# include <linux/backing-dev.h>
+# include <linux/pagemap.h>
+# include <linux/namei.h>
+# ifdef STRUCT_INODE_HAS_I_SECURITY
+# include <linux/security.h>
+# endif
+# include <linux/suspend.h>
+# if defined(LINUX_KEYRING_SUPPORT)
+# include <linux/rwsem.h>
+# include <linux/key.h>
+# if defined(KEY_TYPE_H_EXISTS)
+# include <linux/key-type.h>
+# endif
+# ifndef KEY_ALLOC_IN_QUOTA
+# define KEY_ALLOC_IN_QUOTA 1
+# endif
+# endif
+# endif
/* Avoid conflicts with coda overloading AFS type namespace. Must precede
* inclusion of uaccess.h.
*/
-#ifndef _LINUX_CODA_FS_I
-#define _LINUX_CODA_FS_I
-#define _CODA_HEADER_
-#define _CFS_HEADER_
+# ifndef _LINUX_CODA_FS_I
+# define _LINUX_CODA_FS_I
+# define _CODA_HEADER_
+# define _CFS_HEADER_
struct coda_inode_info {
};
-#endif
-#ifndef _LINUX_XFS_FS_I
-#define _LINUX_XFS_FS_I
+# endif
+# ifndef _LINUX_XFS_FS_I
+# define _LINUX_XFS_FS_I
struct xfs_inode_info {
};
-#endif
-#include <asm/uaccess.h>
-#include <linux/list.h>
-#include <linux/dcache.h>
-#include <linux/mount.h>
-#include <linux/fs.h>
-#include <linux/quota.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#if defined(LINUX_SEMAPHORE_H)
-#include <linux/semaphore.h>
-#else
-#include <asm/semaphore.h>
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
-#include <linux/mutex.h>
-#endif
-#include <linux/errno.h>
-#ifdef COMPLETION_H_EXISTS
-#include <linux/completion.h>
-#endif
-#if defined(LINUX_USE_FH)
-#include <linux/exportfs.h>
-#endif
+# endif
+# include <asm/uaccess.h>
+# include <linux/list.h>
+# include <linux/dcache.h>
+# include <linux/mount.h>
+# include <linux/fs.h>
+# include <linux/quota.h>
+# include <linux/sched.h>
+# include <linux/mm.h>
+# include <linux/slab.h>
+# include <linux/string.h>
+# if defined(LINUX_SEMAPHORE_H)
+# include <linux/semaphore.h>
+# else
+# include <asm/semaphore.h>
+# endif
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+# include <linux/mutex.h>
+# endif
+# include <linux/errno.h>
+# ifdef COMPLETION_H_EXISTS
+# include <linux/completion.h>
+# endif
+# if defined(LINUX_USE_FH)
+# include <linux/exportfs.h>
+# endif
#else /* AFS_LINUX22_ENV */
-#if defined(AFS_DARWIN_ENV)
-#ifndef _MACH_ETAP_H_
-#define _MACH_ETAP_H_
+# if defined(AFS_DARWIN_ENV)
+# ifndef _MACH_ETAP_H_
+# define _MACH_ETAP_H_
typedef unsigned short etap_event_t;
-#endif
-#endif
-#if !defined(AFS_OSF_ENV)
-#include "h/errno.h"
-#include "h/types.h"
-#include "h/param.h"
-
-#ifdef AFS_AUX_ENV
-#ifdef PAGING
-#include "h/mmu.h"
-#include "h/seg.h"
-#include "h/page.h"
-#include "h/region.h"
-#endif /* PAGING */
-#include "h/sysmacros.h"
-#include "h/signal.h"
-#include "h/var.h"
-#endif /* AFS_AUX_ENV */
-
-#include "h/systm.h"
-#include "h/time.h"
-
-#ifdef AFS_AIX_ENV
-#ifdef AFS_AIX41_ENV
-#include "sys/statfs.h"
-#endif
-#ifdef AFS_AIX51_ENV
-#include "sys/acl.h"
-#endif
-#include "../h/file.h"
-#include "../h/fullstat.h"
-#include "../h/vattr.h"
-#include "../h/var.h"
-#include "../h/access.h"
-#endif /* AFS_AIX_ENV */
-
-#if defined(AFS_SGI_ENV)
-#include "values.h"
-#include "sys/sema.h"
-#include "sys/cmn_err.h"
-#ifdef AFS_SGI64_ENV
-#include <ksys/behavior.h>
+# endif
+# endif
+
+# include "h/errno.h"
+# include "h/types.h"
+# include "h/param.h"
+
+# ifdef AFS_AUX_ENV
+# ifdef PAGING
+# include "h/mmu.h"
+# include "h/seg.h"
+# include "h/page.h"
+# include "h/region.h"
+# endif /* PAGING */
+# include "h/sysmacros.h"
+# include "h/signal.h"
+# include "h/var.h"
+# endif /* AFS_AUX_ENV */
+
+# include "h/systm.h"
+# include "h/time.h"
+
+# ifdef AFS_AIX_ENV
+# ifdef AFS_AIX41_ENV
+# include "sys/statfs.h"
+# endif
+# ifdef AFS_AIX51_ENV
+# include "sys/acl.h"
+# endif
+# include "../h/file.h"
+# include "../h/fullstat.h"
+# include "../h/vattr.h"
+# include "../h/var.h"
+# include "../h/access.h"
+# endif /* AFS_AIX_ENV */
+
+# if defined(AFS_SGI_ENV)
+# include "values.h"
+# include "sys/sema.h"
+# include "sys/cmn_err.h"
+# ifdef AFS_SGI64_ENV
+# 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 */
-#include "fs/efs_inode.h"
-#include "sys/kmem.h"
-#include "sys/cred.h"
-#include "sys/resource.h"
+# if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
+# define BHV_IS_BHVL(bhp) (0)
+# endif
+# endif /* AFS_SGI64_ENV */
+# include "fs/efs_inode.h"
+# include "sys/kmem.h"
+# include "sys/cred.h"
+# include "sys/resource.h"
/*
* ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
*
* Instead of using ASSERT(), we use our own osi_Assert().
*/
-#if defined(AFS_SGI65_ENV) && !defined(DEBUG)
-#define DEBUG
-#include "sys/debug.h"
-#undef DEBUG
-#else
-#include "sys/debug.h"
-#endif
+# if defined(AFS_SGI65_ENV) && !defined(DEBUG)
+# define DEBUG
+# include "sys/debug.h"
+# undef DEBUG
+# else
+# include "sys/debug.h"
+# endif
-#include "sys/statvfs.h"
-#include "sys/sysmacros.h"
-#include "sys/fs_subr.h"
-#include "sys/siginfo.h"
-#endif /* AFS_SGI_ENV */
+# include "sys/statvfs.h"
+# include "sys/sysmacros.h"
+# include "sys/fs_subr.h"
+# include "sys/siginfo.h"
+# endif /* AFS_SGI_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
+# if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
# include "h/kernel.h"
-#endif /* !SUN5 && !SGI */
+# endif /* !SUN5 && !SGI */
-#ifdef AFS_SUN5_ENV
-#include <sys/cmn_err.h> /* for kernel printf() prototype */
-#endif
+# ifdef AFS_SUN5_ENV
+# include <sys/cmn_err.h> /* for kernel printf() prototype */
+# endif
-#if defined(AFS_SUN56_ENV)
-#include "h/vfs.h" /* stops SUN56 socketvar.h warnings */
-#include "h/stropts.h" /* stops SUN56 socketvar.h warnings */
-#include "h/stream.h" /* stops SUN56 socketvar.h errors */
-#endif
+# if defined(AFS_SUN56_ENV)
+# include "h/vfs.h" /* stops SUN56 socketvar.h warnings */
+# include "h/stropts.h" /* stops SUN56 socketvar.h warnings */
+# include "h/stream.h" /* stops SUN56 socketvar.h errors */
+# endif
-#ifdef AFS_SUN510_ENV
-#include <sys/cred_impl.h>
-#include <sys/policy.h>
-#endif
+# ifdef AFS_SUN510_ENV
+# include <sys/cred_impl.h>
+# include <sys/policy.h>
+# endif
-#include "h/socket.h"
-#include "h/socketvar.h"
-#include "h/protosw.h"
+# include "h/socket.h"
+# include "h/socketvar.h"
+# include "h/protosw.h"
-#if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
# include "h/dirent.h"
# ifdef AFS_SUN5_ENV
-# include "h/sysmacros.h"
-# include "h/fs/ufs_fsdir.h"
+# include "h/sysmacros.h"
+# include "h/fs/ufs_fsdir.h"
# endif /* AFS_SUN5_ENV */
-#else
+# else
# include "h/dir.h"
-#endif /* SGI || SUN || HPUX */
-
-#if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV)
-#include "h/user.h"
-#endif /* AFS_SGI64_ENV */
-#define MACH_USER_API 1
-#if defined(AFS_FBSD50_ENV)
-#include "h/bio.h"
-#include "h/filedesc.h"
-#endif
-#include "h/file.h"
-#include "h/uio.h"
-#include "h/buf.h"
-#include "h/stat.h"
+# endif /* SGI || SUN || HPUX */
+
+# if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV)
+# include "h/user.h"
+# endif /* AFS_SGI64_ENV */
+# define MACH_USER_API 1
+# if defined(AFS_FBSD50_ENV)
+# include "h/bio.h"
+# include "h/filedesc.h"
+# endif
+# include "h/file.h"
+# include "h/uio.h"
+# include "h/buf.h"
+# include "h/stat.h"
/* ----- The following mainly deal with vnodes/inodes stuff ------ */
-# ifdef AFS_SUN5_ENV
-# include "h/statvfs.h"
-# endif /* AFS_SUN5_ENV */
-# ifdef AFS_HPUX_ENV
-struct vfspage; /* for vnode.h compiler warnings */
-# include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */
-# include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */
-#ifdef AFS_HPUX110_ENV
-# include "h/resource.h"
-#endif
-#ifdef AFS_HPUX1123_ENV
-# include <sys/user.h>
-# include <sys/cred.h>
-#endif
-# endif /* AFS_HPUX_ENV */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+# ifdef AFS_SUN5_ENV
+# include "h/statvfs.h"
+# endif /* AFS_SUN5_ENV */
+# ifdef AFS_HPUX_ENV
+struct vfspage; /* for vnode.h compiler warnings */
+# include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */
+# include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */
+# ifdef AFS_HPUX110_ENV
+# include "h/resource.h"
+# endif
+# ifdef AFS_HPUX1123_ENV
+# include <sys/user.h>
+# include <sys/cred.h>
+# endif
+# endif /* AFS_HPUX_ENV */
+# if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
# if defined(AFS_FBSD50_ENV)
struct vop_getwritemount_args;
# endif
# include <sys/uio.h>
# include <sys/mount.h>
# include <sys/namei.h>
-#ifdef AFS_DARWIN80_ENV
-# include <sys/kauth.h>
-#include <string.h>
-#endif
+# ifdef AFS_DARWIN80_ENV
+# include <sys/kauth.h>
+# include <string.h>
+# endif
# include <sys/vnode.h>
# include <sys/queue.h>
# include <sys/malloc.h>
-#ifndef AFS_FBSD_ENV
-# include <sys/ubc.h>
-#define timeout_fcn_t mach_timeout_fcn_t
-# include <kern/sched_prim.h>
-#else
+# ifndef AFS_FBSD_ENV
+# include <sys/ubc.h>
+# define timeout_fcn_t mach_timeout_fcn_t
+# include <kern/sched_prim.h>
+# else
MALLOC_DECLARE(M_AFS);
-# include <ufs/ufs/dinode.h>
-# include <vm/vm.h>
-# include <vm/vm_extern.h>
-# include <vm/pmap.h>
-# include <vm/vm_map.h>
-# include <sys/lock.h>
-# include <sys/user.h>
-#endif
-#undef timeout_fcn_t
-#define _DIR_H_
-#define doff_t int32_t
-#ifndef AFS_DARWIN80_ENV
-# include <ufs/ufs/quota.h>
-# include <ufs/ufs/inode.h>
-# include <ufs/ffs/fs.h>
-#endif
-#else
+# include <ufs/ufs/dinode.h>
+# include <vm/vm.h>
+# include <vm/vm_extern.h>
+# include <vm/pmap.h>
+# include <vm/vm_map.h>
+# include <sys/lock.h>
+# include <sys/user.h>
+# endif
+# undef timeout_fcn_t
+# define _DIR_H_
+# define doff_t int32_t
+# ifndef AFS_DARWIN80_ENV
+# include <ufs/ufs/quota.h>
+# include <ufs/ufs/inode.h>
+# include <ufs/ffs/fs.h>
+# endif
+# else
# include "h/vfs.h"
# include "h/vnode.h"
# ifdef AFS_SUN5_ENV
-# include "h/fs/ufs_inode.h"
-# include "h/fs/ufs_mount.h"
+# include "h/fs/ufs_inode.h"
+# include "h/fs/ufs_mount.h"
# else
-# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
-# include "ufs/inode.h"
-# if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
-# include "ufs/mount.h"
-# endif /* !AFS_HPUX_ENV */
-# endif /* !AFS_AIX32_ENV */
+# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
+# include "ufs/inode.h"
+# if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
+# include "ufs/mount.h"
+# endif /* !AFS_HPUX_ENV */
+# endif /* !AFS_AIX32_ENV */
# endif /* AFS_SUN5_ENV */
-#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
+# endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
/* These mainly deal with networking and rpc headers */
-#include "netinet/in.h"
-#undef MFREE /* defined at mount.h for AIX */
-#ifdef AFS_SUN5_ENV
+# include "netinet/in.h"
+# undef MFREE /* defined at mount.h for AIX */
+# ifdef AFS_SUN5_ENV
# include "h/time.h"
-#else
-#if !defined(AFS_HPUX_ENV)
-# include "h/mbuf.h"
-#endif
-#endif /* AFS_SUN5_ENV */
+# else
+# if !defined(AFS_HPUX_ENV)
+# include "h/mbuf.h"
+# endif
+# endif /* AFS_SUN5_ENV */
-#include "rpc/types.h"
-#include "rx/xdr.h"
+# include "rpc/types.h"
+# include "rx/xdr.h"
/* Miscellaneous headers */
-#include "h/proc.h"
-#if !defined(AFS_FBSD_ENV)
-#include "h/ioctl.h"
-#endif /* AFS_FBSD_ENV */
-
-#if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
-#include "h/proc_iface.h"
-#include "h/vas.h"
-#endif
+# include "h/proc.h"
+# if !defined(AFS_FBSD_ENV)
+# include "h/ioctl.h"
+# endif /* AFS_FBSD_ENV */
-#if defined(AFS_HPUX102_ENV)
-#include "h/unistd.h"
-#include "h/tty.h"
-#endif
+# if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
+# include "h/proc_iface.h"
+# include "h/vas.h"
+# endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+# if defined(AFS_HPUX102_ENV)
+# include "h/unistd.h"
+# include "h/tty.h"
+# endif
+
+# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
# include "h/text.h"
-#endif
+# endif
-#if defined(AFS_AIX_ENV)
+# if defined(AFS_AIX_ENV)
# include "h/flock.h" /* fcntl.h is a user-level include in aix */
-#else
+# else
# include "h/fcntl.h"
-#endif /* AIX */
+# endif /* AIX */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
# include "h/unistd.h"
-#endif /* SGI || SUN */
+# endif /* SGI || SUN */
-#ifdef AFS_AIX32_ENV
+# ifdef AFS_AIX32_ENV
# include "h/vmuser.h"
-#endif /* AFS_AIX32_ENV */
-
-#if defined(AFS_SUN5_ENV)
-#include <sys/tiuser.h>
-#include <sys/t_lock.h>
-#include <sys/mutex.h>
-#include <sys/vtrace.h>
-#include <sys/pathname.h>
-#include <sys/debug.h>
-#endif
+# endif /* AFS_AIX32_ENV */
-#else /* ! AFS_OSF_ENV */
-/* All of the OSF/1 stuff is here */
-#include <net/net_globals.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <ufs/dir.h>
-#include <sys/user.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/buf.h>
-#include <sys/stat.h>
-#include <sys/vnode.h>
-#include <ufs/inode.h>
-#include <sys/mount.h>
-#include <vm/vm_page.h>
-#include <mach/vm_param.h>
-#include <kern/parallel.h>
-#include <mach/mach_types.h>
-#ifndef AFS_OSF30_ENV
-#include <kern/mfs.h>
-#endif
-#include <mach/vm_param.h>
-#include <kern/parallel.h>
+# if defined(AFS_SUN5_ENV)
+# include <sys/tiuser.h>
+# include <sys/t_lock.h>
+# include <sys/mutex.h>
+# include <sys/vtrace.h>
+# include <sys/pathname.h>
+# include <sys/debug.h>
+# endif
-/* These mainly deal with networking and rpc headers */
-#include <netinet/in.h>
-#include <sys/mbuf.h>
-#include <rpc/types.h>
-
-#ifdef AFS_OSF_ENV
-#undef kmem_alloc
-#undef kmem_free
-#undef mem_alloc
-#undef mem_free
-#undef register
-#endif /* AFS_OSF_ENV */
-
-#include <rx/xdr.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-
-#endif /* AFS_OSF_ENV */
#endif /* AFS_LINUX22_ENV */
-#endif /* AFS_OBSD_ENV */
#endif /* __AFS_SYSINCLUDESH__ so idempotent */