initial-darwin-support-20010327

setup for darwin port

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
changes for darwin port

====================

added files for the darwin port

====================
changes for darwin port
This commit is contained in:
Chaskiel M Grundman 2001-03-27 08:43:13 +00:00 committed by Derrick Brashear
parent 9602e1a3fd
commit a41175cfbb
182 changed files with 5302 additions and 292 deletions

View File

@ -202,7 +202,7 @@ null: project
gtx: project null auth # kauth rxkad ?
case ${SYS_NAME} in \
rs_aix* | sun4x_5? | sgi_6? | *linux*) \
rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin*) \
rm -f ${DESTDIR}lib/afs/libtermlib.a; \
ln -s libnull.a ${DESTDIR}lib/afs/libtermlib.a; \
${COMPILE_PART1} gtx ${COMPILE_PART2};; \
@ -234,6 +234,7 @@ ntp: project volser
case ${SYS_NAME} in \
sun4x_58 ) echo skipping ntp for ${SYS_NAME} ;; \
*linux* ) echo skipping ntp for ${SYS_NAME} ;; \
ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
* ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
esac
@ -252,9 +253,7 @@ bozo: project ntp audit
vfsck: minproject vol
set -x; \
case ${SYS_NAME} in \
sgi_* | *linux*) \
echo skip vfsck for ${SYS_NAME} ;; \
rs_aix42) \
sgi_* | *linux* | rs_aix42 | ppc_darwin* ) \
echo skip vfsck for ${SYS_NAME} ;; \
* ) \
${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
@ -274,6 +273,8 @@ login: project kauth rxkad
${COMPILE_PART1} login ${COMPILE_PART2} ;; \
sun4x_* | hp_ux11* | *linux* ) \
${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
ppc_darwin* ) \
echo Skipping login for ${SYS_NAME} ;; \
* ) \
${COMPILE_PART1} login ${COMPILE_PART2} ;; \
esac
@ -411,12 +412,22 @@ tests: rxtests ubiktests
# pthread based user space RX library
libafsrpc: rx rxkad des
${COMPILE_PART1} libafsrpc ${COMPILE_PART2}
case ${SYS_NAME} in \
alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux*) \
${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
*) \
echo Not building MT libafsrpc for ${SYS_NAME} ;; \
esac
libafsauthent: ubik auth kauth libafsrpc
${COMPILE_PART1} libafsauthent ${COMPILE_PART2}
case ${SYS_NAME} in \
alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux*) \
${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
*) \
echo Not building MT libafsrpc for ${SYS_NAME} ;; \
esac
libadmin: libafsauthent bozo
libadmin_real: libafsauthent bozo
${COMPILE_PART1} libadmin ${COMPILE_PART2}
${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2}
${COMPILE_PART1} libadmin/vos ${COMPILE_PART2}
@ -428,6 +439,19 @@ libadmin: libafsauthent bozo
${COMPILE_PART1} libadmin/test ${COMPILE_PART2}
${COMPILE_PART1} libadmin/samples ${COMPILE_PART2}
libadmin: libafsauthent bozo
case ${SYS_NAME} in \
alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux*) \
$(MAKE) libadmin_real SYS_NAME=$(SYS_NAME) \
WASHTOOL="$(WASHTOOL)" \
COMPILE_PART1="$(COMPILE_PART1)" \
COMPILE_PART2="$(COMPILE_PART2)" \
SRCDIR=$(SRCDIR) DESTDIR=$(DESTDIR) \
DBG_DEFS=$(DBG_DEFS) ;; \
*) \
echo Not building MT libadmin for ${SYS_NAME} ;; \
esac
finale: project cmd comerr afsd allrcmds butc tbutc libafs libuafs audit kauth log package \
ptserver scout bu_utils ubik uss bozo vfsck volser \
venus update xstat afsmonitor dauth tests libafsrpc \
@ -455,6 +479,8 @@ libafs_setup: config minproject export
MKAFS_OSTYPE=IRIX;; \
sun4x_5* ) \
MKAFS_OSTYPE=SOLARIS;; \
ppc_darwin* ) \
MKAFS_OSTYPE=DARWIN;; \
* ) \
echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
esac; \
@ -478,6 +504,8 @@ libuafs_setup: config minproject export
MKAFS_OSTYPE=DUX;; \
sgi_6* ) \
MKAFS_OSTYPE=IRIX;; \
ppc_darwin* ) \
MKAFS_OSTYPE=DARWIN;; \
* ) \
echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
esac; \

View File

@ -27,6 +27,7 @@ A. Creating the proper directory structure.
sun4x_56/
sun4x_57/
sun4x_58/
ppc_darwin_13/
alpha_linux_2216_22/ (DES does not work, will require one more change to
compile)

289
src/afs/DARWIN/osi_file.c Normal file
View File

@ -0,0 +1,289 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
#include "../afs/param.h" /* Should be always first */
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
#include "../afs/afs_stats.h" /* afs statistics */
#include "../afs/osi_inode.h"
int afs_osicred_initialized=0;
struct AFS_UCRED afs_osi_cred;
afs_lock_t afs_xosi; /* lock is for tvattr */
extern struct osi_dev cacheDev;
extern struct mount *afs_cacheVfsp;
int afs_CacheFSType = -1;
/* Initialize the cache operations. Called while initializing cache files. */
void afs_InitDualFSCacheOps(struct vnode *vp)
{
int code;
static int inited = 0;
if (inited)
return;
inited = 1;
if (vp == NULL)
return;
if (strncmp("hfs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0)
afs_CacheFSType = AFS_APPL_HFS_CACHE;
else
if (strncmp("ufs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0)
afs_CacheFSType = AFS_APPL_UFS_CACHE;
else
osi_Panic("Unknown cache vnode type\n");
}
ino_t VnodeToIno(vnode_t *avp)
{
unsigned long ret;
if (afs_CacheFSType == AFS_APPL_UFS_CACHE) {
struct inode *ip = VTOI(avp);
ret=ip->i_number;
}
if (afs_CacheFSType == AFS_APPL_HFS_CACHE) {
#ifndef VTOH
struct vattr va;
if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc()))
osi_Panic("VOP_GETATTR failed in VnodeToIno\n");
ret=va.va_fileid;
#else
struct hfsnode *hp = VTOH(avp);
ret=H_FILEID(hp);
#endif
}
return ret;
}
dev_t VnodeToDev(vnode_t *avp)
{
if (afs_CacheFSType == AFS_APPL_UFS_CACHE) {
struct inode *ip = VTOI(avp);
return ip->i_dev;
}
if (afs_CacheFSType == AFS_APPL_HFS_CACHE) {
#ifndef VTOH /* slow, but works */
struct vattr va;
if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc()))
osi_Panic("VOP_GETATTR failed in VnodeToDev\n");
return va.va_fsid; /* XXX they say it's the dev.... */
#else
struct hfsnode *hp = VTOH(avp);
return H_DEV(hp);
#endif
}
}
void *osi_UFSOpen(ainode)
afs_int32 ainode;
{
struct vnode *vp;
struct vattr va;
register struct osi_file *afile = NULL;
extern int cacheDiskType;
afs_int32 code = 0;
int dummy;
AFS_STATCNT(osi_UFSOpen);
if(cacheDiskType != AFS_FCACHE_TYPE_UFS) {
osi_Panic("UFSOpen called for non-UFS cache\n");
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
afs_osi_cred.cr_ref++;
afs_osi_cred.cr_ngroups=1;
afs_osicred_initialized = 1;
}
afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
if (afs_CacheFSType == AFS_APPL_HFS_CACHE)
code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, &ainode, &vp, &va, &dummy); /* XXX hfs is broken */
else
code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &vp, &va, &dummy);
AFS_GLOCK();
if (code) {
osi_FreeSmallSpace(afile);
osi_Panic("UFSOpen: igetinode failed");
}
afile->vnode = vp;
afile->size = va.va_size;
afile->offset = 0;
afile->proc = (int (*)()) 0;
afile->inum = ainode; /* for hint validity checking */
return (void *)afile;
}
afs_osi_Stat(afile, astat)
register struct osi_file *afile;
register struct osi_stat *astat; {
register afs_int32 code;
struct vattr tvattr;
AFS_STATCNT(osi_Stat);
MObtainWriteLock(&afs_xosi,320);
AFS_GUNLOCK();
code=VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc());
AFS_GLOCK();
if (code == 0) {
astat->size = tvattr.va_size;
astat->blksize = tvattr.va_blocksize;
astat->mtime = tvattr.va_mtime.tv_sec;
astat->atime = tvattr.va_atime.tv_sec;
}
MReleaseWriteLock(&afs_xosi);
return code;
}
osi_UFSClose(afile)
register struct osi_file *afile;
{
AFS_STATCNT(osi_Close);
if(afile->vnode) {
AFS_RELE(afile->vnode);
}
osi_FreeSmallSpace(afile);
return 0;
}
osi_UFSTruncate(afile, asize)
register struct osi_file *afile;
afs_int32 asize; {
struct AFS_UCRED *oldCred;
struct vattr tvattr;
register afs_int32 code;
struct osi_stat tstat;
AFS_STATCNT(osi_Truncate);
/* This routine only shrinks files, and most systems
* have very slow truncates, even when the file is already
* small enough. Check now and save some time.
*/
code = afs_osi_Stat(afile, &tstat);
if (code || tstat.size <= asize) return code;
MObtainWriteLock(&afs_xosi,321);
VATTR_NULL(&tvattr);
tvattr.va_size = asize;
AFS_GUNLOCK();
code=VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc());
AFS_GLOCK();
MReleaseWriteLock(&afs_xosi);
return code;
}
void osi_DisableAtimes(avp)
struct vnode *avp;
{
if (afs_CacheFSType == AFS_APPL_UFS_CACHE) {
struct inode *ip = VTOI(avp);
ip->i_flag &= ~IN_ACCESS;
}
#ifdef VTOH /* can't do this without internals */
else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) {
struct hfsnode *hp = VTOH(avp);
hp->h_nodeflags &= ~IN_ACCESS;
}
#endif
}
/* Generic read interface */
afs_osi_Read(afile, offset, aptr, asize)
register struct osi_file *afile;
int offset;
char *aptr;
afs_int32 asize; {
struct AFS_UCRED *oldCred;
unsigned int resid;
register afs_int32 code;
AFS_STATCNT(osi_Read);
/**
* If the osi_file passed in is NULL, panic only if AFS is not shutting
* down. No point in crashing when we are already shutting down
*/
if ( !afile ) {
if ( !afs_shuttingdown )
osi_Panic("osi_Read called with null param");
else
return EIO;
}
if (offset != -1) afile->offset = offset;
AFS_GUNLOCK();
code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset,
AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid);
AFS_GLOCK();
if (code == 0) {
code = asize - resid;
afile->offset += code;
osi_DisableAtimes(afile->vnode);
}
else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
code = -1;
}
return code;
}
/* Generic write interface */
afs_osi_Write(afile, offset, aptr, asize)
register struct osi_file *afile;
char *aptr;
afs_int32 offset;
afs_int32 asize; {
struct AFS_UCRED *oldCred;
unsigned int resid;
register afs_int32 code;
AFS_STATCNT(osi_Write);
if ( !afile )
osi_Panic("afs_osi_Write called with null param");
if (offset != -1) afile->offset = offset;
{
AFS_GUNLOCK();
code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid);
AFS_GLOCK();
}
if (code == 0) {
code = asize - resid;
afile->offset += code;
}
else {
code = -1;
}
if (afile->proc) {
(*afile->proc)(afile, code);
}
return code;
}
void
shutdown_osifile()
{
extern int afs_cold_shutdown;
AFS_STATCNT(shutdown_osifile);
if (afs_cold_shutdown) {
afs_osicred_initialized = 0;
}
}

169
src/afs/DARWIN/osi_groups.c Normal file
View File

@ -0,0 +1,169 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/*
* osi_groups.c
*
* Implements:
* Afs_xsetgroups (syscall)
* setpag
*
*/
#include "../afs/param.h"
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include "../afs/afs_stats.h" /* statistics */
static int
afs_getgroups(
struct ucred *cred,
int ngroups,
gid_t *gidset);
static int
afs_setgroups(
struct proc *proc,
struct ucred **cred,
int ngroups,
gid_t *gidset,
int change_parent);
int
Afs_xsetgroups(p, args, retval)
struct proc *p;
void *args;
int *retval;
{
int code = 0;
struct vrequest treq;
struct ucred *cr;
pcred_readlock(p);
cr=crdup(p->p_cred->pc_ucred);
pcred_unlock(p);
AFS_STATCNT(afs_xsetgroups);
AFS_GLOCK();
code = afs_InitReq(&treq, cr);
AFS_GUNLOCK();
crfree(cr);
if (code) return setgroups(p, args, retval); /* afs has shut down */
code = setgroups(p, args, retval);
/* Note that if there is a pag already in the new groups we don't
* overwrite it with the old pag.
*/
pcred_readlock(p);
cr=crdup(p->p_cred->pc_ucred);
pcred_unlock(p);
if (PagInCred(cr) == NOPAG) {
if (((treq.uid >> 24) & 0xff) == 'A') {
AFS_GLOCK();
/* we've already done a setpag, so now we redo it */
AddPag(p, treq.uid, &cr );
AFS_GUNLOCK();
}
}
crfree(cr);
return code;
}
int
setpag(proc, cred, pagvalue, newpag, change_parent)
struct proc *proc;
struct ucred **cred;
afs_uint32 pagvalue;
afs_uint32 *newpag;
afs_uint32 change_parent;
{
gid_t gidset[NGROUPS];
int ngroups, code;
int j;
AFS_STATCNT(setpag);
ngroups = afs_getgroups(*cred, NGROUPS, gidset);
if (afs_get_pag_from_groups(gidset[1], gidset[2]) == NOPAG) {
/* We will have to shift grouplist to make room for pag */
if (ngroups + 2 > NGROUPS) {
return (E2BIG);
}
for (j = ngroups -1; j >= 1; j--) {
gidset[j+2] = gidset[j];
}
ngroups += 2;
}
*newpag = (pagvalue == -1 ? genpag(): pagvalue);
afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]);
code = afs_setgroups(proc, cred, ngroups, gidset, change_parent);
return code;
}
static int
afs_getgroups(
struct ucred *cred,
int ngroups,
gid_t *gidset)
{
int ngrps, savengrps;
gid_t *gp;
AFS_STATCNT(afs_getgroups);
savengrps = ngrps = MIN(ngroups, cred->cr_ngroups);
gp = cred->cr_groups;
while (ngrps--)
*gidset++ = *gp++;
return savengrps;
}
static int
afs_setgroups(
struct proc *proc,
struct ucred **cred,
int ngroups,
gid_t *gidset,
int change_parent)
{
int ngrps;
int i;
gid_t *gp;
struct ucred *oldcr, *cr;
AFS_STATCNT(afs_setgroups);
/*
* The real setgroups() call does this, so maybe we should too.
*
*/
if (ngroups > NGROUPS)
return EINVAL;
cr = *cred;
cr->cr_ngroups = ngroups;
gp = cr->cr_groups;
while (ngroups--)
*gp++ = *gidset++;
if (change_parent) {
crhold(cr);
pcred_writelock(proc->p_pptr);
oldcr=proc->p_pptr->p_cred->pc_ucred;
proc->p_pptr->p_cred->pc_ucred=cr;
pcred_unlock(proc->p_pptr);
crfree(oldcr);
}
crhold(cr);
pcred_writelock(proc);
oldcr=proc->p_cred->pc_ucred;
proc->p_cred->pc_ucred=cr;
pcred_unlock(proc);
crfree(oldcr);
return(0);
}

317
src/afs/DARWIN/osi_inode.c Normal file
View File

@ -0,0 +1,317 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/*
* MACOS inode operations
*
* Implements:
*
*/
#include "../afs/param.h" /* Should be always first */
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
#include "../afs/osi_inode.h"
#include "../afs/afs_stats.h" /* statistics stuff */
#include <ufs/ufs/ufsmount.h>
extern struct ucred afs_osi_cred;
getinode(fs, dev, inode, vpp, perror)
struct mount *fs;
struct vnode **vpp;
dev_t dev;
ino_t inode;
int *perror;
{
struct vnode *vp;
int code;
*vpp = 0;
*perror = 0;
if (!fs) {
register struct ufsmount *ump;
#ifdef VFSTOHFS
register struct hfsmount *hmp;
#endif
register struct vnode *vp;
register struct mount *mp;
extern struct mount *rootfs;
if (mp = rootfs) do {
/*
* XXX Also do the test for MFS
*/
if (!strcmp(mp->mnt_vfc->vfc_name, "ufs")) {
ump = VFSTOUFS(mp);
if (ump->um_fs == NULL)
break;
if (ump->um_dev == dev) {
fs = ump->um_mountp;
}
}
#ifdef VFSTOHFS
if (!strcmp(mp->mnt_vfc->vfc_name, "hfs")) {
hmp = VFSTOHFS(mp);
#if 0
if (hmp->hfs_mp == NULL)
break;
#endif
if (hmp->hfs_raw_dev == dev) {
fs = hmp->hfs_mp;
}
}
#endif
mp = CIRCLEQ_NEXT(mp, mnt_list);
} while (mp != rootfs);
if (!fs)
return(ENXIO);
}
code=VFS_VGET(fs, (void *)inode, &vp);
if (code) {
*perror = BAD_IGET;
return code;
} else {
*vpp = vp;
return(0);
}
}
extern int afs_CacheFSType;
igetinode(vfsp, dev, inode, vpp, va, perror)
struct vnode **vpp;
struct mount *vfsp;
dev_t dev;
ino_t inode;
struct vattr *va;
int *perror;
{
struct vnode *pvp, *vp;
extern struct osi_dev cacheDev;
register int code = 0;
*perror = 0;
AFS_STATCNT(igetinode);
if ((code = getinode(vfsp, dev, inode, &vp, perror)) != 0) {
return(code);
}
if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK) {
printf("igetinode: bad type %d\n", vp->v_type);
iforget(vp);
return(ENOENT);
}
VOP_GETATTR(vp, va, &afs_osi_cred, current_proc());
if (va->va_mode == 0) {
/* Not an allocated inode */
iforget(vp);
return(ENOENT);
}
if (vfsp && afs_CacheFSType == AFS_APPL_HFS_CACHE && va->va_nlink == 0) {
printf("igetinode: hfs nlink 0\n");
}
if (va->va_nlink == 0) {
vput(vp);
return(ENOENT);
}
VOP_UNLOCK(vp, 0, current_proc());
*vpp = vp;
return(0);
}
iforget(vp)
struct vnode *vp;
{
AFS_STATCNT(iforget);
/* XXX could sleep */
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, current_proc());
/* this whole thing is too wierd. Why??? XXX */
if (vp->v_usecount == 1) {
vp->v_usecount=0;
VOP_UNLOCK(vp,0, current_proc());
#if 0
simple_lock(&vnode_free_list_slock);
TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist);
freevnodes++;
simple_unlock(&vnode_free_list_slock);
#else
printf("iforget: leaking vnode\n");
#endif
} else {
vput(vp);
}
}
#if 0
/*
* icreate system call -- create an inode
*/
afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval)
long *retval;
long dev, near_inode, param1, param2, param3, param4;
{
int dummy, err=0;
struct inode *ip, *newip;
register int code;
struct vnode *vp;
AFS_STATCNT(afs_syscall_icreate);
if (!afs_suser())
return(EPERM);
code = getinode(0, (dev_t)dev, 2, &ip, &dummy);
if (code) {
return(ENOENT);
}
code = ialloc(ip, (ino_t)near_inode, 0, &newip);
iput(ip);
if (code) {
return(code);
}
IN_LOCK(newip);
newip->i_flag |= IACC|IUPD|ICHG;
newip->i_nlink = 1;
newip->i_mode = IFREG;
IN_UNLOCK(newip);
vp = ITOV(newip);
VN_LOCK(vp);
vp->v_type = VREG;
VN_UNLOCK(vp);
if ( !vp->v_object)
{
extern struct vfs_ubcops ufs_ubcops;
extern struct vm_ubc_object* ubc_object_allocate();
struct vm_ubc_object* vop;
vop = ubc_object_allocate(&vp, &ufs_ubcops,
vp->v_mount->m_funnel);
VN_LOCK(vp);
vp->v_object = vop;
VN_UNLOCK(vp);
}
IN_LOCK(newip);
newip->i_flags |= IC_XUID|IC_XGID;
newip->i_flags &= ~IC_PROPLIST;
newip->i_vicep1 = param1;
if (param2 == 0x1fffffff/*INODESPECIAL*/) {
newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3));
newip->i_vicep3a = (u_short)(param3 >> 16);
newip->i_vicep3b = (u_short)param3;
} else {
newip->i_vicep2 = (((param2 >> 16) & 0x1f) << 27) +
(((param4 >> 16) & 0x1f) << 22) +
(param3 & 0x3fffff);
newip->i_vicep3a = (u_short)param4;
newip->i_vicep3b = (u_short)param2;
}
newip->i_vicemagic = VICEMAGIC;
*retval = newip->i_number;
IN_UNLOCK(newip);
iput(newip);
return(code);
}
afs_syscall_iopen(dev, inode, usrmod, retval)
long *retval;
int dev, inode, usrmod;
{
struct file *fp;
struct inode *ip;
struct vnode *vp = (struct vnode *)0;
int dummy;
int fd;
extern struct fileops vnops;
register int code;
AFS_STATCNT(afs_syscall_iopen);
if (!afs_suser())
return(EPERM);
code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy);
if (code) {
return(code);
}
if ((code = falloc(&fp, &fd)) != 0) {
iput(ip);
return(code);
}
IN_UNLOCK(ip);
FP_LOCK(fp);
fp->f_flag = (usrmod-FOPEN) & FMASK;
fp->f_type = DTYPE_VNODE;
fp->f_ops = &vnops;
fp->f_data = (caddr_t)ITOV(ip);
FP_UNLOCK(fp);
U_FD_SET(fd, fp, &u.u_file_state);
*retval = fd;
return(0);
}
/*
* Support for iinc() and idec() system calls--increment or decrement
* count on inode.
* Restricted to super user.
* Only VICEMAGIC type inodes.
*/
afs_syscall_iincdec(dev, inode, inode_p1, amount)
int dev, inode, inode_p1, amount;
{
int dummy;
struct inode *ip;
register int code;
if (!afs_suser())
return(EPERM);
code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy);
if (code) {
return(code);
}
if (!IS_VICEMAGIC(ip)) {
return(EPERM);
} else if (ip->i_vicep1 != inode_p1) {
return(ENXIO);
}
ip->i_nlink += amount;
if (ip->i_nlink == 0) {
CLEAR_VICEMAGIC(ip);
}
ip->i_flag |= ICHG;
iput(ip);
return(0);
}
#else
afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval)
long *retval;
long dev, near_inode, param1, param2, param3, param4;
{
return EOPNOTSUPP;
}
afs_syscall_iopen(dev, inode, usrmod, retval)
long *retval;
int dev, inode, usrmod;
{
return EOPNOTSUPP;
}
afs_syscall_iincdec(dev, inode, inode_p1, amount)
int dev, inode, inode_p1, amount;
{
return EOPNOTSUPP;
}
#endif

View File

@ -0,0 +1,42 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/*
* osi_inode.h
*
* Inode information required for MACOS servers and salvager.
*/
#ifndef _OSI_INODE_H_
#define _OSI_INODE_H_
#define BAD_IGET -1000
#define VICEMAGIC 0x84fa1cb6
#define DI_VICEP3(p) ((p)->di_vicep3)
#define I_VICEP3(p) ((p)->i_vicep3)
#define i_vicemagic i_din.di_flags
#define i_vicep1 i_din.di_gen
#define i_vicep2 i_din.di_uid
#define i_vicep3 i_din.di_gid
#define i_vicep4 i_din.di_spare[0] /* not used */
#define di_vicemagic di_flags
#define di_vicep1 di_gen
#define di_vicep2 di_uid
#define di_vicep3 di_gid
#define di_vicep4 di_spare[0] /* not used */
#define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC)
#define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC)
#define CLEAR_VICEMAGIC(ip) (ip)->i_vicemagic = 0
#define CLEAR_DVICEMAGIC(dp) (dp)->di_vicemagic = 0
#endif /* _OSI_INODE_H_ */

View File

@ -0,0 +1,109 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/*
*
* MACOS 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
* afs_osi.h.
*/
#ifndef _OSI_MACHDEP_H_
#define _OSI_MACHDEP_H_
#ifdef XAFS_DARWIN_ENV
#ifndef _MACH_ETAP_H_
#define _MACH_ETAP_H_
typedef unsigned short etap_event_t;
#endif
#endif
#include <sys/lock.h>
#include <kern/thread.h>
#include <sys/user.h>
#define getpid() current_proc()->p_pid
#define getppid() current_proc()->p_pptr->p_pid
#undef gop_lookupname
#define gop_lookupname osi_lookupname
#define FTRUNC 0
/* vcexcl - used only by afs_create */
enum vcexcl { EXCL, NONEXCL } ;
/*
* Time related macros
*/
extern struct timeval time;
#define osi_Time() (time.tv_sec)
#define afs_hz hz
#define PAGESIZE 8192
#define AFS_UCRED ucred
#define AFS_PROC struct proc
#define osi_vnhold(avc,r) do { \
if ((avc)->vrefCount) { VN_HOLD(&((avc)->v)); } \
else (avc)->vrefCount = 1; } while(0)
#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid),current_proc())
#undef afs_suser
#ifdef KERNEL
extern thread_t afs_global_owner;
/* simple locks cannot be used since sleep can happen at any time */
/* Should probably use mach locks rather than bsd locks, since we use the
mach thread control api's elsewhere (mach locks not used for consistency
with rx, since rx needs lock_write_try() in order to use mach locks
*/
extern struct lock__bsd__ afs_global_lock;
#define AFS_GLOCK() \
do { \
lockmgr(&afs_global_lock, LK_EXCLUSIVE, 0, current_proc()); \
osi_Assert(afs_global_owner == 0); \
afs_global_owner = current_thread(); \
} while (0)
#define AFS_GUNLOCK() \
do { \
osi_Assert(afs_global_owner == current_thread()); \
afs_global_owner = 0; \
lockmgr(&afs_global_lock, LK_RELEASE, 0, current_proc()); \
} while(0)
#define ISAFS_GLOCK() (afs_global_owner == current_thread())
#define AFS_RXGLOCK()
#define AFS_RXGUNLOCK()
#define ISAFS_RXGLOCK() 1
#define SPLVAR
#define NETPRI
#define USERPRI
#if 0
#undef SPLVAR
#define SPLVAR int x;
#undef NETPRI
#define NETPRI x=splnet();
#undef USERPRI
#define USERPRI splx(x);
#endif
#define AFS_APPL_UFS_CACHE 1
#define AFS_APPL_HFS_CACHE 2
extern ino_t VnodeToIno(vnode_t *vp);
extern dev_t VnodeToDev(vnode_t *vp);
#endif /* KERNEL */
#endif /* _OSI_MACHDEP_H_ */

54
src/afs/DARWIN/osi_misc.c Normal file
View File

@ -0,0 +1,54 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
#include "../afs/param.h"
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include <sys/namei.h>
int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
struct vnode **dirvpp, struct vnode **vpp)
{
struct nameidata n;
int flags,error;
flags=0;
flags=LOCKLEAF;
if (followlink)
flags|=FOLLOW;
else
flags|=NOFOLLOW;
/* if (dirvpp) flags|=WANTPARENT;*/ /* XXX LOCKPARENT? */
NDINIT(&n, LOOKUP, flags, seg, aname, current_proc());
if (error=namei(&n))
return error;
*vpp=n.ni_vp;
/*
if (dirvpp)
*dirvpp = n.ni_dvp;
#/
/* should we do this? */
VOP_UNLOCK(n.ni_vp, 0, current_proc());
return 0;
}
/*
* afs_suser() returns true if the caller is superuser, false otherwise.
*
* Note that it must NOT set errno.
*/
afs_suser() {
int error;
struct proc *p=current_proc();
if ((error = suser(p->p_ucred, &p->p_acflag)) == 0) {
return(1);
}
return(0);
}

View File

@ -0,0 +1,58 @@
#include "../afs/param.h"
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include "../sys/syscall.h"
#include <mach/kmod.h>
#define VERSION "1.0.3"
struct vfsconf afs_vfsconf;
extern struct vfsops afs_vfsops;
extern struct mount *afs_globalVFS;
extern int Afs_xsetgroups();
extern int afs_xioctl();
extern int afs3_syscall();
extern int ioctl();
extern int setgroups();
kern_return_t afs_modload(struct kmod_info *ki, void *data)
{
if (sysent[AFS_SYSCALL].sy_call != nosys) {
printf("AFS_SYSCALL in use. aborting\n");
return KERN_FAILURE;
}
bzero(&afs_vfsconf, sizeof(struct vfsconf));
strcpy(afs_vfsconf.vfc_name, "afs");
afs_vfsconf.vfc_vfsops=&afs_vfsops;
afs_vfsconf.vfc_typenum=VT_AFS;
afs_vfsconf.vfc_flags=MNT_NODEV;
if (vfsconf_add(&afs_vfsconf)) {
printf("AFS: vfsconf_add failed. aborting\n");
return KERN_FAILURE;
}
sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
sysent[SYS_ioctl].sy_call=afs_xioctl;
sysent[AFS_SYSCALL].sy_call=afs3_syscall;
sysent[AFS_SYSCALL].sy_narg = 5;
sysent[AFS_SYSCALL].sy_parallel = 0;
#ifdef KERNEL_FUNNEL
sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL;
#endif
return KERN_SUCCESS;
}
kern_return_t afs_modunload(struct kmod_info *ki, void *data)
{
if (afs_globalVFS)
return KERN_FAILURE;
if (vfsconf_del("afs"))
return KERN_FAILURE;
/* give up syscall entries for ioctl & setgroups, which we've stolen */
sysent[SYS_ioctl].sy_call = ioctl;
sysent[SYS_setgroups].sy_call = setgroups;
/* give up the stolen syscall entry */
sysent[AFS_SYSCALL].sy_narg = 0;
sysent[AFS_SYSCALL].sy_call = nosys;
return KERN_SUCCESS;
}
KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)

View File

@ -0,0 +1,23 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/*
* osi_prototypes.h
*
* Exported macos support routines.
*/
#ifndef _OSI_PROTO_H_
#define _OSI_PROTO_H_
/* osi_misc.c */
extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
struct vnode **dirvpp, struct vnode **vpp);
/* osi_vm.c */
extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size);
extern int osi_VM_Setup(struct vcache *avc);
#endif /* _OSI_PROTO_H_ */

186
src/afs/DARWIN/osi_sleep.c Normal file
View File

@ -0,0 +1,186 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
#include "../afs/param.h" /* Should be always first */
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
#include "../afs/afs_stats.h" /* afs statistics */
static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
void afs_osi_Wakeup(char *event);
void afs_osi_Sleep(char *event);
static char waitV;
void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle)
{
AFS_STATCNT(osi_InitWaitHandle);
achandle->proc = (caddr_t) 0;
}
/* cancel osi_Wait */
void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle)
{
caddr_t proc;
AFS_STATCNT(osi_CancelWait);
proc = achandle->proc;
if (proc == 0) return;
achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */
afs_osi_Wakeup(&waitV);
}
/* afs_osi_Wait
* Waits for data on ahandle, or ams ms later. ahandle may be null.
* Returns 0 if timeout and EINTR if signalled.
*/
int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
{
int code;
afs_int32 endTime, tid;
struct proc *p=current_proc();
AFS_STATCNT(osi_Wait);
endTime = osi_Time() + (ams/1000);
if (ahandle)
ahandle->proc = (caddr_t)p;
do {
AFS_ASSERT_GLOCK();
code = 0;
code = osi_TimedSleep(&waitV, ams, aintok);
if (code) break; /* if something happened, quit now */
/* if we we're cancelled, quit now */
if (ahandle && (ahandle->proc == (caddr_t) 0)) {
/* we've been signalled */
break;
}
} while (osi_Time() < endTime);
return code;
}
typedef struct afs_event {
struct afs_event *next; /* next in hash chain */
char *event; /* lwp event: an address */
int refcount; /* Is it in use? */
int seq; /* Sequence number: this is incremented
by wakeup calls; wait will not return until
it changes */
} afs_event_t;
#define HASHSIZE 128
afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */
#define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1));
int afs_evhashcnt = 0;
/* Get and initialize event structure corresponding to lwp event (i.e. address)
* */
static afs_event_t *afs_getevent(char *event)
{
afs_event_t *evp, *newp = 0;
int hashcode;
AFS_ASSERT_GLOCK();
hashcode = afs_evhash(event);
evp = afs_evhasht[hashcode];
while (evp) {
if (evp->event == event) {
evp->refcount++;
return evp;
}
if (evp->refcount == 0)
newp = evp;
evp = evp->next;
}
if (!newp) {
newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
newp->seq = 0;
}
newp->event = event;
newp->refcount = 1;
return newp;
}
/* Release the specified event */
#define relevent(evp) ((evp)->refcount--)
void afs_osi_Sleep(char *event)
{
struct afs_event *evp;
int seq;
evp = afs_getevent(event);
seq = evp->seq;
while (seq == evp->seq) {
AFS_ASSERT_GLOCK();
assert_wait((event_t)event, 0);
AFS_GUNLOCK();
thread_block(0);
AFS_GLOCK();
}
relevent(evp);
}
/* osi_TimedSleep
*
* Arguments:
* event - event to sleep on
* ams --- max sleep time in milliseconds
* aintok - 1 if should sleep interruptibly
*
* Returns 0 if timeout and EINTR if signalled.
*/
static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
{
int code = 0;
struct afs_event *evp;
int ticks,seq;
ticks = ( ams * afs_hz )/1000;
evp = afs_getevent(event);
seq=evp->seq;
assert_wait((event_t)event, aintok ? THREAD_ABORTSAFE : 0);
AFS_GUNLOCK();
thread_set_timer(ticks, NSEC_PER_SEC / hz);
thread_block(0);
AFS_GLOCK();
#if 0 /* thread_t structure only available if MACH_KERNEL_PRIVATE */
if (current_thread()->wait_result != THREAD_AWAKENED)
code = EINTR;
#else
if (seq == evp->seq)
code = EINTR;
#endif
relevent(evp);
return code;
}
void afs_osi_Wakeup(char *event)
{
struct afs_event *evp;
evp = afs_getevent(event);
if (evp->refcount > 1) {
evp->seq++;
thread_wakeup((event_t)event);
}
relevent(evp);
}

295
src/afs/DARWIN/osi_vfsops.c Normal file
View File

@ -0,0 +1,295 @@
#include <afs/param.h> /* Should be always first */
#include <afs/sysincludes.h> /* Standard vendor system headers */
#include <afs/afsincludes.h> /* Afs-based standard headers */
#include <afs/afs_stats.h> /* statistics */
#include <sys/malloc.h>
#include <sys/namei.h>
#include <sys/conf.h>
#include <sys/syscall.h>
struct vcache *afs_globalVp = 0;
struct mount *afs_globalVFS = 0;
int
afs_quotactl()
{
return EOPNOTSUPP;
}
int
afs_fhtovp(mp, fhp, vpp)
struct mount *mp;
struct fid *fhp;
struct vnode **vpp;
{
return (EINVAL);
}
int
afs_vptofh(vp, fhp)
struct vnode *vp;
struct fid *fhp;
{
return (EINVAL);
}
int
afs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0); /* nothing to do. ? */
}
int
afs_mount(mp, path, data, ndp, p)
register struct mount *mp;
char *path;
caddr_t data;
struct nameidata *ndp;
struct proc *p;
{
/* ndp contains the mounted-from device. Just ignore it.
we also don't care about our proc struct. */
size_t size;
int error;
if (mp->mnt_flag & MNT_UPDATE)
return EINVAL;
AFS_GLOCK();
AFS_STATCNT(afs_mount);
if (afs_globalVFS) { /* Don't allow remounts. */
AFS_GUNLOCK();
return (EBUSY);
}
afs_globalVFS = mp;
mp->vfs_bsize = 8192;
vfs_getnewfsid(mp);
mp->mnt_stat.f_iosize=8192;
(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size);
bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
strcpy(mp->mnt_stat.f_mntfromname, "AFS");
/* null terminated string "AFS" will fit, just leave it be. */
strcpy(mp->mnt_stat.f_fstypename, "afs");
AFS_GUNLOCK();
(void) afs_statfs(mp, &mp->mnt_stat, p);
return 0;
}
int
afs_unmount(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
AFS_GLOCK();
AFS_STATCNT(afs_unmount);
afs_globalVFS = 0;
afs_shutdown();
AFS_GUNLOCK();
return 0;
}
int
afs_root(struct mount *mp,
struct vnode **vpp)
{
int error;
struct vrequest treq;
register struct vcache *tvp=0;
struct proc *p=current_proc();
struct ucred cr;
pcred_readlock(p);
cr=*p->p_cred->pc_ucred;
pcred_unlock(p);
AFS_GLOCK();
AFS_STATCNT(afs_root);
if (afs_globalVp && (afs_globalVp->states & CStatd)) {
tvp = afs_globalVp;
error=0;
} else {
if (!(error = afs_InitReq(&treq, &cr)) &&
!(error = afs_CheckInit())) {
tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
(struct vcache*)0, WRITE_LOCK);
/* we really want this to stay around */
if (tvp) {
afs_globalVp = tvp;
} else
error = ENOENT;
}
}
if (tvp) {
osi_vnhold(tvp,0);
AFS_GUNLOCK();
vn_lock((struct vnode *)tvp, LK_EXCLUSIVE | LK_RETRY, p);
AFS_GLOCK();
afs_globalVFS = mp;
*vpp = (struct vnode *) tvp;
tvp->v.v_flag |= VROOT;
}
afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *vpp,
ICL_TYPE_INT32, error);
AFS_GUNLOCK();
return error;
}
int
afs_vget(mp, lfl, vp)
struct mount *mp;
struct vnode *vp;
int lfl;
{
int error;
printf("vget called. help!\n");
if (vp->v_usecount < 0) {
vprint("bad usecount", vp);
panic("afs_vget");
}
error = vget(vp, lfl, current_proc());
if (!error)
insmntque(vp, afs_globalVFS); /* take off free list */
return error;
}
int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p)
{
AFS_GLOCK();
AFS_STATCNT(afs_statfs);
#if 0
abp->f_type = MOUNT_AFS;
#endif
abp->f_bsize = mp->vfs_bsize;
abp->f_iosize = mp->vfs_bsize;
/* Fake a high number below to satisfy programs that use the statfs call
* to make sure that there's enough space in the device partition before
* storing something there.
*/
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
abp->f_ffree = 2000000;
abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0];
abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];
if (abp != &mp->mnt_stat) {
abp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy((caddr_t)mp->mnt_stat.f_mntonname,
(caddr_t)&abp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&abp->f_mntfromname[0], MNAMELEN);
}
AFS_GUNLOCK();
return 0;
}
int afs_sync(mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct prioc *p;
{
return 0;
}
int afs_sysctl() {
return EOPNOTSUPP;
}
typedef (*PFI)();
extern int vfs_opv_numops; /* The total number of defined vnode operations */
extern struct vnodeopv_desc afs_vnodeop_opv_desc;
int afs_init(struct vfsconf *vfc) {
int j;
int (**opv_desc_vector)();
struct vnodeopv_entry_desc *opve_descp;
MALLOC(afs_vnodeop_p, PFI *, vfs_opv_numops*sizeof(PFI), M_TEMP, M_WAITOK);
bzero (afs_vnodeop_p, vfs_opv_numops*sizeof(PFI));
opv_desc_vector = afs_vnodeop_p;
for (j=0; afs_vnodeop_opv_desc.opv_desc_ops[j].opve_op; j++) {
opve_descp = &(afs_vnodeop_opv_desc.opv_desc_ops[j]);
/*
* Sanity check: is this operation listed
* in the list of operations? We check this
* by seeing if its offest is zero. Since
* the default routine should always be listed
* first, it should be the only one with a zero
* offset. Any other operation with a zero
* offset is probably not listed in
* vfs_op_descs, and so is probably an error.
*
* A panic here means the layer programmer
* has committed the all-too common bug
* of adding a new operation to the layer's
* list of vnode operations but
* not adding the operation to the system-wide
* list of supported operations.
*/
if (opve_descp->opve_op->vdesc_offset == 0 &&
opve_descp->opve_op->vdesc_offset != VOFFSET(vop_default)) {
printf("afs_init: operation %s not listed in %s.\n",
opve_descp->opve_op->vdesc_name,
"vfs_op_descs");
panic ("load_afs: bad operation");
}
/*
* Fill in this entry.
*/
opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
opve_descp->opve_impl;
}
/*
* Finally, go back and replace unfilled routines
* with their default. (Sigh, an O(n^3) algorithm. I
* could make it better, but that'd be work, and n is small.)
*/
/*
* Force every operations vector to have a default routine.
*/
opv_desc_vector = afs_vnodeop_p;
if (opv_desc_vector[VOFFSET(vop_default)]==NULL) {
panic("afs_init: operation vector without default routine.");
}
for (j = 0;j<vfs_opv_numops; j++)
if (opv_desc_vector[j] == NULL)
opv_desc_vector[j] =
opv_desc_vector[VOFFSET(vop_default)];
}
struct vfsops afs_vfsops = {
afs_mount,
afs_start,
afs_unmount,
afs_root,
afs_quotactl,
afs_statfs,
afs_sync,
afs_vget,
afs_fhtovp,
afs_vptofh,
afs_init,
afs_sysctl
};

311
src/afs/DARWIN/osi_vm.c Normal file
View File

@ -0,0 +1,311 @@
/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
#include "../afs/param.h" /* Should be always first */
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
#include "../afs/afs_stats.h" /* statistics */
#include <sys/ubc.h>
/* Try to discard pages, in order to recycle a vcache entry.
*
* We also make some sanity checks: ref count, open count, held locks.
*
* We also do some non-VM-related chores, such as releasing the cred pointer
* (for AIX and Solaris) and releasing the gnode (for AIX).
*
* Locking: afs_xvcache lock is held. If it is dropped and re-acquired,
* *slept should be set to warn the caller.
*
* Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
* is not dropped and re-acquired for any platform. It may be that *slept is
* therefore obsolescent.
*
* OSF/1 Locking: VN_LOCK has been called.
*/
int
osi_VM_FlushVCache(avc, slept)
struct vcache *avc;
int *slept;
{
struct vnode *vp=(struct vnode *)avc;
if (avc->vrefCount)
return EBUSY;
if (avc->opens)
return EBUSY;
/* if a lock is held, give up */
if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock))
return EBUSY;
AFS_GUNLOCK();
cache_purge(vp);
if (UBCINFOEXISTS(vp))
{
ubc_clean(vp, 1);
ubc_uncache(vp);
ubc_release(vp);
ubc_info_free(vp);
}
AFS_GLOCK();
return 0;
}
/* Try to store pages to cache, in order to store a file back to the server.
*
* Locking: the vcache entry's lock is held. It will usually be dropped and
* re-obtained.
*/
void
osi_VM_StoreAllSegments(avc)
struct vcache *avc;
{
struct vnode *vp=(struct vnode *)avc;
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
if (UBCINFOEXISTS(vp)) {
ubc_pushdirty(vp);
}
AFS_GLOCK();
ObtainWriteLock(&avc->lock,94);
}
/* Try to invalidate pages, for "fs flush" or "fs flushv"; or
* try to free pages, when deleting a file.
*
* Locking: the vcache entry's lock is held. It may be dropped and
* re-obtained.
*
* Since we drop and re-obtain the lock, we can't guarantee that there won't
* be some pages around when we return, newly created by concurrent activity.
*/
void
osi_VM_TryToSmush(avc, acred, sync)
struct vcache *avc;
struct AFS_UCRED *acred;
int sync;
{
struct vnode *vp=(struct vnode *)avc;
void *object;
kern_return_t kret;
off_t size, lastpg;
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
if (UBCINFOEXISTS(vp)) {
size=ubc_getsize(vp);
kret=ubc_invalidate(vp,0,size);
if (kret != 1) /* should be KERN_SUCCESS */
printf("TryToSmush: invalidate failed (error = %d)\n", kret);
}
AFS_GLOCK();
ObtainWriteLock(&avc->lock,59);
}
/* Purge VM for a file when its callback is revoked.
*
* Locking: No lock is held, not even the global lock.
*/
/* XXX this seems to not be referenced anywhere. *somebody* ought to be calling
this, and also making sure that ubc's idea of the filesize is right more
often */
void
osi_VM_FlushPages(avc, credp)
struct vcache *avc;
struct AFS_UCRED *credp;
{
struct vnode *vp=(struct vnode *)avc;
void *object;
kern_return_t kret;
off_t size;
if (UBCINFOEXISTS(vp)) {
size=ubc_getsize(vp);
kret=ubc_invalidate(vp,0,size);
if (kret != 1) /* Should be KERN_SUCCESS */
printf("VMFlushPages: invalidate failed (error = %d)\n", kret);
/* XXX what about when not CStatd */
if (avc->states & CStatd && size != avc->m.Length)
ubc_setsize(vp, avc->m.Length);
}
}
/* Purge pages beyond end-of-file, when truncating a file.
*
* Locking: no lock is held, not even the global lock.
* activeV is raised. This is supposed to block pageins, but at present
* it only works on Solaris.
*/
void
osi_VM_Truncate(avc, alen, acred)
struct vcache *avc;
int alen;
struct AFS_UCRED *acred;
{
struct vnode *vp=(struct vnode *)avc;
if (UBCINFOEXISTS(vp)) {
ubc_setsize(vp, alen);
}
}
extern struct AFS_UCRED afs_osi_cred;
extern afs_rwlock_t afs_xvcache;
/* vnreclaim and vinactive are probably not aggressive enough to keep
enough afs vcaches free, so we try to do some of it ourselves */
/* XXX there's probably not nearly enough locking here */
void osi_VM_TryReclaim(avc, slept)
struct vcache *avc;
int *slept;
{
struct proc *p=current_proc();
struct vnode *vp=(struct vnode *)avc;
void *obj;
if (slept)
*slept=0;
VN_HOLD(vp); /* remove from inactive list */
if (!simple_lock_try(&vp->v_interlock)) {
AFS_RELE(vp);
return;
}
if (!UBCINFOEXISTS(vp) || vp->v_count != 2) {
simple_unlock(&vp->v_interlock);
AFS_RELE(vp);
return;
}
if (vp->v_ubcinfo->ui_holdcnt) {
simple_unlock(&vp->v_interlock);
AFS_RELE(vp);
return;
}
if (slept && ubc_issetflags(vp, UI_WASMAPPED)) {
/* We can't possibly release this in time for this NewVCache to get it */
simple_unlock(&vp->v_interlock);
AFS_RELE(vp);
return;
}
vp->v_usecount--; /* we want the usecount to be 1 */
if (slept) {
ReleaseWriteLock(&afs_xvcache);
*slept=1;
} else
ReleaseReadLock(&afs_xvcache);
AFS_GUNLOCK();
obj=0;
if (ubc_issetflags(vp, UI_WASMAPPED)) {
simple_unlock(&vp->v_interlock);
ubc_release(vp);
if (ubc_issetflags(vp, UI_HASOBJREF))
printf("ubc_release didn't release the reference?!\n");
} else if (!vn_lock(vp, LK_EXCLUSIVE|LK_INTERLOCK,current_proc())) {
#ifdef UBC_NOREACTIVATE
obj = ubc_getobject(vp,(UBC_NOREACTIVATE|UBC_HOLDOBJECT));
#else
obj = ubc_getobject(vp);
#endif
(void)ubc_clean(vp, 1);
vinvalbuf(vp, V_SAVE, &afs_osi_cred, p, 0, 0);
if (vp->v_usecount == 1)
VOP_INACTIVE(vp, p);
else
VOP_UNLOCK(vp, 0, p);
if (ISSET(vp->v_flag, VTERMINATE))
panic("afs_vnreclaim: already teminating");
SET(vp->v_flag, VTERMINATE);
memory_object_destroy(obj, 0);
while (ISSET(vp->v_flag, VTERMINATE)) {
SET(vp->v_flag, VTERMWANT);
tsleep((caddr_t)&vp->v_ubcinfo, PINOD, "afs_vnreclaim", 0);
}
} else {
if (simple_lock_try(&vp->v_interlock))
panic("afs_vnreclaim: slept, but did no work :(");
if (UBCINFOEXISTS(vp) && vp->v_count == 1) {
vp->v_usecount++;
simple_unlock(&vp->v_interlock);
AFS_RELE(vp);
} else
simple_unlock(&vp->v_interlock);
}
AFS_GLOCK();
if (slept)
ObtainWriteLock(&afs_xvcache,175);
else
ObtainReadLock(&afs_xvcache);
}
void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) {
void *object;
struct vcache *avc = (struct vcache *)vp;
object=NULL;
#ifdef UBC_NOREACTIVATE
if (UBCINFOEXISTS(vp))
object = ubc_getobject(vp, UBC_NOREACTIVATE);
#else
if (UBCINFOEXISTS(vp))
object = ubc_getobject(vp);
#endif
if (!object)
return;
offset=trunc_page(offset);
size=round_page(size+1);
#ifdef UBC_NOREACTIVATE
while (size) {
memory_object_page_op(object, (vm_offset_t)offset,
UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP,
0, 0);
size-=PAGE_SIZE;
offset+=PAGE_SIZE;
}
#else
ubc_setsize(vp, offset);
size=(offset + size > avc->m.Length) ? offset + size : avc->m.Length;
ubc_setsize(vp, size);
#endif
}
int osi_VM_Setup(struct vcache *avc) {
int error;
struct vnode *vp=(struct vnode *)avc;
if (UBCISVALID(vp) && (avc->states & CStatd)) {
if (!UBCINFOEXISTS(vp) && !ISSET(vp->v_flag, VTERMINATE)) {
osi_vnhold(avc,0);
AFS_GUNLOCK();
if ((error=ubc_info_init(&avc->v))) {
AFS_GLOCK();
AFS_RELE(avc);
return error;
}
simple_lock(&avc->v.v_interlock);
if (!ubc_issetflags(&avc->v, UI_HASOBJREF))
#ifdef UBC_NOREACTIVATE
if (ubc_getobject(&avc->v, (UBC_NOREACTIVATE|UBC_HOLDOBJECT)))
panic("VM_Setup: null object");
#else
(void)_ubc_getobject(&avc->v, 1); /* return value not used */
#endif
simple_unlock(&avc->v.v_interlock);
AFS_GLOCK();
AFS_RELE(avc);
}
if (UBCINFOEXISTS(&avc->v))
ubc_setsize(&avc->v, avc->m.Length);
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,6 @@
# directory or online at http://www.openafs.org/dl/license10.html
SHELL=/bin/sh
INSTALL = ${SRCDIR}bin/install
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
@ -34,11 +33,13 @@ kinstall: AFS_component_version_number.c
gencat -m afszcm.cat afs_trace.msf ;; \
*_linux* ) \
gencat --new afszcm.cat afs_trace.msf ;; \
ppc_darwin*) \
echo No gencat for ${SYS_NAME} ;; \
* ) \
gencat afszcm.cat afs_trace.msf ;; \
esac
ukinstall webinstall: AFS_component_version_number.c
set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
@ -58,7 +59,7 @@ install install.noversion: kinstall ukinstall
${INSTALL} longc_procs.h ${DESTDIR}include/afs ;; \
esac
case ${SYS_NAME} in \
next_mach30 | vax_ul43) \
next_mach30 | vax_ul43 | ppc_darwin* ) \
echo skipping afszcm.cat install for ${SYS_NAME} ;; \
* ) \
${INSTALL} afszcm.cat ${DESTDIR}root.client/usr/vice/etc/C ;; \

View File

@ -1845,7 +1845,7 @@ void uafs_Init(
iob.out = tbuffer;
iob.out_size = sizeof(tbuffer);
#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV)
#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV) || defined(AFS_USR_DARWIN_ENV)
rc = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, 0, _VICEIOCTL(8), &iob, 0);
#elif defined(AFS_USR_SGI_ENV)
rc = syscall(AFS_PIOCTL, 0, _VICEIOCTL(8), &iob, 0);

View File

@ -11,7 +11,9 @@
#define __AFS_SYSINCLUDESH__ 1
#include <stdio.h>
#ifndef AFS_USR_DARWIN_ENV /* must be included after KERNEL undef'd */
#include <errno.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@ -112,6 +114,29 @@
#define FREAD 0x0001
#endif /* AFS_USR_LINUX22_ENV */
#ifdef AFS_USR_DARWIN_ENV
#ifdef KERNEL
#undef KERNEL
#define AFS_USR_UNDEF_KERNEL_ENV 1
#endif
#include <errno.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#ifndef O_SYNC
#define O_SYNC O_FSYNC
#endif
#endif /* AFS_USR_DARWIN_ENV */
/* glibc 2.2 has pthread_attr_setstacksize */
#if defined(AFS_LINUX22_ENV) || defined(AFS_USR_LINUX22_ENV) && (__GLIBC_MINOR__ < 2)
#define pthread_attr_setstacksize(a,b) 0
@ -158,6 +183,11 @@
#undef socket
#endif /* AFS_USR_SGI_ENV */
#ifdef AFS_USR_DARWIN_ENV
#undef if_mtu
#undef if_metric
#endif
#define mount usr_mount
#define fs usr_fs
#define uio usr_uio

View File

@ -97,11 +97,11 @@ afs_CopyOutAttrs(avc, attrs)
* anyway, so the difference between 512K and 1000000 shouldn't matter
* much, and "&" is a lot faster than "%".
*/
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV)
attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec =
attrs->va_ctime.tv_nsec =
(hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000;
#ifdef AFS_AIX41_ENV
#if defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV)
attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */
#else
attrs->va_blksize = PAGESIZE; /* XXX Was 8192 XXX */
@ -137,7 +137,7 @@ afs_CopyOutAttrs(avc, attrs)
attrs->va_flags = 0;
#endif /* AFS_OSF_ENV */
#if !defined(AFS_OSF_ENV)
#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
#if !defined(AFS_HPUX_ENV)
#ifdef AFS_SUN5_ENV
attrs->va_nblocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) << 1 : 0);
@ -232,7 +232,7 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred)
return EACCES;
}
if (avc->mvstat == 2) {
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV)
attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000);
#else
attrs->va_mtime.tv_usec += ++avc->xlatordv;
@ -359,7 +359,7 @@ register struct AFSStoreStatus *as; {
#endif
mask |= AFS_SETMODTIME;
#ifndef AFS_SGI_ENV
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV)
if (av->va_mtime.tv_nsec == -1)
#else
if (av->va_mtime.tv_usec == -1)

View File

@ -287,7 +287,7 @@ tagain:
(afs_Analyze(tc, code, &adp->fid, &treq,
AFS_STATS_FS_RPCIDX_CREATEFILE, SHARED_LOCK, (struct cell *)0));
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
if (code == EEXIST && aexcl == NONEXCL) {
/* This lookup was handled in the common vn_open code in the
vnode layer */

View File

@ -15,7 +15,7 @@
*/
#include "../afs/param.h" /* Should be always first */
#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
#include "../afs/afs_stats.h" /* statistics */

View File

@ -40,7 +40,7 @@ void lockIdSet(flock, slp, clid)
#if defined(AFS_SUN5_ENV)
register proc_t *procp = ttoproc(curthread);
#else
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV)
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV)
#ifdef AFS_SGI_ENV
struct proc *procp = OSI_GET_CURRENT_PROCP();
#else
@ -80,7 +80,7 @@ void lockIdSet(flock, slp, clid)
#endif
slp->pid = clid;
#else
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
slp->pid = clid;
#else
#if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
@ -119,7 +119,7 @@ void lockIdSet(flock, slp, clid)
#endif
flock->l_pid = clid;
#else
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
flock->l_pid = clid;
#else
#if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
@ -154,7 +154,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid)
#if defined(AFS_SUN5_ENV)
register proc_t *procp = ttoproc(curthread);
#else
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV)
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV)
#ifdef AFS_SGI64_ENV
struct proc *procp = curprocp;
#else /* AFS_SGI64_ENV */
@ -171,7 +171,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid)
}
#endif
if ((flock1->l_pid == alp->pid) ||
#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV)
(!onlymine && (flock1->l_pid == getppid()))
#else
#if defined(AFS_SGI65_ENV)
@ -481,7 +481,7 @@ int flag;
pid_t clid;
off_t offset;
#else
#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV)
afs_lockctl(avc, af, acmd, acred, clid)
pid_t clid;
#else
@ -828,7 +828,7 @@ static int GetFlockCount(struct vcache *avc, struct vrequest *areq)
#endif
#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV)
#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)
/* Flock not support on System V systems */
#ifdef AFS_OSF_ENV
extern struct fileops afs_fileops;

View File

@ -419,6 +419,13 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
AFS_GUNLOCK();
code = osi_file_uio_rdwr(tfile, auio, UIO_READ);
AFS_GLOCK();
#else
#if defined(AFS_DARWIN_ENV)
AFS_GUNLOCK();
VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
VOP_UNLOCK(tfile->vnode, 0, current_proc());
AFS_GLOCK();
#else
code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
#endif
@ -426,6 +433,7 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
#endif
#endif
#endif
#endif
#endif
auio->afsio_offset += avc->quick.minLoc;
osi_UFSClose(tfile);
@ -749,6 +757,13 @@ tagain:
AFS_GUNLOCK();
code = osi_file_uio_rdwr(tfile, &tuio, UIO_READ);
AFS_GLOCK();
#else
#if defined(AFS_DARWIN_ENV)
AFS_GUNLOCK();
VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
VOP_UNLOCK(tfile->vnode, 0, current_proc());
AFS_GLOCK();
#else
code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
#endif
@ -758,6 +773,7 @@ tagain:
#endif
#endif
#endif
#endif
#ifdef IHINT
if (!tdc->ihint && nihints < maxIHint) {

View File

@ -136,6 +136,12 @@ struct irix5_min_dirent { /* miniature dirent structure */
#else
struct min_direct { /* miniature direct structure */
/* If struct direct changes, this must too */
#ifdef AFS_DARWIN_ENV
afs_uint32 d_fileno;
u_short d_reclen;
u_char d_type;
u_char d_namlen;
#else
#ifdef AFS_SUN5_ENV
afs_uint32 d_fileno;
afs_int32 d_off;
@ -151,6 +157,7 @@ struct min_direct { /* miniature direct structure */
u_short d_reclen;
u_short d_namlen;
#endif
#endif
};
#endif /* AFS_SGI_ENV */
@ -337,6 +344,9 @@ int off;
#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
sdirEntry.d_off = off;
#endif
#if defined(AFS_DARWIN_ENV)
sdirEntry.d_type=DT_UNKNOWN;
#endif
#if defined(AFS_SGI_ENV)
AFS_UIOMOVE(&sdirEntry, DIRENTBASESIZE, UIO_READ, auio, code);
@ -409,7 +419,7 @@ void afs_bulkstat_send( avc, req )
* It has to do with 'offset' (seek locations).
*/
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp)
int *eofp;
#else
@ -466,7 +476,7 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred)
#endif /* AFS_SGI61_ENV */
#endif /* defined(AFS_SGI53_ENV) */
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
/* Not really used by the callee so we ignore it for now */
if (eofp) *eofp = 0;
#endif

View File

@ -25,7 +25,7 @@
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs_ustrategy(abp, credp)
struct AFS_UCRED *credp;
#else
@ -36,14 +36,14 @@ afs_ustrategy(abp)
struct uio tuio;
register struct vcache *tvc = (struct vcache *) abp->b_vp;
register afs_int32 len = abp->b_bcount;
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
#ifdef AFS_AIX41_ENV
struct ucred *credp;
#else
struct AFS_UCRED *credp = u.u_cred;
#endif
#endif
#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
int async = abp->b_flags & B_ASYNC;
#endif
struct iovec tiovec[1];

View File

@ -528,8 +528,16 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
AFS_GUNLOCK();
code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
AFS_GLOCK();
#else
#if defined(AFS_DARWIN_ENV)
AFS_GUNLOCK();
VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred);
VOP_UNLOCK(tfile->vnode, 0, current_proc());
AFS_GLOCK();
#else
code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred);
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_LINUX20_ENV */
#endif /* AFS_HPUX100_ENV */
#endif /* AFS_OSF_ENV */
@ -601,6 +609,9 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
* If write is implemented via VM, afs_fsync() is called from the high-level
* write op.
*/
#ifdef AFS_DARWIN_ENV
if (noLock && (aio & IO_SYNC)) {
#else
#ifdef AFS_HPUX_ENV
/* On hpux on synchronous writes syncio will be set to IO_SYNC. If
* we're doing them because the file was opened with O_SYNCIO specified,
@ -609,6 +620,7 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) {
#else
if (noLock && (aio & FSYNC)) {
#endif
#endif
if (!AFS_NFSXLATORREQ(acred))
afs_fsync(avc, acred);
@ -638,7 +650,7 @@ struct vrequest *areq; {
#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
#ifdef AFS_DUX50_ENV
#define vno_close(X) vn_close((X), 0, NOCRED)
#elif defined(AFS_DUX40_ENV)

View File

@ -557,7 +557,7 @@ struct vcache {
* Do not try to get the vcache lock when the vlock is held */
afs_rwlock_t vlock;
#endif /* defined(AFS_SUN5_ENV) */
#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV)
#if defined(AFS_SUN5_ENV)
krwlock_t rwlock;
struct cred *credp;
@ -572,6 +572,9 @@ struct vcache {
#endif
#ifdef AFS_AIX_ENV
int ownslock; /* pid of owner of excl lock, else 0 - defect 3083 */
#endif
#ifdef AFS_DARWIN_ENV
struct lock__bsd__ rwlock;
#endif
afs_int32 parentVnode; /* Parent dir, if a file. */
afs_int32 parentUnique;
@ -974,9 +977,15 @@ extern void shutdown_osifile();
(((avc)->states & CStatd) ? (vcache2inode(avc), 0) : \
afs_VerifyVCache2((avc),areq))
#else
#ifdef AFS_DARWIN_ENV
#define afs_VerifyVCache(avc, areq) \
(((avc)->states & CStatd) ? (osi_VM_Setup(avc), 0) : \
afs_VerifyVCache2((avc),areq))
#else
#define afs_VerifyVCache(avc, areq) \
(((avc)->states & CStatd) ? 0 : afs_VerifyVCache2((avc),areq))
#endif
#endif
#define DO_STATS 1 /* bits used by FindVCache */
#define DO_VLRU 2
@ -1064,7 +1073,7 @@ extern int afs_norefpanic;
/* get a file's serial number from a vnode */
#ifndef afs_vnodeToInumber
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToInumber(V) VnodeToIno(V)
#else
#ifdef AFS_DECOSF_ENV
@ -1077,7 +1086,7 @@ extern int afs_norefpanic;
/* get a file's device number from a vnode */
#ifndef afs_vnodeToDev
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
#define afs_vnodeToDev(V) VnodeToDev(V)
#else
#ifdef AFS_DECOSF_ENV

View File

@ -42,7 +42,8 @@ char afs_rootVolumeName[64]="";
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_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
#if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
kmutex_t afs_global_lock;
kmutex_t afs_rxglobal_lock;
@ -53,6 +54,10 @@ long afs_global_owner;
#if defined(AFS_OSF_ENV)
simple_lock_data_t afs_global_lock;
#elif defined(AFS_DARWIN_ENV)
struct lock__bsd__ afs_global_lock;
#endif
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
thread_t afs_global_owner;
#endif /* AFS_OSF_ENV */
@ -127,7 +132,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
if (!afs_suser() && (parm != AFSOP_GETMTU)
&& (parm != AFSOP_GETMASK)) {
/* only root can run this code */
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(EACCES);
return(EACCES);
#else
@ -197,7 +202,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
while (afs_initState < AFSOP_START_AFS)
afs_osi_Sleep(&afs_initState);
#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
temp = AFS_MINBUFFERS; /* Should fix this soon */
#else
temp = ((afs_bufferpages * NBPG)>>11); /* number of 2k buffers we could get from all of the buffer space */
@ -286,7 +291,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
struct afsop_cell tcell;
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0;
char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0;
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
@ -324,7 +329,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code);
if (code) {
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
goto out;
#else
setuerror(code);
@ -370,7 +375,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
code = afs_InitCacheFile((char *) 0, ainode);
}
else if (parm == AFSOP_ROOTVOLUME) {
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
@ -388,7 +393,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO ||
parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG) {
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
@ -496,7 +501,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
#endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */
#endif /* AFS_SGI53_ENV */
else if (parm == AFSOP_SHUTDOWN) {
#if defined(AFS_OSF_ENV)
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
extern struct mount *afs_globalVFS;
#else /* AFS_OSF_ENV */
extern struct vfs *afs_globalVFS;
@ -519,7 +524,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
afs_vfs_mount(parm2, parm3, parm4, parm5);
#endif /* AFS_HPUX100_ENV */
#else /* defined(AFS_HPUX_ENV) */
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL;
#else
setuerror(EINVAL);
@ -873,7 +878,7 @@ Afs_syscall (uap, rvp)
{
int *retval = &rvp->r_val1;
#else /* AFS_SUN5_ENV */
#if defined(AFS_OSF_ENV)
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs3_syscall(p, args, retval)
struct proc *p;
void *args;
@ -1011,7 +1016,7 @@ Afs_syscall ()
mutex_exit(&procp->p_crlock);
#else
AFS_GLOCK();
#if defined(AFS_OSF_ENV)
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
code = afs_setpag(p, args, retval);
#else /* AFS_OSF_ENV */
code = afs_setpag();
@ -1022,8 +1027,12 @@ Afs_syscall ()
AFS_GLOCK();
#ifdef AFS_SUN5_ENV
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED());
#else
#ifdef AFS_DARWIN_ENV
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred);
#else
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4);
#endif
#endif
AFS_GUNLOCK();
} else if (uap->syscall == AFSCALL_ICREATE) {
@ -1031,7 +1040,7 @@ Afs_syscall ()
code = copyin_iparam((char *)uap->parm3, &iparams);
if (code) {
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(code);
#endif
} else
@ -1040,7 +1049,7 @@ Afs_syscall ()
iparams.param3, iparams.param4, rvp, CRED());
#else
code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2,
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
iparams.param3, iparams.param4, retval);
#else
iparams.param3, iparams.param4);
@ -1050,7 +1059,7 @@ Afs_syscall ()
#ifdef AFS_SUN5_ENV
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED());
#else
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval);
#else
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3);
@ -1079,13 +1088,13 @@ Afs_syscall ()
}
#else
if (code) {
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(code);
#endif
}
#endif /* !AFS_LINUX20_ENV */
} else {
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL;
#else
setuerror(EINVAL);
@ -1277,7 +1286,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
register afs_int32 code;
struct afs_icl_log *logp;
struct afs_icl_set *setp;
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t temp;
#else /* AFS_SGI61_ENV */
afs_uint32 temp;
@ -1293,7 +1302,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
}
#else
if (!afs_suser()) { /* only root can run this code */
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(EACCES);
return EACCES;
#else

View File

@ -1237,7 +1237,7 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake,
tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen);
got = afs_osi_Read(afile, -1, tbuffer, tlen);
if ((got < 0)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
|| (got != tlen && getuerror())
#endif
) {
@ -1718,6 +1718,7 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
updateV2DC(setLocks,avc,tdc,567);
return tdc; /* check if we're done */
}
osi_Assert(setLocks || WriteLocked(&avc->lock));
if (setLocks) ObtainReadLock(&avc->lock);
if (!hsame(avc->m.DataVersion, tdc->f.versionNo)) {
@ -2299,7 +2300,7 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc)
tdc->f.chunk = -1;
hones(tdc->f.versionNo);
tdc->flags |= DFEntryMod;
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
last_error = getuerror();
#endif
lasterrtime = osi_Time();

View File

@ -97,7 +97,7 @@ extern afs_lock_t afs_ftf;
/* Exported variables */
struct osi_dev cacheDev; /*Cache device*/
afs_int32 cacheInfoModTime; /*Last time cache info modified*/
#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV)
struct mount *afs_cacheVfsp=0;
#elif defined(AFS_LINUX20_ENV)
struct super_block *afs_cacheSBp = 0;
@ -432,7 +432,11 @@ afs_InitCacheInfo(afile)
TO_KERNEL_SPACE();
}
#else
#ifdef AFS_DARWIN_ENV
if (!VFS_STATFS(filevp->v_mount, &st, current_proc()))
#else
if (!VFS_STATFS(filevp->v_vfsp, &st))
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_LINUX20_ENV */
#endif /* AIX41 */
#endif /* OSF */
@ -450,7 +454,7 @@ afs_InitCacheInfo(afile)
#else
cacheInode = afs_vnodeToInumber(filevp);
cacheDev.dev = afs_vnodeToDev(filevp);
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
afs_InitDualFSCacheOps(filevp);
#endif
afs_cacheVfsp = filevp->v_vfsp;

View File

@ -50,6 +50,9 @@ void osi_Init()
#elif defined(AFS_OSF_ENV)
usimple_lock_init(&afs_global_lock);
afs_global_owner = (thread_t)0;
#elif defined(AFS_DARWIN_ENV)
lockinit(&afs_global_lock, PLOCK, "afs global lock", 0, 0);
afs_global_owner = (thread_t)0;
#elif defined(AFS_AIX41_ENV)
lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1);
simple_lock_init((void *)&afs_global_lock);
@ -77,7 +80,7 @@ void osi_Init()
osi_Active(avc)
register struct vcache *avc; {
AFS_STATCNT(osi_Active);
#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV)
#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
if ((avc->opens > 0) || (avc->states & CMAPPED)) return 1; /* XXX: Warning, verify this XXX */
#else
#if defined(AFS_MACH_ENV)
@ -292,12 +295,16 @@ void afs_osi_Invisible() {
#if defined(AFS_HPUX101_ENV)
set_system_proc(u.u_procp);
#else
#if defined(AFS_DARWIN_ENV)
current_proc()->p_flag |= P_SYSTEM;
#else
#if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
u.u_procp->p_flag |= SSYS;
#endif /* AFS_SGI64_ENV */
#endif
#endif
#endif
#endif
#endif
AFS_STATCNT(osi_Invisible);
}
@ -343,6 +350,11 @@ afs_osi_SetTime(atv)
sta.time = atv->tv_sec;
stime(&sta);
AFS_GLOCK();
#else
#ifdef AFS_DARWIN_ENV
AFS_GUNLOCK();
setthetime(atv);
AFS_GLOCK();
#else
/* stolen from kern_time.c */
#ifndef AFS_AUX_ENV
@ -367,6 +379,7 @@ afs_osi_SetTime(atv)
#ifdef AFS_AUX_ENV
logtchg(atv->tv_sec);
#endif
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_SGI_ENV */
#endif /* AFS_SUN55_ENV */
#endif /* AFS_SUN5_ENV */
@ -729,6 +742,22 @@ extern int npid;
}
#endif
#if defined(AFS_DARWIN_ENV)
void afs_osi_TraverseProcTable()
{
struct proc *p;
LIST_FOREACH(p, &allproc, p_list) {
if (p->p_stat == SIDL)
continue;
if (p->p_stat == SZOMB)
continue;
if (p->p_flag & P_SYSTEM)
continue;
afs_GCPAGs_perproc_func(p);
}
}
#endif
/* return a pointer (sometimes a static copy ) to the cred for a
* given AFS_PROC.
* subsequent calls may overwrite the previously returned value.
@ -885,6 +914,31 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
return rv;
}
#elif defined(AFS_DARWIN_ENV)
const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
{
struct AFS_UCRED *rv=NULL;
static struct AFS_UCRED cr;
if(pr == NULL) {
return NULL;
}
if((pr->p_stat == SSLEEP) ||
(pr->p_stat == SRUN) ||
(pr->p_stat == SSTOP)) {
pcred_readlock(pr);
cr.cr_ref=1;
cr.cr_uid=pr->p_cred->pc_ucred->cr_uid;
cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups;
bcopy(pr->p_cred->pc_ucred->cr_groups, cr.cr_groups,NGROUPS *
sizeof(gid_t));
pcred_unlock(pr);
rv = &cr;
}
return rv;
}
#else
const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
{

View File

@ -109,11 +109,17 @@ extern void osi_FreeLargeSpace(void *x);
/*
* Vnode related macros
*/
#ifdef AFS_DARWIN_ENV
extern int (**afs_vnodeop_p)();
#define IsAfsVnode(vc) ((vc)->v_op == afs_vnodeop_p)
#define SetAfsVnode(vc) (vc)->v_op = afs_vnodeop_p
#else
extern struct vnodeops *afs_ops;
#define vType(vc) (vc)->v.v_type
#define vSetType(vc,type) (vc)->v.v_type = (type)
#define IsAfsVnode(vc) ((vc)->v_op == afs_ops)
#define SetAfsVnode(vc) (vc)->v_op = afs_ops
#endif
#define vType(vc) (vc)->v.v_type
#define vSetType(vc,type) (vc)->v.v_type = (type)
#define vSetVfsp(vc,vfsp) (vc)->v.v_vfsp = (vfsp)
#ifdef AFS_SGI65_ENV
@ -230,7 +236,13 @@ typedef struct timeval osi_timeval_t;
* (Also, of course, the vnode is assumed to be one of ours. Can't use this
* macro for V-file vnodes.)
*/
#ifdef AFS_DARWIN_ENV
/* Bare refcount manipulation would probably work on this platform, but just
calling VREF does not */
#define AFS_FAST_HOLD(vp) osi_vnhold((vp),0)
#else
#define AFS_FAST_HOLD(vp) VN_HOLD(&(vp)->v)
#endif
#define AFS_FAST_RELE(vp) AFS_RELE(&(vp)->v)
/*
@ -270,7 +282,7 @@ typedef struct timeval osi_timeval_t;
AFS_GLOCK(); \
} while(0)
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
int haveGlock = ISAFS_GLOCK(); \
@ -310,7 +322,7 @@ typedef struct timeval osi_timeval_t;
CODE = copyout((SRC),(DST),(LEN)); \
} while(0)
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
(UIO)->uio_rw = (RW); \

View File

@ -100,7 +100,7 @@ afs_uint32 getpag(void) {
int
#if defined(AFS_SUN5_ENV)
afs_setpag (struct AFS_UCRED **credpp)
#elif defined(AFS_OSF_ENV)
#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs_setpag (struct proc *p, void *args, int *retval)
#else
afs_setpag (void)
@ -159,12 +159,18 @@ afs_setpag (void)
code = AddPag(genpag(), &credp);
crfree(credp);
}
#elif defined(AFS_DARWIN_ENV)
{
struct ucred *credp=crdup(p->p_cred->pc_ucred);
code=AddPag(p, genpag(), &credp);
crfree(credp);
}
#else
code = AddPag(genpag(), &u.u_cred);
#endif
afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
#if defined(AFS_SGI53_ENV) && defined(MP)
AFS_GUNLOCK();
#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
@ -176,7 +182,7 @@ afs_setpag (void)
#endif
}
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp)
#else /* AFS_OSF_ENV */
int AddPag(afs_int32 aval, struct AFS_UCRED **credpp)
@ -184,12 +190,12 @@ int AddPag(afs_int32 aval, struct AFS_UCRED **credpp)
{
afs_int32 newpag, code;
AFS_STATCNT(AddPag);
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
if (code = setpag(p, credpp, aval, &newpag, 0))
#else /* AFS_OSF_ENV */
if (code = setpag(credpp, aval, &newpag, 0))
#endif
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return (setuerror(code), code);
@ -211,7 +217,12 @@ afs_InitReq(av, acred)
* think it's ok to use the real uid to make setuid
* programs (without setpag) to work properly.
*/
#ifdef AFS_DARWIN_ENV
av->uid = acred->cr_uid; /* default when no pag is set */
/* bsd creds don't have ruid */
#else
av->uid = acred->cr_ruid; /* default when no pag is set */
#endif
}
av->initd = 0;
return 0;
@ -268,6 +279,15 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred)
if (cred == NULL) {
return NOPAG;
}
#ifdef AFS_DARWIN_ENV
if (cred == NOCRED || cred == FSCRED) {
return NOPAG;
}
if (cred->cr_ngroups < 3) return NOPAG;
/* gid is stored in cr_groups[0] */
g0 = cred->cr_groups[1];
g1 = cred->cr_groups[2];
#else
#ifdef AFS_AIX_ENV
if (cred->cr_ngrps < 2) {
return NOPAG;
@ -276,6 +296,7 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred)
#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV)
if (cred->cr_ngroups < 2) return NOPAG;
#endif
#endif
#endif
g0 = cred->cr_groups[0];
g1 = cred->cr_groups[1];

View File

@ -381,6 +381,18 @@ afs_xioctl (p, args, retval)
caddr_t arg;
} *uap = (struct a *)args;
#else /* AFS_OSF_ENV */
#ifdef AFS_DARWIN_ENV
struct ioctl_args {
int fd;
u_long com;
caddr_t arg;
};
afs_xioctl(p, uap, retval)
struct proc *p;
register struct ioctl_args *uap;
register_t *retval;
{
#else
#ifdef AFS_LINUX22_ENV
struct afs_ioctl_sys {
unsigned int com;
@ -399,11 +411,12 @@ afs_xioctl ()
caddr_t arg;
} *uap = (struct a *)u.u_ap;
#endif /* AFS_LINUX22_ENV */
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_OSF_ENV */
#endif /* AFS_SUN5_ENV */
#endif
#ifndef AFS_LINUX22_ENV
#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
struct file *fd;
#else
register struct file *fd;
@ -413,6 +426,10 @@ afs_xioctl ()
register int ioctlDone = 0, code = 0;
AFS_STATCNT(afs_xioctl);
#ifdef AFS_DARWIN_ENV
if ((code=fdgetf(p, uap->fd, &fd)))
return code;
#else
#ifdef AFS_LINUX22_ENV
ua.com = com;
ua.arg = arg;
@ -448,6 +465,7 @@ afs_xioctl ()
#endif
#endif
#endif
#endif
#endif
/* first determine whether this is any sort of vnode */
@ -484,6 +502,9 @@ afs_xioctl ()
if (code) {
osi_FreeSmallSpace(datap);
AFS_GUNLOCK();
#ifdef AFS_DARWIN_ENV
return code;
#else
#if defined(AFS_SUN5_ENV)
#ifdef AFS_SUN54_ENV
releasef(uap->fd);
@ -510,6 +531,7 @@ afs_xioctl ()
return;
#endif
#endif
#endif
#endif
}
code = HandleIoctl(tvc, uap->com, datap);
@ -553,6 +575,9 @@ afs_xioctl ()
#endif
code = ioctl(uap, rvp);
#else
#if defined(AFS_DARWIN_ENV)
return ioctl(p, uap, retval);
#else
#ifdef AFS_OSF_ENV
code = ioctl(p, args, retval);
#ifdef AFS_OSF30_ENV
@ -568,6 +593,7 @@ afs_xioctl ()
#endif
#endif
#endif
#endif
#endif
}
#ifdef AFS_SUN5_ENV
@ -582,7 +608,7 @@ afs_xioctl ()
#ifdef AFS_LINUX22_ENV
return -code;
#else
#if !defined(AFS_OSF_ENV)
#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
if (!getuerror())
setuerror(code);
#if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV)
@ -593,7 +619,7 @@ afs_xioctl ()
#endif
#endif /* AFS_LINUX22_ENV */
#endif /* AFS_SUN5_ENV */
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#endif
}
@ -645,8 +671,28 @@ afs_pioctl(p, args, retval)
extern struct mount *afs_globalVFS;
#else /* AFS_OSF_ENV */
#ifdef AFS_DARWIN_ENV
afs_pioctl(p, args, retval)
struct proc *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, p->p_cred->pc_ucred));
}
extern struct mount *afs_globalVFS;
#else /* AFS_OSF_ENV */
extern struct vfs *afs_globalVFS;
#endif
#endif
/* macro to avoid adding any more #ifdef's to pioctl code. */
#if defined(AFS_LINUX22_ENV) || defined(AFS_AIX41_ENV)
@ -660,7 +706,12 @@ afs_syscall_pioctl(path, com, cmarg, follow, rvp, credp)
rval_t *rvp;
struct AFS_UCRED *credp;
#else
#ifdef AFS_DARWIN_ENV
afs_syscall_pioctl(path, com, cmarg, follow, credp)
struct AFS_UCRED *credp;
#else
afs_syscall_pioctl(path, com, cmarg, follow)
#endif
#endif
char *path;
unsigned int com;
@ -686,7 +737,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#ifndef AFS_SUN5_ENV
if (! _VALIDVICEIOCTL(com)) {
PIOCTL_FREE_CRED();
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
return EINVAL;
#else /* AFS_OSF_ENV */
#if defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
@ -701,7 +752,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
code = copyin_afs_ioctl(cmarg, &data);
if (code) {
PIOCTL_FREE_CRED();
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
setuerror(code);
@ -709,9 +760,9 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif
}
if ((com & 0xff) == PSetClientContext) {
#ifdef AFS_LINUX22_ENV
#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return EINVAL; /* Not handling these yet. */
#endif
#else
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV)
code = HandleClientContext(&data, &com, &foreigncreds, credp);
#else
@ -724,20 +775,21 @@ afs_syscall_pioctl(path, com, cmarg, follow)
code = HandleClientContext(&data, &com, &foreigncreds, u.u_cred);
#endif /* AFS_SGI_ENV */
#endif
#endif
#endif
if (code) {
if (foreigncreds) {
crfree(foreigncreds);
}
PIOCTL_FREE_CRED();
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return (setuerror(code), code);
#endif
}
}
#ifndef AFS_LINUX22_ENV
#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
/*
* We could have done without temporary setting the u.u_cred below
@ -774,7 +826,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
if ((com & 0xff) == 15) {
/* special case prefetch so entire pathname eval occurs in helper process.
otherwise, the pioctl call is essentially useless */
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = Prefetch(path, &data, follow,
foreigncreds ? foreigncreds : credp);
#else
@ -788,7 +840,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif /* AFS_SGI64_ENV */
#endif /* AFS_HPUX101_ENV */
#endif
#ifndef AFS_LINUX22_ENV
#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred); /* restore original credentials */
@ -809,7 +861,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
}
#endif /* AFS_LINUX22_ENV */
PIOCTL_FREE_CRED();
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return (setuerror(code), code);
@ -831,7 +883,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif /* AFS_AIX41_ENV */
AFS_GLOCK();
if (code) {
#ifndef AFS_LINUX22_ENV
#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred); /* restore original credentials */
@ -852,7 +904,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
}
#endif /* AFS_LINUX22_ENV */
PIOCTL_FREE_CRED();
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return(setuerror(code), code);
@ -907,7 +959,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
code = afs_HandlePioctl(vp, com, &data, follow, &credp);
}
#else
#ifdef AFS_LINUX22_ENV
#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = afs_HandlePioctl(vp, com, &data, follow, &credp);
#else
code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred);
@ -917,7 +969,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif /* AFS_AIX41_ENV */
#endif /* AFS_SUN5_ENV */
} else {
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL; /* not in /afs */
#else
setuerror(EINVAL);
@ -930,7 +982,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif
}
#ifndef AFS_LINUX22_ENV
#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred);
@ -958,7 +1010,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
#endif
}
PIOCTL_FREE_CRED();
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
if (!getuerror())
@ -1369,10 +1421,17 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
afs_PutCell(tcell, READ_LOCK);
if (set_parent_pag) {
int pag;
#ifdef AFS_DARWIN_ENV
struct proc *p=current_proc(); /* XXX */
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
p->p_pid, p->p_comm);
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;
@ -1976,7 +2035,11 @@ struct AFS_UCRED *acred;
{
register char *tp;
register afs_int32 code;
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else
u_int bufferSize;
#endif
AFS_STATCNT(Prefetch);
if (!apath) return EINVAL;
@ -2477,8 +2540,12 @@ struct AFS_UCRED *acred;
if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) {
#if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
VN_HOLD((struct vnode *)tvc);
#else
#if defined(AFS_DARWIN_ENV)
osi_vnhold(tvc, 0);
#else
tvc->vrefCount++;
#endif
#endif
ReleaseReadLock(&afs_xvcache);
#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
@ -2625,7 +2692,7 @@ register struct AFS_UCRED *acred;
AFS_STATCNT(PSetSysName);
if (!afs_globalVFS) {
/* Afsd is NOT running; disable it */
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (EINVAL);
#else
return (setuerror(EINVAL), EINVAL);

View File

@ -38,7 +38,7 @@ extern void afs_osi_TraverseProcTable(void);
/* afs_osi_pag.c */
extern afs_uint32 genpag(void);
extern afs_uint32 getpag(void);
#ifdef AFS_OSF_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
extern int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp);
#else /* AFS_OSF_ENV */
extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp);
@ -119,7 +119,7 @@ extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
int acell, struct cell *tcell, struct vrequest *areq);
extern void afs_ResetVolumeInfo(struct volume *tv);
#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV)
#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV)
#include "../afs/osi_prototypes.h"
#endif

View File

@ -1202,6 +1202,13 @@ static afs_SetServerPrefs(sa)
#ifdef AFS_SGI62_ENV
(void) hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL,
(caddr_t)sa, NULL);
#elif defined(AFS_DARWIN_ENV)
{
struct in_ifaddr *ifa;
TAILQ_FOREACH(ifa , &in_ifaddrhead, ia_link) {
afsi_SetServerIPRank(sa, ifa);
}
}
#else
{
extern struct in_ifaddr *in_ifaddr;

View File

@ -606,7 +606,11 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc)
afs_GCPAGs_cred_count++;
pag = PagInCred(pcred);
#ifdef AFS_DARWIN_ENV
uid = (pag != NOPAG ? pag : pcred->cr_uid);
#else
uid = (pag != NOPAG ? pag : pcred->cr_ruid);
#endif
hash = UHash(uid);
/* if this token is PAG based, or it's UID based and

View File

@ -66,6 +66,8 @@ extern struct vcache *afs_globalVp;
#ifdef AFS_OSF_ENV
extern struct mount *afs_globalVFS;
extern struct vnodeops Afs_vnodeops;
#elif defined(AFS_DARWIN_ENV)
extern struct mount *afs_globalVFS;
#else
extern struct vfs *afs_globalVFS;
#endif /* AFS_OSF_ENV */
@ -703,6 +705,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
else if (QNext(uq) != tq)
refpanic("VLRU inconsistent");
#ifdef AFS_DARWIN_ENV
if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) &&
tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
osi_VM_TryReclaim(tvc, &fv_slept);
if (fv_slept) {
uq = VLRU.prev;
i = 0;
continue; /* start over - may have raced. */
}
}
#endif
if (tvc->vrefCount == 0 && tvc->opens == 0
&& (tvc->states & CUnlinkedDel) == 0) {
code = afs_FlushVCache(tvc, &fv_slept);
@ -867,6 +880,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
#else
SetAfsVnode((struct vnode *)tvc);
#endif /* AFS_SGI64_ENV */
#ifdef AFS_DARWIN_ENV
tvc->v.v_ubcinfo = UBC_INFO_NULL;
lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0);
cache_purge((struct vnode *)tvc);
tvc->v.v_data=tvc;
tvc->v.v_tag=VT_AFS;
/* VLISTNONE(&tvc->v); */
tvc->v.v_freelist.tqe_next=0;
tvc->v.v_freelist.tqe_prev=(struct vnode **)0xdeadb;
/*tvc->vrefCount++;*/
#endif
/*
* The proper value for mvstat (for root fids) is setup by the caller.
*/
@ -1113,6 +1137,12 @@ afs_FlushActiveVcaches(doflocks)
crfree(cred);
}
}
#ifdef AFS_DARWIN_ENV
if (tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
if (tvc->opens) panic("flushactive open, hasubc, but refcnt 1");
osi_VM_TryReclaim(tvc,0);
}
#endif
}
}
ReleaseReadLock(&afs_xvcache);
@ -1601,6 +1631,9 @@ loop:
vcache2inode(tvc);
#endif
ReleaseWriteLock(&tvc->lock);
#ifdef AFS_DARWIN_ENV
osi_VM_Setup(tvc);
#endif
return tvc;
}
@ -1657,6 +1690,9 @@ loop:
}
ReleaseWriteLock(&tvc->lock);
#ifdef AFS_DARWIN_ENV
osi_VM_Setup(avc);
#endif
return tvc;
} /*afs_GetVCache*/
@ -1812,6 +1848,9 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq,
afs_ProcessFS(tvc, &OutStatus, areq);
ReleaseWriteLock(&tvc->lock);
#ifdef AFS_DARWIN_ENV
osi_VM_Setup(tvc);
#endif
return tvc;
}
@ -2116,6 +2155,7 @@ else { /* used to undo the local callback, but that's too extreme.
return code;
}
#if 0
/*
* afs_StuffVcache
*
@ -2254,6 +2294,7 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq)
*/
afs_PutVCache(tvc, WRITE_LOCK);
} /*afs_StuffVcache*/
#endif
/*
* afs_PutVCache
@ -2376,6 +2417,10 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit,
#ifdef AFS_LINUX22_ENV
if (tvc && (tvc->states & CStatd))
vcache2inode(tvc); /* mainly to reset i_nlink */
#endif
#ifdef AFS_DARWIN_ENV
if (tvc)
osi_VM_Setup(tvc);
#endif
return tvc;
} /*afs_FindVCache*/

View File

@ -51,6 +51,6 @@
#include "../afs/afs_axscache.h"
#include "../afs/icl.h"
#include "../afs/afs_prototypes.h"
#ifdef AFS_LINUX20_ENV
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
#include "../afs/osi_machdep.h"
#endif

View File

@ -39,11 +39,15 @@
#define AFS_XLATOR_MAGIC 0x87654321
#endif
#ifdef AFS_DARWIN_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 exporterops {
int (*export_reqhandler)();

View File

@ -109,7 +109,11 @@ extern tid_t thread_self();
#ifdef AFS_LINUX20_ENV
#define MyPidxx current->pid
#else
#ifdef AFS_DARWIN_ENV
#define MyPidxx (current_proc()->p_pid )
#else
#define MyPidxx (u.u_procp->p_pid )
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_LINUX20_ENV */
#endif /* AFS_SGI64_ENV */
#endif /* AFS_HPUX101_ENV */

View File

@ -41,6 +41,10 @@ struct xfs_inode_info {};
#include <linux/errno.h>
#else /* AFS_LINUX22_ENV */
#ifdef AFS_DARWIN_ENV
#define _MACH_ETAP_H_
typedef unsigned short etap_event_t;
#endif
#if !defined(AFS_OSF_ENV)
#include "../h/errno.h"
#include "../h/types.h"
@ -180,6 +184,22 @@ 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 */
# endif /* AFS_HPUX_ENV */
#ifdef AFS_DARWIN_ENV
# include <sys/uio.h>
# include <sys/mount.h>
# include <sys/namei.h>
# include <sys/vnode.h>
# include <sys/queue.h>
# include <sys/ubc.h>
#define timeout_fcn_t mach_timeout_fcn_t
# include <kern/sched_prim.h>
#undef timeout_fcn_t
#define _DIR_H_
#define doff_t int32_t
# include <ufs/ufs/quota.h>
# include <ufs/ufs/inode.h>
# include <ufs/ffs/fs.h>
#else
# include "../h/vfs.h"
# include "../h/vnode.h"
# ifdef AFS_SUN5_ENV
@ -193,6 +213,7 @@ struct vfspage; /* for vnode.h compiler warnings */
# endif /* !AFS_HPUX_ENV */
# endif /* !AFS_AIX32_ENV */
# endif /* AFS_SUN5_ENV */
#endif /* AFS_DARWIN_ENV */
#endif /* AFS_DEC_ENV */
/* These mainly deal with networking and rpc headers */
@ -225,7 +246,8 @@ struct vfspage; /* for vnode.h compiler warnings */
#include "../h/tty.h"
#endif
#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV)
#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV)
# include "../h/text.h"
#endif

View File

@ -12,14 +12,13 @@ DESTDIR = DEST/
SRCDIR = DEST/
SOURCES = afsd.c sys.c
INSTALL = ${SRCDIR}bin/install
INSTALLro = ${SRCDIR}bin/install -m 644
INSTALLex = ${SRCDIR}bin/install -m 755
COMPONENT=afsd
include ../config/Makefile.${SYS_NAME}
include ../config/Makefile.version
INSTALLro = ${INSTALL} -m 644
INSTALLex = ${INSTALL} -m 755
CFLAGS = -g -I${SRCDIR}include ${XCFLAGS}
LDFLAGS = -g ${XLDFLAGS}
@ -104,6 +103,11 @@ install: all
*linux* ) \
${INSTALLex} -f afs.rc.linux ${DESTDIR}root.client/usr/vice/etc/afs.rc; \
${INSTALL} -f afs.conf.linux ${DESTDIR}root.client/usr/vice/etc/afs.conf ;; \
ppc_darwin*) \
mkdir -p ${DESTDIR}root.client/usr/vice/etc/afs.kext/Contents/MacOS ;\
${INSTALL} -f afs.ppc_darwin.plist ${DESTDIR}root.client/usr/vice/etc/afs.kext/Contents/Info.plist ; \
${INSTALLex} -f afs.rc.darwin ${DESTDIR}root.client/usr/vice/etc/afs.rc ; \
${INSTALL} -f afs.rc.darwin.plist ${DESTDIR}root.client/usr/vice/etc/StartupParameters.plist ;; \
* ) \
echo No rc scripts installed for ${SYS_NAME} ;; \
esac

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>afs</string>
<key>CFBundleIdentifier</key>
<string>org.openafs.filesystems.afs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>afs</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.3</string>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kernel.bsd</key>
<string>1.0.0b1</string>
<key>com.apple.kernel.mach</key>
<string>1.0.0b1</string>
</dict>
</dict>
</plist>

123
src/afsd/afs.rc.darwin Normal file
View File

@ -0,0 +1,123 @@
#!/bin/sh
# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
#
# This software has been released under the terms of the IBM Public
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
. /etc/rc.common
CheckForNetwork
if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
if [ -r /var/db/openafs ]; then
VICEETC=/var/db/openafs/etc
AFSD=/usr/sbin/afsd
else
VICEETC=/usr/vice/etc
AFSD=$VICEETC/afsd
fi
CONFIG=$VICEETC/config
AFSDOPT=$CONFIG/afsd.options
PACKAGE=$CONFIG/package.options
LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
if [ -f $AFSDOPT ]; then
OPTIONS=`cat $AFSDOPT`
else
OPTIONS=$MEDIUM
fi
# Need the commands ps, awk, kill, sleep
PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
if kmodstat | grep -q openafs ; then
:
else
if [ -d $VICEETC/afs.kext ]; then
echo "Loading AFS kernel extensions"
kextload $VICEETC/afs.kext
else
echo "$VICEETC/afs.kext does not exist. Skipping AFS startup."
exit 1
fi
fi
if kmodstat | grep -q openafs ; then
:
else
echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
fi
#
# Start the AFS server processes if a bosserver exists
#
if [ -x /usr/afs/bin/bosserver ]; then
echo "Starting AFS Server processes"
/usr/afs/bin/bosserver
OPTIONS="$OPTIONS -nosettime"
sleep 30
fi
#
# Check that all of the client configuration files exist
#
for file in $AFSD $VICEETC/cacheinfo \
$VICEETC/ThisCell $VICEETC/CellServDB
do
if [ ! -f ${file} ]; then
echo "${file} does not exist. Not starting AFS client."
exit 1
fi
done
#
# Check that the root directory for AFS (/afs)
# and the cache directory (/usr/vice/cache) both exist
#
for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
do
if [ ! -d ${dir} ]; then
echo "${dir} does not exist. Not starting AFS client."
exit 2
fi
done
echo "Starting afsd"
$AFSD $OPTIONS
#
# Run package to update the disk
#
if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
/usr/afsws/etc/package -v -o `cat $PACKAGE` > /dev/console 2>&1
case $? in
0)
(echo "Package completed successfully") > /dev/console 2>&1
date > /dev/console 2>&1
;;
4)
(echo "Rebooting to restart system") > /dev/console 2>&1
sync
/sbin/reboot
;;
*)
(echo "Package update failed; continuing") > /dev/console 2>&1
;;
esac
fi
#
# Start AFS inetd services
# (See the AFS Command Ref. for notes on the proper configuration of inetd.afs)
#
if [ -f /usr/sbin/inetd.afs -a -f /etc/inetd.conf.afs ]; then
/usr/sbin/inetd.afs /etc/inetd.conf.afs
fi

View File

@ -0,0 +1,11 @@
{
Description = "OpenAFS network file system";
Provides = ("AFS");
Requires = ("Resolver");
OrderPreference = "None";
Messages =
{
start = "Starting OpenAFS file system";
stop = "Stopping OpenAFS file system";
};
}

View File

@ -93,7 +93,7 @@
#endif
#endif
#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV)
#include <sys/mount.h>
#else
#include <sys/vfs.h>
@ -132,7 +132,7 @@ void set_staticaddrs(void);
#if AFS_HAVE_STATVFS
#include <sys/statvfs.h>
#else
#if !defined(AFS_OSF_ENV)
#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
#include <sys/statfs.h>
#endif
#endif

View File

@ -13,8 +13,6 @@ SRCDIR=DEST/
COMPONENT=afsmonitor
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
CFLAGS=-g -I. \
-I${SRCDIR}include \
-I${SRCDIR}include/afs \

View File

@ -1722,7 +1722,7 @@ int a_newProbeCycle; /* start of a new probe cycle ? */
}
/* copy connection information */
#ifdef AFS_LINUX20_ENV
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt),
sizeof(struct sockaddr_in));
#else
@ -2454,7 +2454,7 @@ int a_newProbeCycle; /* start of new probe cycle ? */
/* copy connection information */
#ifdef AFS_LINUX20_ENV
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt),
sizeof(struct sockaddr_in));
#else

View File

@ -11,7 +11,6 @@ COMPONENT=nsafs
include ../config/Makefile.${SYS_NAME}
UKERNELDIR=../libuafs/
INSTALL=${SRCDIR}bin/install
COMPILE_ET=${SRCDIR}bin/compile_et
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
@ -160,7 +159,7 @@ INCLS=${SRCDIR}include/ubik.h \
${SRCDIR}include/rx/xdr.h \
${SRCDIR}include/rx/rxkad.h \
${SRCDIR}include/afs/com_err.h \
weblog_errors.h $(DCE_DLOG_INCLUDES)
weblog_errors.h $(DCE_DLOG_INCLUDES)
deslib=${SRCDIR}lib/libdes.a
rxkadlib=${SRCDIR}lib/librxkad.a
authlib=${SRCDIR}lib/afs/libauth.a

View File

@ -20,7 +20,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
UKERNELDIR = ../libuafs/
LOCALDIR = ${DESTDIR}root.server/usr/afs/local/
INSTALL = ${SRCDIR}bin/install
audobjs = audit.o

View File

@ -12,7 +12,6 @@ include ../config/Makefile.${SYS_NAME}
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
INSTALL = ${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \
acfg_errors.o ktc_errors.o # comktc.o comvice.o comauth.o
@ -48,8 +47,7 @@ setkey.o: setkey.c ${INCLS} AFS_component_version_number.o
#comauth.o: comauth.c ${INCLS} ${SRCDIR}include/afs/vice.h
ktc.krb.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h
${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c
mv ktc.o ktc.krb.o
${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c -o ktc.krb.o
ktc.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h
${CC} ${CFLAGS} -DMAYBE_NO_KTC -c ktc.c

View File

@ -9,7 +9,6 @@ SHELL=/bin/sh
COMPONENT=bozo
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
COMPILE_ET=$(SRCDIR)bin/compile_et
CFLAGS=-g -I${SRCDIR}include ${XCFLAGS}
RPCINCLS=${SRCDIR}include/lwp.h ${SRCDIR}include/rx/rx.h bosint.h

View File

@ -9,7 +9,6 @@ SHELL = /bin/sh
COMPONENT=bu_utils
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${DESTDIR}/bin/compile_et
CFLAGS= -g -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS}
LDFLAGS = ${XLDFLAGS}

View File

@ -9,7 +9,6 @@ SHELL = /bin/sh
COMPONENT=bubasics
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
RXGEN=${SRCDIR}bin/rxgen
COMPILE_ET = ${SRCDIR}bin/compile_et

View File

@ -9,7 +9,6 @@ SHELL = /bin/sh
COMPONENT=bucoord
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
CFLAGS= ${DBUG} -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS}

View File

@ -12,7 +12,6 @@ SHELL = /bin/sh
COMPONENT=budb
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
RXGEN=${SRCDIR}bin/rxgen

View File

@ -9,8 +9,6 @@ SHELL = /bin/sh
COMPONENT=butc
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
CFLAGS=-g -w ${INCDIRS} ${XCFLAGS}
INCDIRS= -I${SRCDIR}include/afs -I${SRCDIR}include/rx -I${SRCDIR}include

View File

@ -97,7 +97,7 @@ afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBS
else \
sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
#ifdef AFS_NT40_ENV
#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
localtime_r(t, tm)
time_t *t;
struct tm *tm;

View File

@ -10,7 +10,6 @@
SHELL = /bin/sh
SRCDIR=DEST/
DESTDIR=DEST/
INSTALL=${SRCDIR}bin/install
CFLAGS = -g -w -I${SRCDIR}include ${XCFLAGS}
LDFLAGS = -g ${XLDFLAGS}

View File

@ -11,7 +11,6 @@ SHELL = /bin/sh
COMPONENT=cmd
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
INCLS=cmd.h ${XINCLS}

View File

@ -17,7 +17,6 @@ LINTFILES= error_msg.c et_name.c com_err.c
LIBOBJS= error_msg.o et_name.o com_err.o
UKERNELDIR=../libuafs/
INSTALL=${SRCDIR}bin/install
CFLAGS= ${OPTMZ} -I${DESTDIR}include ${XCFLAGS}
FILES= Makefile et_name.c error_msg.c compile_et.c \

View File

@ -21,8 +21,8 @@ OPTMZ=-O2
DBG=-g3
CSTATIC=-non_shared
RANLIB=/bin/true
WASHTOOL=${SRCDIR}bin/washtool
INSTALL=${SRCDIR}bin/install
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#this is for the vol package
FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D

View File

@ -22,8 +22,8 @@ DBG=-g3
CP=cp
CSTATIC=-non_shared
RANLIB=/bin/true
WASHTOOL=${SRCDIR}bin/washtool
INSTALL=${SRCDIR}bin/install
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#this is for the vol package
FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D

View File

@ -21,8 +21,8 @@ LWP_OPTMZ=-O
OPTMZ=-O
DBG=-g
RANLIB=ranlib
INSTALL=${SRCDIR}bin/install
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
RM=/bin/rm
CP=/bin/cp
AR=/bin/ar

View File

@ -39,13 +39,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -30,13 +30,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -0,0 +1,46 @@
# Keep macros within each section in sorted order for clean diff displays.
#
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = DARWIN
#
# Pointers to destination and source directories
DESTDIR=DEST/
DESTDIR=DEST/
#
# compilation and link editor flags
XCFLAGS=-traditional-cpp
#MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
#MT_CC=cc
KROOT=
KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
#SHARE_LDFLAGS =
LWP_OPTMZ=-g
OPTMZ=-g
DBG=-g
REGEX_OBJ=regex.o
#
# libraries
#XLIBS=
TXLIBS=
#MTLIBS=
#XLIBELFA=
#XLIBKVM=
#
SHLIB_SUFFIX=
SHLIB_CFLAGS=
#
# programs
AR=ar
AS=as
CC=cc
CP=cp
INSTALL=${DESTDIR}bin/pinstall
LEX=lex -l
LD= ld
LORDER = lorder
MV=mv
RANLIB=ranlib
RM=rm
STRIP= strip

View File

@ -0,0 +1,46 @@
# Keep macros within each section in sorted order for clean diff displays.
#
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = DARWIN
#
# Pointers to destination and source directories
DESTDIR=DEST/
DESTDIR=DEST/
#
# compilation and link editor flags
XCFLAGS=-traditional-cpp
#MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
#MT_CC=cc
KROOT=
KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
#SHARE_LDFLAGS =
LWP_OPTMZ=-g
OPTMZ=-g
DBG=-g
REGEX_OBJ=regex.o
#
# libraries
#XLIBS=
TXLIBS=
#MTLIBS=
#XLIBELFA=
#XLIBKVM=
#
SHLIB_SUFFIX=
SHLIB_CFLAGS=
#
# programs
AR=ar
AS=as
CC=cc
CP=cp
INSTALL=${DESTDIR}bin/pinstall
LEX=lex -l
LD= ld
LORDER = lorder
MV=mv
RANLIB=ranlib
RM=rm
STRIP= strip

View File

@ -30,13 +30,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -29,13 +29,13 @@ MT_CC=xlc_r
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
LEX=lex
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
XBSA_FLAGS=-Dxbsa

View File

@ -35,13 +35,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=gcc
MT_CC=gcc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -33,13 +33,13 @@ AR=ar
AS=as
CP=cp
MT_CC=cc
INSTALL=${SRCDIR}bin/install
LD=ld
LEX=lex
MV=mv
RANLIB=/bin/true
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# This is for the vol package
XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check

View File

@ -33,10 +33,10 @@ AR=ar
AS=as
CP=cp
MT_CC=cc
INSTALL=${SRCDIR}bin/install
LD=ld
LEX=lex
MV=mv
RANLIB=/bin/true
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install

View File

@ -34,13 +34,13 @@ AR=ar
AS=as
CP=cp
MT_CC=cc
INSTALL=${SRCDIR}bin/install
LD=ld
LEX=lex
MV=mv
RANLIB=/bin/true
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# This is for the vol package
XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check

View File

@ -34,13 +34,13 @@ AR=ar
AS=as
CP=cp
MT_CC=/usr/bin/cc
INSTALL=${SRCDIR}bin/install
LD=/usr/bin/ld
LEX=lex
MV=mv
RANLIB=/bin/true
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# This is for the vol package
XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check

View File

@ -34,13 +34,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -34,13 +34,13 @@ XLIBS=
AR=ar
AS=as
CP=cp
INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#

View File

@ -32,7 +32,6 @@ AS=as
CC=/opt/SUNWspro/bin/cc
MT_CC=/opt/SUNWspro/bin/cc
CP=/bin/cp
INSTALL=${SRCDIR}bin/install
LEX=lex
LD= /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
@ -40,7 +39,8 @@ MV=mv
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# this is for the vol package
FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26

View File

@ -36,7 +36,6 @@ AS=as
CC=/opt/SUNWspro/bin/cc
MT_CC=/opt/SUNWspro/bin/cc
CP=/bin/cp
INSTALL=${SRCDIR}bin/install
LEX=lex
LD= /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
@ -44,7 +43,8 @@ MV=mv
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# this is for the vol package
FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26

View File

@ -40,7 +40,6 @@ AS=as
CC=/opt/SUNWspro/bin/cc
MT_CC=/opt/SUNWspro/bin/cc
CP=/bin/cp
INSTALL=${SRCDIR}bin/install
LEX=lex
LD= /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
@ -48,7 +47,8 @@ MV=mv
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# this is for the vol package
FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26

View File

@ -33,7 +33,6 @@ AS=as
CC=/opt/SUNWspro/bin/cc
MT_CC=/opt/SUNWspro/bin/cc
CP=/bin/cp
INSTALL=${SRCDIR}bin/install
LEX=lex
LD= /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
@ -41,7 +40,8 @@ MV=mv
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
WASHTOOL=${SRCDIR}bin/washtool
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install
#
# this is for the vol package
FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26

View File

@ -18,3 +18,5 @@ AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
STRIP= /usr/ccs/bin/strip
WASHTOOL=${DESTDIR}bin/washtool
INSTALL=${DESTDIR}bin/install

View File

@ -47,6 +47,8 @@
#define SYS_NAME_ID_mac2_51 500
#define SYS_NAME_ID_mac_aux10 501
#define SYS_NAME_ID_mac_mach51 502
#define SYS_NAME_ID_ppc_darwin_12 503
#define SYS_NAME_ID_ppc_darwin_13 504
#define SYS_NAME_ID_next_mach20 601
#define SYS_NAME_ID_next_mach30 602

View File

@ -16,7 +16,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifndef __APPLE_CC__
#include <malloc.h>
#endif
#include <assert.h>
#include <string.h>

View File

@ -0,0 +1,58 @@
#ifndef _PARAM_PPC_DARWIN_H_
#define _PARAM_PPC_DARWIN_H_
#define AFS_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_PPC_ENV 1
#define AFS_VFSINCL_ENV 1
#include <afs/afs_sysnames.h>
#define AFS_DARWIN_ENV
#define AFS_NONFSTRANS
#define AFS_SYSCALL 230
/* File system entry (used if mount.h doesn't define MOUNT_AFS */
#define AFS_MOUNT_AFS "afs"
/* Machine / Operating system information */
#define sys_ppc_darwin_12 1
#define SYS_NAME "ppc_darwin_12"
#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_12
#define AFSBIG_ENDIAN 1
#define AFS_HAVE_FFS 1 /* Use system's ffs. */
#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
#define RXK_LISTENER_ENV 1
#ifdef KERNEL
#undef MACRO_BEGIN
#undef MACRO_END
#include <kern/macro_help.h>
#define AFS_GLOBAL_SUNLOCK 1
#define AFS_VFS34 1 /* What is VFS34??? */
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define afsio_seg uio_segflg
#define afsio_resid uio_resid
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define AFS_CLBYTES CLBYTES
#define osi_GetTime(x) microtime(x)
#define AFS_KALLOC(x) kalloc(x)
#define AFS_KFREE(x,y) kfree(x,y)
#define v_count v_usecount
#define v_vfsp v_mount
#define vfs_bsize mnt_stat.f_bsize
#define vfs_fsid mnt_stat.f_fsid
#define va_nodeid va_fileid
#define vfs_vnodecovered mnt_vnodecovered
#define direct dirent
#define vnode_t struct vnode
#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
#endif
#endif _PARAM_PPC_DARWIN_H_

View File

@ -0,0 +1,46 @@
#ifndef _PARAM_PPC_DARWIN_H_
#define _PARAM_PPC_DARWIN_H_
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_PPC_ENV 1
#include <afs/afs_sysnames.h>
#define AFS_USERSPACE_ENV
#define AFS_USR_DARWIN_ENV
#define AFS_NONFSTRANS
#define AFS_SYSCALL 230
/* File system entry (used if mount.h doesn't define MOUNT_AFS */
#define AFS_MOUNT_AFS "afs"
/* Machine / Operating system information */
#define sys_ppc_darwin_12 1
#define SYS_NAME "ppc_darwin_12"
#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_12
#define AFSBIG_ENDIAN 1
#define AFS_HAVE_FFS 1 /* Use system's ffs. */
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
#define RXK_LISTENER_ENV 1
#define AFS_VFS34 1 /* What is VFS34??? */
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define afsio_seg uio_segflg
#define afsio_resid uio_resid
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define VATTR_NULL usr_vattr_null
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define CMSERVERPREF
#endif
#endif _PARAM_PPC_DARWIN_H_

View File

@ -0,0 +1,60 @@
#ifndef _PARAM_PPC_DARWIN_H_
#define _PARAM_PPC_DARWIN_H_
#define AFS_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_PPC_ENV 1
#define AFS_VFSINCL_ENV 1
#include <afs/afs_sysnames.h>
#define AFS_DARWIN_ENV
#define AFS_DARWIN13_ENV
#define AFS_NONFSTRANS
#define AFS_SYSCALL 230
/* File system entry (used if mount.h doesn't define MOUNT_AFS */
#define AFS_MOUNT_AFS "afs"
/* Machine / Operating system information */
#define sys_ppc_darwin_12 1
#define sys_ppc_darwin_13 1
#define SYS_NAME "ppc_darwin_13"
#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_13
#define AFSBIG_ENDIAN 1
#define AFS_HAVE_FFS 1 /* Use system's ffs. */
#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
#define RXK_LISTENER_ENV 1
#ifdef KERNEL
#undef MACRO_BEGIN
#undef MACRO_END
#include <kern/macro_help.h>
#define AFS_GLOBAL_SUNLOCK 1
#define AFS_VFS34 1 /* What is VFS34??? */
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define afsio_seg uio_segflg
#define afsio_resid uio_resid
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define AFS_CLBYTES CLBYTES
#define osi_GetTime(x) microtime(x)
#define AFS_KALLOC(x) kalloc(x)
#define AFS_KFREE(x,y) kfree(x,y)
#define v_count v_usecount
#define v_vfsp v_mount
#define vfs_bsize mnt_stat.f_bsize
#define vfs_fsid mnt_stat.f_fsid
#define va_nodeid va_fileid
#define vfs_vnodecovered mnt_vnodecovered
#define direct dirent
#define vnode_t struct vnode
#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
#endif
#endif _PARAM_PPC_DARWIN_H_

View File

@ -0,0 +1,48 @@
#ifndef _PARAM_PPC_DARWIN_H_
#define _PARAM_PPC_DARWIN_H_
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_PPC_ENV 1
#include <afs/afs_sysnames.h>
#define AFS_USERSPACE_ENV
#define AFS_USR_DARWIN_ENV
#define AFS_USR_DARWIN13_ENV
#define AFS_NONFSTRANS
#define AFS_SYSCALL 230
/* File system entry (used if mount.h doesn't define MOUNT_AFS */
#define AFS_MOUNT_AFS "afs"
/* Machine / Operating system information */
#define sys_ppc_darwin_12 1
#define sys_ppc_darwin_13 1
#define SYS_NAME "ppc_darwin_13"
#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_13
#define AFSBIG_ENDIAN 1
#define AFS_HAVE_FFS 1 /* Use system's ffs. */
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
#define RXK_LISTENER_ENV 1
#define AFS_VFS34 1 /* What is VFS34??? */
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define afsio_seg uio_segflg
#define afsio_resid uio_resid
#define AFS_UIOSYS UIO_SYSSPACE
#define AFS_UIOUSER UIO_USERSPACE
#define VATTR_NULL usr_vattr_null
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define CMSERVERPREF
#endif
#endif _PARAM_PPC_DARWIN_H_

View File

@ -9,7 +9,6 @@ SHELL = /bin/sh
COMPONENT= dauth
include ../config/Makefile.${SYS_NAME}
INSTALL= ${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
OPTMZ= -g
@ -17,11 +16,11 @@ CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS}
LDFLAGS = ${OPTMZ} ${XLDFLAGS}
INCLS= ${SRCDIR}include/ubik.h \
${SRCDIR}include/lwp.h \
${SRCDIR}include/lock.h \
${SRCDIR}include/rx/rx.h \
${SRCDIR}include/rx/xdr.h \
${SRCDIR}include/afs/com_err.h
${SRCDIR}include/lwp.h \
${SRCDIR}include/lock.h \
${SRCDIR}include/rx/rx.h \
${SRCDIR}include/rx/xdr.h \
${SRCDIR}include/afs/com_err.h
VERSION = AFS_component_version_number.o
OBJS = adkint.cs.o adkint.xdr.o
@ -71,7 +70,7 @@ dpass: dpass.o $(VERSION) $(LIBS)
dlog_test: dlog.c $(OBJS) $(LIBS)
$(CC) $(LDFLAGS) -DDLOG_TEST -o dlog_test dlog.c $(OBJS) \
$(LIBS) ${XLIBS}
system: install
${DESTDIR}bin/dlog: dlog

View File

@ -26,7 +26,6 @@ SHELL = /bin/sh
include ../config/Makefile.${SYS_NAME}
UKERNELDIR=../libuafs/
INSTALL=${SRCDIR}bin/install
SRC =.
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1

View File

@ -63,8 +63,12 @@
#endif /* AFS_SPARC_LINUX20_ENV */
#endif
#else
#if defined(AFS_DARWIN_ENV) && defined(AFS_PPC_ENV)
#include "conf-ppc-darwin.h"
#else
Sorry, you lose.
Figure out what the machine looks like and fix this file to include it.
#endif
#endif /* AFS_LINUX20_ENV */
#endif /* AFS_NT40_ENV */
#endif /* NCR || X86 */

View File

@ -0,0 +1,6 @@
#define BITS32
#define BIG
#undef BSDUNIX
#define MSBFIRST
#define MUSTALIGN

View File

@ -93,7 +93,7 @@ des_random_key(key)
*
* Note: this routine calls des_set_random_generator_seed.
*/
#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
you lose... (aka, you get to implement an analog of this for your
system...)
#else

View File

@ -33,7 +33,7 @@
#include <setjmp.h>
#endif
#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
#include <signal.h>
#endif
@ -48,6 +48,9 @@ static int intrupt;
#include <termios.h>
#endif
#ifdef AFS_DARWIN_ENV
#include <termios.h>
#endif
#ifdef AFS_NT40_ENV
#include <windows.h>
#endif
@ -99,7 +102,7 @@ lose:
return ok;
}
#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV)
#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
static void catch(int);
#endif
@ -121,11 +124,14 @@ des_read_pw_string(s,maxa,prompt,verify)
{
int ok = 0, cnt1=0;
char *ptr;
#ifdef AFS_HPUX_ENV
#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV)
register int fno;
struct sigaction newsig, oldsig;
struct termios save_ttyb, ttyb;
#endif
#if defined(AFS_DARWIN_ENV)
FILE *fi;
#endif
#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
struct termios ttyb;
struct sigaction osa, sa;
@ -156,7 +162,7 @@ des_read_pw_string(s,maxa,prompt,verify)
return -1;
}
#ifdef AFS_HPUX_ENV
#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV)
if ((fi = fopen("/dev/tty", "r")) == NULL)
return -1;
setbuf(fi, (char *)NULL); /* We don't want any buffering for our i/o. */
@ -382,7 +388,7 @@ sig_restore()
#endif
#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV)
#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
static void
catch(int junk)
{

View File

@ -14,7 +14,6 @@ include ../config/Makefile.${SYS_NAME}
RM = /bin/rm
UKERNELDIR=../libuafs/
INSTALL=${SRCDIR}bin/install
SRC =.
DESPAR =../../../DESLIB/dest/
DESINC =${DESPAR}include/

View File

@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME}
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
INSTALL = ${SRCDIR}bin/install
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
INCDIRS= -I${DESTDIR}include ${XINCLS}

View File

@ -13,7 +13,6 @@
COMPONENT=export
include ../config/Makefile.${SYS_NAME}
INSTALL = ${SRCDIR}bin/install
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
DEFS =

View File

@ -10,7 +10,6 @@ include ../config/Makefile.${SYS_NAME}
SHELL = /bin/sh
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
INSTALL = ${SRCDIR}bin/install
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
OBJS=afsaux.o afscbint.cs.o afscbint.ss.o afscbint.xdr.o afsint.cs.o afsint.ss.o afsint.xdr.o

View File

@ -16,7 +16,7 @@
#include "../afs/afsincludes.h"
#include "../rx/xdr.h"
#else /* defined(UKERNEL) */
#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV)
#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#else
@ -57,12 +57,13 @@ static afs_int32 bslosers = 0;
/* these things are defined in R (but not RX's) library. For now, we add them
only for the kernel system. Later, when R is expunged, we'll remove the ifdef */
#ifdef KERNEL
#ifndef AFS_USR_DARWIN_ENV
#ifdef AFS_AIXNFS11
#define AUTH_DES 1
#endif
#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV)
#ifndef AFS_AIX32_ENV
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
/*
* XDR chars; from user mode xdr package.
*/
@ -145,6 +146,7 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
}
return(TRUE);
}
#endif
#endif /* KERNEL */
#ifndef KERNEL

View File

@ -12,8 +12,6 @@ SHELL = /bin/sh
COMPONENT=fsprobe
include ../config/Makefile.${SYS_NAME}
INSTALL=${SRCDIR}bin/install
CFLAGS=-g -I. \
-I${SRCDIR}include \
-I${SRCDIR}include/afs \

Some files were not shown because too many files have changed in this diff Show More