--- /dev/null
+# 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
+
+# $Locker$
+#
+# misc.s - miscellaneous assembler routines for the rs/6000
+#
+
+#
+# get_toc - return the current TOC
+#
+ .csect .get_toc[PR]
+ .globl .get_toc[PR]
+ mr 3,2 # get TOC
+ br
+ .align 2
+ .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0
+
+ .toc
+ .csect get_toc[DS]
+ .globl get_toc[DS]
+ .long .get_toc[PR]
+ .long TOC[t0]
+
+#
+# get_ret_addr - return the caller's return address
+#
+ .csect .get_ret_addr[PR]
+ .globl .get_ret_addr[PR]
+ l 3, 0(1) # caller's saved stack pointer
+ l 3, 8(3) # caller's saved link register
+ br
+ .align 2
+ .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0
+ .toc
+ .csect get_ret_addr[DS]
+ .globl get_ret_addr[DS]
+ .long .get_ret_addr[PR]
+ .long TOC[t0]
--- /dev/null
+# 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
+
+# $Locker$
+#
+# misc.s - miscellaneous assembler routines for the rs/6000
+#
+
+#
+# get_toc - return the current TOC
+#
+ .csect .get_toc[PR]
+ .globl .get_toc[PR]
+ mr 3,2 # get TOC
+ br
+ .align 2
+ .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0
+
+ .toc
+ .csect get_toc[DS]
+ .globl get_toc[DS]
+ .llong .get_toc[PR]
+ .llong TOC[t0]
+
+#
+# get_ret_addr - return the caller's return address
+#
+ .csect .get_ret_addr[PR]
+ .globl .get_ret_addr[PR]
+ l 3, 0(1) # caller's saved stack pointer
+ l 3, 8(3) # caller's saved link register
+ br
+ .align 2
+ .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0
+ .toc
+ .csect get_ret_addr[DS]
+ .globl get_ret_addr[DS]
+ .llong .get_ret_addr[PR]
+ .llong TOC[t0]
extern struct gfs afs_gfs;
extern struct vnodeops locked_afs_gn_vnodeops;
+#ifdef __64BIT__
+afs_uint64 get_toc();
+#else
+afs_uint32 get_toc();
+#endif
+
#define AFS_CALLOUT_TBL_SIZE 256
#include <sys/lock_alloc.h>
kluge_init() {
register struct k_func *kf;
register struct k_var *kv;
+#ifdef __64BIT__
+ register afs_uint64 toc;
+#else
register afs_uint32 toc;
+#endif
register err = 0;
toc = get_toc();
iget(dev, ino, ipp, doscan, vfsp)
dev_t dev;
ino_t ino;
+#ifdef __64BIT__
+afs_size_t doscan;
+#endif
struct vfs *vfsp;
struct inode **ipp; {
+#ifdef __64BIT__
+ afs_int64 dummy[10];
+ dummy[0] = doscan;
+ return (*kluge_iget)(dev, ino, ipp, (afs_size_t) doscan, vfsp, &dummy);
+#else
return (*kluge_iget)(dev, ino, ipp, doscan, vfsp);
+#endif
}
iput(ip, vfsp)
retry_IO:
/* Note the difference in the way the afile->offset is passed (see comments in gop_rdwr() in afs_aix_subr.c for comments) */
AFS_GUNLOCK();
+#ifdef AFS_64BIT_KERNEL
+ code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize,
+ &afile->offset, AFS_UIOSYS, NULL, &resid);
+#else
code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize,
(off_t)&afile->offset, AFS_UIOSYS, NULL, &resid);
+#endif
AFS_GLOCK();
if (code == 0) {
code = asize - resid;
if (offset != -1) afile->offset = offset;
/* Note the difference in the way the afile->offset is passed (see comments in gop_rdwr() in afs_aix_subr.c for comments) */
AFS_GUNLOCK();
+#ifdef AFS_64BIT_KERNEL
+ code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize,
+ &afile->offset, AFS_UIOSYS, NULL, &resid);
+#else
code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize,
(off_t)&afile->offset, AFS_UIOSYS, NULL, &resid);
+#endif
AFS_GLOCK();
if (code == 0) {
+ if (resid)
+ afs_Trace3(afs_iclSetp, CM_TRACE_WRITEFAILED,
+ ICL_TYPE_INT32, asize,
+ ICL_TYPE_INT32, resid,
+ ICL_TYPE_INT32, code);
code = asize - resid;
afile->offset += code;
}
else {
+ afs_Trace3(afs_iclSetp, CM_TRACE_WRITEFAILED,
+ ICL_TYPE_INT32, asize,
+ ICL_TYPE_INT32, resid,
+ ICL_TYPE_INT32, code);
if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
setuerror(code);
code = -1;
gid_t *gidset,
int change_parent);
-#ifndef AFS_AIX5_ENV
+#ifndef AFS_AIX51_ENV
int
setgroups(ngroups, gidset)
int ngroups;
/* get an existing inode. Common code for iopen, iread/write, iinc/dec. */
/* Also used by rmt_remote to support passing of inode number from venus */
extern int iget();
+extern struct vnode *filevp;
struct inode *
igetinode(dev, vfsp, inode, vpp,perror)
struct vfs *vfsp;
* If it isn't, then we need to reexamine our code to make
* sure that it is still okay.
*/
+#ifdef __64BIT__
+/* osi_Assert(offsetof(struct inode, afs_inode_lock) == 208); */
+#else
osi_Assert(offsetof(struct inode, afs_inode_lock) == 128);
+#endif
if (!vfsp && !(vfsp = devtovfs((dev_t)dev))) {
afs_warn("Dev=%d not mounted!!; quitting\n", dev);
}
ICACHE_LOCK();
+#ifdef __64BIT__
+ if ((code = iget(dev, inode, &ip, (afs_size_t) 1, nvfsp))) {
+#else
if ((code = iget(dev, inode, &ip, 1, nvfsp))) {
+#endif
IGI_error = code;
IGI_inode = inode;
*perror = BAD_IGET;
enum uio_rw rw;
struct vnode *vp;
caddr_t base;
+#ifdef AFS_64BIT_KERNEL
+offset_t *offset;
+#else
off_t *offset;
+#endif
int len, segflg;
int *aresid;
int unit; /* Ignored */
uio_struct.uio_resid = len;
uio_struct.uio_fmode = (rw == UIO_READ ? FREAD : FWRITE);
+#ifdef AFS_64BIT_KERNEL
+ code = VNOP_RDWR(vp, rw,
+ (int32long64_t)(rw == UIO_READ ? FREAD : FWRITE), &uio_struct,
+ (ext_t) 0, (caddr_t) 0, (struct vattr *)0, &afs_osi_cred);
+#else
code = VNOP_RDWR(vp, rw, (rw == UIO_READ ? FREAD : FWRITE), &uio_struct,
NULL, NULL, NULL, &afs_osi_cred);
+#endif
*aresid = uio_struct.uio_resid;
return code;
}
int seq; /* Sequence number: this is incremented
by wakeup calls; wait will not return until
it changes */
- int cond;
+ tid_t cond;
} afs_event_t;
#define HASHSIZE 128
*/
void osi_VM_StoreAllSegments(struct vcache *avc)
{
- if (avc->vmh) {
+ if (avc->segid) {
/*
* The execsOrWriters test is done so that we don't thrash on
* the vm_writep call below. We only initiate a pageout of the
*/
ReleaseWriteLock(&avc->lock); /* XXX */
AFS_GUNLOCK();
- vm_writep(avc->vmh, 0, MAXFSIZE/PAGESIZE -1 );
- vms_iowait(avc->vmh);
+ vm_writep(avc->segid, 0, MAXFSIZE/PAGESIZE -1 );
+ vms_iowait(avc->segid);
AFS_GLOCK();
ObtainWriteLock(&avc->lock,93); /* XXX */
/*
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
vm_flushp(avc->segid, 0, MAXFSIZE/PAGESIZE - 1);
- vms_iowait(avc->vmh); /* XXX Wait?? XXX */
+ vms_iowait(avc->segid); /* XXX Wait?? XXX */
AFS_GLOCK();
ObtainWriteLock(&avc->lock,60);
}
/*
* XXX We probably don't need to wait but better be safe XXX
*/
- vms_iowait(avc->vmh);
+ vms_iowait(avc->segid);
}
}
if (avc->segid) {
int firstpage = (alen + PAGESIZE-1)/PAGESIZE;
vm_releasep(avc->segid, firstpage, MAXFSIZE/PAGESIZE - firstpage);
- vms_iowait(avc->vmh); /* Do we need this? */
+ vms_iowait(avc->segid); /* Do we need this? */
}
}
AFS_STATCNT(afs_gn_link);
error = afs_link(vp, dp, name, cred);
- afs_Trace3(afs_iclSetp, CM_TRACE_GNLINK, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GNLINK, ICL_TYPE_POINTER, vp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, error);
return(error);
}
if (! error) {
AFS_RELE(vp);
}
- afs_Trace4(afs_iclSetp, CM_TRACE_GMKDIR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GMKDIR, ICL_TYPE_POINTER, vp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_remove);
error = afs_remove(dp, name, cred);
- afs_Trace3(afs_iclSetp, CM_TRACE_GREMOVE, ICL_TYPE_POINTER, (afs_int32)dp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GREMOVE, ICL_TYPE_POINTER, dp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_rename);
error = afs_rename(dp, name, tdp, tname, cred);
- afs_Trace4(afs_iclSetp, CM_TRACE_GRENAME, ICL_TYPE_POINTER, (afs_int32)dp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GRENAME, ICL_TYPE_POINTER, dp,
ICL_TYPE_STRING, name, ICL_TYPE_STRING, tname, ICL_TYPE_LONG, error);
return(error);
}
if (error == 66 /* 4.3's ENOTEMPTY */)
error = EEXIST; /* AIX returns EEXIST where 4.3 used ENOTEMPTY */
}
- afs_Trace3(afs_iclSetp, CM_TRACE_GRMDIR, ICL_TYPE_POINTER, (afs_int32)dp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GRMDIR, ICL_TYPE_POINTER, dp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_lookup);
error = afs_lookup(dp, name, vpp, cred);
- afs_Trace3(afs_iclSetp, CM_TRACE_GLOOKUP, ICL_TYPE_POINTER, (afs_int32)dp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GLOOKUP, ICL_TYPE_POINTER, dp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, error);
if (vattrp != NULL && error == 0)
afs_gn_getattr(*vpp, vattrp, cred);
AFS_STATCNT(afs_gn_fid);
error = afs_fid(vp, fidp);
- afs_Trace3(afs_iclSetp, CM_TRACE_GFID, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GFID, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, (afs_int32)fidp, ICL_TYPE_LONG, error);
return(error);
}
}
abort:
- afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, flags, ICL_TYPE_LONG, error);
return(error);
}
*vinfop = cred; /* save user creds in fp->f_vinfo */
error = afs_open(vpp, flags, cred);
}
- afs_Trace4(afs_iclSetp, CM_TRACE_GCREATE, ICL_TYPE_POINTER, (afs_int32)dp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GCREATE, ICL_TYPE_POINTER, dp,
ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error);
return error;
}
/*
* We map the segment into our address space using the handle returned by vm_create.
*/
- if (!vcp->vmh) {
+ if (!vcp->segid) {
afs_uint32 tlen = vcp->m.Length;
#ifdef AFS_64BIT_CLIENT
if (vcp->m.Length > afs_vmMappingEnd)
ReleaseWriteLock(&vcp->lock);
return(EOPNOTSUPP);
}
+#ifdef AFS_64BIT_KERNEL
+ vcp->vmh = vm_handle(vcp->segid, (int32long64_t) 0);
+#else
vcp->vmh = SRVAL(vcp->segid, 0, 0);
+#endif
}
vcp->v.v_gnode->gn_seg = vcp->segid; /* XXX Important XXX */
if (flag & SHM_RDONLY) {
}
ReleaseWriteLock(&vcp->lock);
VN_HOLD(vp);
- afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, addr, ICL_TYPE_LONG, len, ICL_TYPE_LONG, off);
return(0);
}
}
out:
- afs_Trace3(afs_iclSetp, CM_TRACE_GACCESS, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GACCESS, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_getattr);
error = afs_getattr(vp, vattrp, cred);
- afs_Trace2(afs_iclSetp, CM_TRACE_GGETATTR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace2(afs_iclSetp, CM_TRACE_GGETATTR, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, error);
return(error);
}
int
-afs_gn_setattr(vp, Op, Arg1, Arg2, Arg3, cred)
+afs_gn_setattr(vp, op, arg1, arg2, arg3, cred)
struct vnode *vp;
#ifdef AFS_AIX51_ENV
-int32long64_t Op;
-int32long64_t Arg1;
-int32long64_t Arg2;
-int32long64_t Arg3;
+int32long64_t op;
+int32long64_t arg1;
+int32long64_t arg2;
+int32long64_t arg3;
#else
-int Op;
-int Arg1;
-int Arg2;
-int Arg3;
+int op;
+int arg1;
+int arg2;
+int arg3;
#endif
struct ucred *cred;
{
struct vattr va;
int error = 0;
- int op = Op;
- int arg1 = Arg1;
- int arg2 = Arg2;
- int arg3 = Arg3;
AFS_STATCNT(afs_gn_setattr);
VATTR_NULL(&va);
error = afs_setattr(vp, &va, cred);
out:
- afs_Trace2(afs_iclSetp, CM_TRACE_GSETATTR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace2(afs_iclSetp, CM_TRACE_GSETATTR, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, error);
return(error);
}
if (avc->segid) {
AFS_GUNLOCK();
vm_flushp(avc->segid, 0, MAXFSIZE/PAGESIZE - 1);
- vms_iowait(avc->vmh);
+ vms_iowait(avc->segid);
AFS_GLOCK();
}
uio.afsio_offset = offset;
if (error = afs_rdwr(vp, &uio, UIO_WRITE, 0, cred))
break;
}
- afs_Trace4(afs_iclSetp, CM_TRACE_GFCLEAR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GFCLEAR, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, offset, ICL_TYPE_LONG, length, ICL_TYPE_LONG, error);
return (error);
}
AFS_STATCNT(afs_gn_fsync);
error = afs_fsync(vp, cred);
- afs_Trace3(afs_iclSetp, CM_TRACE_GFSYNC, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GFSYNC, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, flags, ICL_TYPE_LONG, error);
return(error);
}
VATTR_NULL(&va);
va.va_size = length;
error = afs_setattr(vp, &va, cred);
- afs_Trace4(afs_iclSetp, CM_TRACE_GFTRUNC, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GFTRUNC, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, flags,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length),
ICL_TYPE_LONG, error);
if (vcp->vc_error) {
if (op == UIO_WRITE) {
afs_Trace2(afs_iclSetp, CM_TRACE_GRDWR1,
- ICL_TYPE_POINTER, (afs_int32)vp,
+ ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, vcp->vc_error);
return vcp->vc_error;
} else
if (vattrp != NULL && error == 0)
afs_gn_getattr(vp, vattrp, cred);
- afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, flags, ICL_TYPE_LONG, op, ICL_TYPE_LONG, error);
if (free_cred)
register int i;
afs_int32 blockSize;
afs_size_t fileSize, xfrOffset, offset, old_offset, xfrSize;
- afs_int32 txfrSize;
+ vmsize_t txfrSize;
#ifdef AFS_64BIT_CLIENT
afs_size_t finalOffset;
- afs_int32 toffset;
+ off_t toffset;
int mixed = 0;
#endif /* AFS_64BIT_CLIENT */
register struct vcache *vcp = VTOAFS(vp);
}
#endif /* AFS_64BIT_CLIENT */
- if (!vcp->vmh) {
+ if (!vcp->segid) {
afs_uint32 tlen = vcp->m.Length;
#ifdef AFS_64BIT_CLIENT
if (vcp->m.Length > afs_vmMappingEnd)
tlen, 0, 0)) {
goto fail;
}
+#ifdef AFS_64BIT_KERNEL
+ vcp->vmh = vm_handle(vcp->segid, (int32long64_t) 0);
+#else
vcp->vmh = SRVAL(vcp->segid, 0, 0);
+#endif
}
vcp->v.v_gnode->gn_seg = vcp->segid;
if (rw == UIO_READ) {
if (vcp->m.Length > afs_vmMappingEnd)
last_page = afs_vmMappingEnd/PAGESIZE;
#endif
- vm_protectp(vcp->vmh, last_page, 1, FILEKEY);
+ vm_protectp(vcp->segid, last_page, 1, FILEKEY);
if (xfrSize + xfrOffset > fileSize) {
vcp->m.Length = xfrSize+xfrOffset;
}
first_page = (afs_size_t)old_offset >> PGSHIFT;
pages = 1 + (((afs_size_t)old_offset + (len - 1)) >> PGSHIFT) - first_page;
afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE2,
- ICL_TYPE_POINTER, (afs_int32) vcp,
+ ICL_TYPE_POINTER, vcp,
ICL_TYPE_INT32, first_page,
ICL_TYPE_INT32, pages);
AFS_GUNLOCK();
if (code == 0 && (vcp->states & CDirty)) {
code = afs_DoPartialWrite(vcp, &treq);
}
- vm_protectp(vcp->vmh, last_page, 1, RDONLY);
+ vm_protectp(vcp->segid, last_page, 1, RDONLY);
ReleaseWriteLock(&vcp->lock);
/* If requested, fsync the file after every write */
ReleaseWriteLock(&vcp->lock);
}
afs_Trace3(afs_iclSetp, CM_TRACE_DIRECTRDWR,
- ICL_TYPE_POINTER, (afs_int32)vp,
+ ICL_TYPE_POINTER, vp,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(uiop->afsio_offset),
ICL_TYPE_LONG, uiop->afsio_resid);
code = afs_rdwr(vp, uiop, rw, ioflag, credp);
lckdat->l_len = flkd.l_len;
lckdat->l_pid = flkd.l_pid;
lckdat->l_sysid = flkd.l_sysid;
- afs_Trace3(afs_iclSetp, CM_TRACE_GLOCKCTL, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GLOCKCTL, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, ncmd, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_ioctl);
/* This seems to be a perfect fit for our ioctl redirection (afs_xioctl hack); thus the ioctl(2) entry in sysent.c is unaffected in the aix/afs port. */
error = afs_ioctl(vp, cmd, arg);
- afs_Trace3(afs_iclSetp, CM_TRACE_GIOCTL, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace3(afs_iclSetp, CM_TRACE_GIOCTL, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, cmd, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_readlink);
error = afs_readlink(vp, uiop, cred);
- afs_Trace2(afs_iclSetp, CM_TRACE_GREADLINK, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace2(afs_iclSetp, CM_TRACE_GREADLINK, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, error);
return(error);
}
VATTR_NULL(&va);
va.va_mode = 0777;
error = afs_symlink(vp, link, &va, target, cred);
- afs_Trace4(afs_iclSetp, CM_TRACE_GSYMLINK, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace4(afs_iclSetp, CM_TRACE_GSYMLINK, ICL_TYPE_POINTER, vp,
ICL_TYPE_STRING, link, ICL_TYPE_STRING, target, ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_readdir);
error = afs_readdir(vp, uiop, cred);
- afs_Trace2(afs_iclSetp, CM_TRACE_GREADDIR, ICL_TYPE_POINTER, (afs_int32)vp,
+ afs_Trace2(afs_iclSetp, CM_TRACE_GREADDIR, ICL_TYPE_POINTER, vp,
ICL_TYPE_LONG, error);
return(error);
}
register struct buf *abp;
{
register struct buf **lbp, *tbp;
+#ifdef AFS_64BIT_KERNEL
+ afs_int64 *lwbp; /* last quy in work chain */
+#else
int *lwbp; /* last guy in work chain */
+#endif
struct buf *nbp, *qbp, *qnbp, *firstComparable;
int doMerge;
int oldPriority;
/* merge both of these blocks together */
/* first set age to the older of the two */
+#ifdef AFS_64BIT_KERNEL
+ if ((afs_int64) qnbp->av_back - (afs_int64) qbp->av_back < 0)
+#else
if ((int) qnbp->av_back - (int) qbp->av_back < 0)
+#endif
qbp->av_back = qnbp->av_back;
lwbp = &qbp->b_work;
/* find end of qbp's work queue */
*/
qbp->av_forw = qnbp->av_forw; /* splice out qnbp */
qbp->b_bcount += qnbp->b_bcount; /* fix count */
+#ifdef AFS_64BIT_KERNEL
+ *lwbp = (afs_int64) qnbp; /* append qnbp to end */
+#else
*lwbp = (int) qnbp; /* append qnbp to end */
+#endif
/*
* note that qnbp is bogus, but it doesn't matter because
* we're going to restart the for loop now.
/*
* Set the primary cell name.
*/
- call_syscall(AFSOP_SET_THISCELL, afs_LclCellName, 0, 0, 0, 0);
+ call_syscall(AFSOP_SET_THISCELL, (long) afs_LclCellName, 0, 0, 0, 0);
if ((logfd = fopen(fullpn_AFSLogFile,"r+")) == 0) {
if (afsd_verbose) printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile);
#define uprintf printf
#define usr_getpid() (int)(usr_thread_self())
+#ifdef ISAFS_GLOCK
+#undef ISAFS_GLOCK
+#endif
#define ISAFS_GLOCK() (usr_thread_self() == afs_global_owner)
#endif /* NETSCAPE_NSAPI */
OSI_VC_CONVERT(avc)
AFS_STATCNT(afs_setattr);
- afs_Trace2(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc,
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+ afs_Trace4(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_INT32, attrs->va_mask,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(attrs->va_size),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
+#else
+ afs_Trace4(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_INT32, attrs->va_mode,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(attrs->va_size),
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
+#endif
if ((code = afs_InitReq(&treq, acred))) return code;
afs_InitFakeStat(&fakestate);
* Implements:
* afs_MemRead
* afs_PrefetchChunk
- * afs_UFSReadFast
* afs_UFSRead
*
*/
error = code;
break;
}
- /* fetching flag gone, data is here, or we never tried (BBusy for instance) */
+ /* fetching flag gone, data is here, or we never tried
+ * (BBusy for instance) */
if (tdc->dflags & DFFetching) {
- /* still fetching, some new data is here: compute length and offset */
+ /* still fetching, some new data is here:
+ * compute length and offset */
offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
len = tdc->validPos - filePos;
}
else {
- /* no longer fetching, verify data version (avoid new GetDCache call) */
- if (hsame(avc->m.DataVersion, tdc->f.versionNo)) {
+ /* no longer fetching, verify data version
+ * (avoid new GetDCache call) */
+ if (hsame(avc->m.DataVersion, tdc->f.versionNo)
+ && ((len = tdc->validPos - filePos) > 0)) {
offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
}
else {
/* don't have current data, so get it below */
}
if (!tdc) {
+ /* If we get, it was not possible to start the
+ * background daemon. With flag == 1 afs_GetDCache
+ * does the FetchData rpc synchronously.
+ */
ReleaseReadLock(&avc->lock);
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1);
ObtainReadLock(&avc->lock);
}
}
+ afs_Trace3(afs_iclSetp, CM_TRACE_VNODEREAD,
+ ICL_TYPE_POINTER, tdc,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(offset),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(len));
if (!tdc) {
error = EIO;
break;
}
}
-
-/* if the vcache is up-to-date, and the request fits entirely into the chunk
- * that the hint here references, then we just use it quickly, otherwise we
- * have to call the slow read.
- *
- * This could be generalized in several ways to take advantage of partial
- * state even when all the chips don't fall the right way. For instance,
- * if the hint is good and the first part of the read request can be
- * satisfied from the chunk, then just do the read. After the read has
- * completed, check to see if there's more. (Chances are there won't be.)
- * If there is more, then just call afs_UFSReadSlow and let it do the rest.
- *
- * For the time being, I'm ignoring quick.f, but it should be used at
- * some future date.
- * do this in the future avc->quick.f = tfile; but I think it
- * has to be done under a write lock, but don't want to wait on the
- * write lock
- */
- /* everywhere that a dcache can be freed (look for NULLIDX)
- * probably does it under a write lock on xdcache. Need to invalidate
- * stamp there, too.
- * Also need to worry about DFFetching, and IFFree, I think. */
-static struct dcache *savedc = 0;
-
-int afs_UFSReadFast(register struct vcache *avc, struct uio *auio,
- struct AFS_UCRED *acred, daddr_t albn, struct buf **abpp, int noLock)
-{
- struct vrequest treq;
- int offDiff;
- struct dcache *tdc;
- struct osi_file *tfile;
- afs_int32 code = 0;
-
- if (!noLock)
- ObtainReadLock(&avc->lock);
- ObtainReadLock(&afs_xdcache);
-
- if ((avc->states & CStatd) /* up to date */
- && (tdc = avc->quick.dc) && (tdc->index != NULLIDX)
- && !(afs_indexFlags[tdc->index] & (IFFree | IFDiscarded))) {
-
- int readLocked = 0;
-
- afs_RefDCache(tdc);
- ReleaseReadLock(&afs_xdcache);
- if (tdc->stamp == avc->quick.stamp) {
- readLocked = 1;
- ObtainReadLock(&tdc->lock);
- }
-
- if ((tdc->stamp == avc->quick.stamp) /* hint matches */
- && ((offDiff = (afs_size_t)(auio->afsio_offset - avc->quick.minLoc)) >= 0)
- && (tdc->f.chunkBytes >= auio->afsio_resid + offDiff)
- && !(tdc->dflags & DFFetching)) { /* fits in chunk */
-
- auio->afsio_offset -= avc->quick.minLoc;
-
- afs_Trace4(afs_iclSetp, CM_TRACE_READFAST, ICL_TYPE_POINTER, avc,
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(auio->afsio_offset),
- ICL_TYPE_INT32, auio->afsio_resid,
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
-
- tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
-
-#ifdef AFS_AIX_ENV
-#ifdef AFS_AIX41_ENV
- AFS_GUNLOCK();
- code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, auio, NULL, NULL, NULL, &afs_osi_cred);
- AFS_GLOCK();
-#else
-#ifdef AFS_AIX32_ENV
- code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, auio, NULL, NULL);
-#else
- code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, (off_t)&auio->afsio_offset, auio, NULL, NULL, -1);
-#endif
-#endif
-#else
-#ifdef AFS_SUN5_ENV
- AFS_GUNLOCK();
- VOP_RWLOCK(tfile->vnode, 0);
- code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
- VOP_RWUNLOCK(tfile->vnode, 0);
- AFS_GLOCK();
-#else
-#if defined(AFS_SGI_ENV)
- AFS_GUNLOCK();
- AFS_VOP_RWLOCK(tfile->vnode, VRWLOCK_READ);
- AFS_VOP_READ(tfile->vnode, auio, IO_ISLOCKED, &afs_osi_cred, code);
- AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_READ);
- AFS_GLOCK();
-#else
-#ifdef AFS_OSF_ENV
- auio->uio_rw = UIO_READ;
- AFS_GUNLOCK();
- VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred, code);
- AFS_GLOCK();
-#else /* AFS_OSF_ENV */
-#if defined(AFS_HPUX100_ENV)
- AFS_GUNLOCK();
- code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
- AFS_GLOCK();
-#else
-#if defined(AFS_LINUX20_ENV)
- 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
-#if defined(AFS_XBSD_ENV)
- AFS_GUNLOCK();
- VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
- code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
- VOP_UNLOCK(tfile->vnode, 0, curproc);
- AFS_GLOCK();
-#else
- code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
-#endif
-#endif
-#endif
-#endif
-#endif
-#endif
-#endif
-#endif
- auio->afsio_offset += avc->quick.minLoc;
- osi_UFSClose(tfile);
- /* Fix up LRU info */
- hset(afs_indexTimes[tdc->index], afs_indexCounter);
- hadd32(afs_indexCounter, 1);
-
- if (!noLock) {
- ReleaseReadLock(&avc->lock);
-#if !defined(AFS_VM_RDWR_ENV)
- if (!(code = afs_InitReq(&treq, acred))) {
- if (!(tdc->mflags & DFNextStarted))
- afs_PrefetchChunk(avc, tdc, acred, &treq);
- }
-#endif
- }
- if (readLocked) ReleaseReadLock(&tdc->lock);
- afs_PutDCache(tdc);
- return (code);
- }
- if (!tdc->f.chunkBytes) { /* debugging f.chunkBytes == 0 problem */
- savedc = tdc;
- }
- if (readLocked) ReleaseReadLock(&tdc->lock);
- afs_PutDCache(tdc);
- } else {
- ReleaseReadLock(&afs_xdcache);
- }
-
- /* come here if fast path doesn't work for some reason or other */
- if (!noLock)
- ReleaseReadLock(&avc->lock);
- return afs_UFSRead(avc, auio, acred, albn, abpp, noLock);
-}
-
int afs_UFSRead(register struct vcache *avc, struct uio *auio,
struct AFS_UCRED *acred, daddr_t albn, struct buf **abpp, int noLock)
{
if (tdc) {
ObtainReadLock(&tdc->lock);
offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
+ len = tdc->validPos - filePos;
}
} else {
/* a tricky question: does the presence of the DFFetching flag
}
tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 2);
ObtainReadLock(&tdc->lock);
- if (tdc == savedc) {
- savedc = 0;
- }
/* now, first try to start transfer, if we'll need the data. If
* data already coming, we don't need to do this, obviously. Type
* 2 requests never return a null dcache entry, btw. */
/* no longer fetching, verify data version (avoid new
* GetDCache call) */
if (hsame(avc->m.DataVersion, tdc->f.versionNo)
- && tdc->f.chunkBytes) {
+ && ((len = tdc->validPos - filePos) > 0)) {
offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
}
else {
/* don't have current data, so get it below */
}
}
- afs_Trace3(afs_iclSetp, CM_TRACE_VNODEREAD,
- ICL_TYPE_POINTER, tdc,
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(offset),
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(len));
if (!tdc) {
error = EIO;
break;
}
+ len = tdc->validPos - filePos;
+ afs_Trace3(afs_iclSetp, CM_TRACE_VNODEREAD,
+ ICL_TYPE_POINTER, tdc,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(offset),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(len));
if (len > totalLength) len = totalLength; /* will read len bytes */
if (len <= 0) { /* shouldn't get here if DFFetching is on */
afs_Trace4(afs_iclSetp, CM_TRACE_VNODEREAD2,
#else
#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV)
afs_int32 d_off;
+ afs_uint32 d_fileno;
#endif
#if defined(AFS_HPUX100_ENV)
unsigned long long d_off;
-#endif
afs_uint32 d_fileno;
+#endif
u_short d_reclen;
u_short d_namlen;
#endif
#if defined(AFS_SUN56_ENV)
struct dirent64 *direntp;
#else
-#ifdef AFS_SUN5_ENV
+#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
struct dirent *direntp;
#endif
#endif /* AFS_SUN56_ENV */
}
}
#else /* AFS_SGI53_ENV */
-#ifdef AFS_SUN5_ENV
+#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
#if defined(AFS_SUN56_ENV)
direntp = (struct dirent64 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
#else
#endif
direntp->d_ino = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode);
FIXUPSTUPIDINODE(direntp->d_ino);
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+ direntp->d_offset = off;
+ direntp->d_namlen = slen;
+#else
direntp->d_off = off;
+#endif
direntp->d_reclen = rlen;
strcpy(direntp->d_name, de->name);
AFS_UIOMOVE((caddr_t)direntp, rlen, UIO_READ, auio, code);
if (dbtob(abp->b_blkno) + abp->b_bcount > tvc->m.Length) {
if ((abp->b_flags & B_PFSTORE) == 0) {
AFS_GUNLOCK();
- vm_protectp(tvc->vmh, dbtob(abp->b_blkno)/PAGESIZE,
+ vm_protectp(tvc->segid, dbtob(abp->b_blkno)/PAGESIZE,
abp->b_bcount/PAGESIZE, RDONLY);
AFS_GLOCK();
}
if (offset + len > tdc->f.chunkBytes) {
afs_int32 tlength = offset+len;
afs_AdjustSize(tdc, tlength);
+ if (tdc->validPos < filePos + len)
+ tdc->validPos = filePos + len;
}
totalLength -= len;
transferLength += len;
tvec = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec));
while (totalLength > 0) {
/*
- * The following lines are necessary because afs_GetDCache with
+ * The following line is necessary because afs_GetDCache with
* flag == 4 expects the length field to be filled. It decides
* from this whether it's necessary to fetch data into the chunk
* before writing or not (when the whole chunk is overwritten!).
if (offset + len > tdc->f.chunkBytes) {
afs_int32 tlength = offset+len;
afs_AdjustSize(tdc, tlength);
+ if (tdc->validPos < filePos + len)
+ tdc->validPos = filePos + len;
}
totalLength -= len;
transferLength += len;
int afs_icl_sizeofLong = 2;
#endif /* SGI62 */
#else
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+int afs_icl_sizeofLong = 2;
+#else
int afs_icl_sizeofLong = 1;
#endif
+#endif
int afs_icl_inited = 0;
#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
size_t temp;
#else /* AFS_SGI61_ENV */
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+ afs_uint64 temp;
+#else
afs_uint32 temp;
+#endif
#endif /* AFS_SGI61_ENV */
char tname[65];
afs_int32 startCookie;
if (code) goto done;
AFS_COPYOUT((char *) &startCookie, (char *)p4, sizeof(afs_int32), code);
if (code) goto done;
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+ if (!(IS64U))
+ *retval = ((long) ((flags<<24) | (elts & 0xffffff))) << 32;
+ else
+#endif
*retval = (flags<<24) | (elts & 0xffffff);
done:
afs_icl_LogRele(logp);
}
/* add a long to the log, ignoring overflow (checked already) */
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64))
#define ICL_APPENDINT32(lp, x) \
MACRO_BEGIN \
(lp)->datap[(lp)->firstFree] = (x); \
(lp)->logElements++; \
MACRO_END
+#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
#define ICL_APPENDLONG(lp, x) \
MACRO_BEGIN \
ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \
MACRO_END
#else /* AFS_ALPHA_ENV */
-#define ICL_APPENDLONG(lp, x) \
- MACRO_BEGIN \
- (lp)->datap[(lp)->firstFree] = (x); \
- if (++((lp)->firstFree) >= (lp)->logSize) { \
- (lp)->firstFree = 0; \
- } \
- (lp)->logElements++; \
- MACRO_END
-#define ICL_APPENDINT32(lp, x) ICL_APPENDLONG((lp), (x))
+#define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x))
#endif /* AFS_ALPHA_ENV */
/* routine to tell whether we're dealing with the address or the
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[2]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64))
+#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t1 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32)p1);
#endif /* AFS_ALPHA_ENV */
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[2]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64))
+#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t2 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32)p2);
#endif /* AFS_ALPHA_ENV */
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[2]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64))
+#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t3 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32)p3);
#endif /* AFS_ALPHA_ENV */
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[2]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64))
+#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t4 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32)p4);
#endif /* AFS_ALPHA_ENV */
struct afs_q CellLRU; /* Export for kdump */
static char *afs_thiscell;
-static afs_int32 afs_cellindex;
+afs_int32 afs_cellindex; /* Export for kdump */
static void afs_UpdateCellLRU(struct cell *c)
{
RCSID("$Header$");
+#ifdef AFS_AIX51_ENV
+#define __FULL_PROTO
+#include <sys/sleep.h>
+#endif
+
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics gathering code */
* The modifications here will work for either a UP or MP machine.
*/
struct buf *afs_asyncbuf = (struct buf*)0;
-afs_int32 afs_asyncbuf_cv = EVENT_NULL;
+tid_t afs_asyncbuf_cv = EVENT_NULL;
afs_int32 afs_biodcnt = 0;
/* in implementing this, I assumed that all external linked lists were
struct buf *bp = NULL;
struct buf *bestbp;
struct buf **bestlbpP, **lbpP;
- int bestage, stop;
+ long bestage, stop;
struct buf *t1P, *t2P; /* temp pointers for list manipulation */
int oldPriority;
afs_uint32 wait_ret;
if (afs_asyncbuf) {
/* look for oldest buffer */
bp = bestbp = afs_asyncbuf;
- bestage = (int) bestbp->av_back;
+ bestage = (long) bestbp->av_back;
bestlbpP = &afs_asyncbuf;
while (1) {
lbpP = &bp->av_forw;
bp = *lbpP;
if (!bp) break;
- if ((int) bp->av_back - bestage < 0) {
+ if ((long) bp->av_back - bestage < 0) {
bestbp = bp;
bestlbpP = lbpP;
- bestage = (int) bp->av_back;
+ bestage = (long) bp->av_back;
}
}
bp = bestbp;
* also want to hang onto the old one.
*/
tmpaddr = bp->b_baddr;
- bp->b_baddr = vm_att (bp->b_xmemd.subspace_id, tmpaddr);
+ bp->b_baddr = (caddr_t) vm_att (bp->b_xmemd.subspace_id, tmpaddr);
tmperr = afs_ustrategy(bp); /* temp variable saves offset calculation */
if (tmperr) { /* in non-error case */
bp->b_flags |= B_ERROR; /* should other flags remain set ??? */
/* Unmap the buffer's data area by calling vm_det. Reset data area
* to the value that we saved above.
*/
- vm_det(bp->b_un.b_addr);
+ vm_det(bp->b_baddr);
bp->b_baddr = tmpaddr;
/*
adc->dflags |= DFEntryMod;
oldSize = ((adc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */
adc->f.chunkBytes = newSize;
+ if (!newSize)
+ adc->validPos = 0;
newSize = ((newSize + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */
if (newSize > oldSize) {
/* We're growing the file, wakeup the daemon */
}
tdc->refCount = 1;
tdc->index = aslot;
+ if (tdc->f.chunk >= 0)
+ tdc->validPos = AFS_CHUNKTOBASE(tdc->f.chunk) + tdc->f.chunkBytes;
+ else
+ tdc->validPos = 0;
if (existing) {
osi_Assert(0 == NBObtainWriteLock(&tdc->lock, 674));
void Afs_Lock_Obtain(register struct afs_lock *lock, int how)
{
osi_timeval_t tt1, tt2, et;
+ afs_uint32 us;
AFS_STATCNT(Lock_Obtain);
osi_GetuTime(&tt2);
afs_stats_GetDiff(et, tt1, tt2);
afs_stats_AddTo((lock->time_waiting), et);
+ us = (et.tv_sec << 20) + et.tv_usec;
if (afs_trclock) {
- afs_Trace2(afs_iclSetp, CM_TRACE_LOCKSLEPT, ICL_TYPE_POINTER, lock,
+ afs_Trace3(afs_iclSetp, CM_TRACE_LOCKSLEPT,
+ ICL_TYPE_INT32, us,
+ ICL_TYPE_POINTER, lock,
ICL_TYPE_INT32, how);
}
}
if(!tiov) {
osi_Panic("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n");
}
+ adc->validPos = abase;
do {
if (moredata) {
RX_AFS_GUNLOCK();
abase += tlen;
length -= tlen;
adc->validPos = abase;
- afs_osi_Wakeup(&adc->validPos);
+ if (afs_osi_Wakeup(&adc->validPos) == 0)
+ afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_POINTER, adc,
+ ICL_TYPE_INT32, adc->dflags);
}
} while (moredata);
/* max of two sizes */
^ ((((handle) & ~vmker.stoinio) & vmker.stoimask) << vmker.stoihash) \
) & 0x000fffff)
- if (avc->vmh) {
+ if (avc->segid) {
unsigned int pagef, pri, index, next;
- index = VMHASH(avc->vmh);
+ index = VMHASH(avc->segid);
if (scb_valid(index)) { /* could almost be an ASSERT */
pri = disable_ints();
xmem_userp = NULL;
xm = XMEM_FAIL;
/* simple_lock(&proc_tbl_lock); */
+#ifdef __64BIT__
+ if (pproc->p_adspace != vm_handle(NULLSEGID, (int32long64_t) 0)) {
+#else
if (pproc->p_adspace != NULLSEGVAL) {
+#endif
#ifdef AFS_AIX51_ENV
simple_lock(&pproc->p_pvprocp->pv_lock);
#if defined(AFS_HPUX102_ENV)
k_off_t offset;
#else
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+ afs_offs_t offset;
+#else
afs_int32 offset;
#endif
+#endif
int (*proc)(struct osi_file *afile, afs_int32 code); /* proc, which, if not null, is called on writes */
char *rock; /* rock passed to proc */
ino_t inum; /* guarantee validity of hint */
struct mount *mp;
struct vnode *held_vnode;
#else
+#ifdef AFS_AIX42_ENV
+ dev_t dev;
+#else
afs_int32 dev;
#endif
+#endif
};
struct afs_osi_WaitHandle {
copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst)
{
int code;
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+ struct afs_ioctl32 dst32;
+
+ if (!(IS64U)) {
+ AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code);
+ if (!code)
+ afs_ioctl32_to_afs_ioctl(&dst32, dst);
+ return code;
+ }
+#endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
+
#if defined(AFS_HPUX_64BIT_ENV)
struct afs_ioctl32 dst32;
struct AFSVolSync tsync;
register afs_int32 code;
register struct rx_call *tcall;
- afs_size_t tlen, base = 0;
+ afs_size_t tlen, xlen = 0;
XSTATS_DECLS
AFS_STATCNT(afs_StoreMini);
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA);
afs_Trace4(afs_iclSetp, CM_TRACE_STOREDATA64,
ICL_TYPE_FID, &avc->fid.Fid,
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(base),
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tlen),
- ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(xlen),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tlen));
RX_AFS_GUNLOCK();
#ifdef AFS_64BIT_CLIENT
if (!afs_serverHasNo64Bit(tc)) {
code = StartRXAFS_StoreData64(tcall,
(struct AFSFid *)&avc->fid.Fid,
&InStatus, avc->m.Length,
- base, tlen);
+ (afs_size_t) 0, tlen);
} else {
afs_int32 l1, l2;
l1 = avc->m.Length;
if (!code) doProcessFS = 1; /* Flag to run afs_ProcessFS() later on */
}
if (tcall) {
+ afs_int32 code2;
RX_AFS_GUNLOCK();
- code = rx_EndCall(tcall, code);
+ code2 = rx_EndCall(tcall, code);
RX_AFS_GLOCK();
+ if (code2) code = code2;
}
} while (afs_Analyze(tc, code, &avc->fid, areq,
AFS_STATS_FS_RPCIDX_STOREDATA,
ec CM_TRACE_GETDCACHE1, "Getdcache vp 0x%lx failed to find chunk 0x%x"
ec CM_TRACE_GETDCACHE2, "GetdCache vp 0x%lx dcache 0x%lx dcache low-version 0x%x, vcache low-version 0x%x"
ec CM_TRACE_GETDCACHE3, "GetdCache tlen 0x%x flags 0x%x abyte (0x%x, 0x%x) Position (0x%x, 0x%x)"
- ec CM_TRACE_STOREMINI, "storemini vp 0x%lx length 0x%x"
+ ec CM_TRACE_STOREMINI, "storemini vp 0x%lx length (0x%x, 0x%x)"
ec CM_TRACE_STOREDCACHE, "StoreDCache vp 0x%lx chunk 0x%x length 0x%x at position 0x%x"
ec CM_TRACE_STOREDCACHEDONE, "StoreDCache Done for vp 0x%lx (returns 0x%x)"
ec CM_TRACE_STOREALLDONE, "StoreAll Done vp 0x%lx length 0x%x (returns 0x%x)"
ec CM_TRACE_NFSOUT, "NfsOut op 0x%x vp 0x%lx fid (%x:%d.%d.%d)"
ec CM_TRACE_NFSIN, "NfsIn op 0x%x"
ec CM_TRACE_NFSIN1, "Nfs Root fid client 0x%lx fid (%x:%d.%d.%d)"
- ec CM_TRACE_FLUSHPAGES, "flushpages vp 0x%x data version low 0x%x length 0x%x"
+ ec CM_TRACE_FLUSHPAGES, "flushpages vp 0x%lx data version low 0x%x length 0x%x"
ec CM_TRACE_SYNCVM, "SyncVM vp 0x%lx length 0x%x"
ec CM_TRACE_PIOCTL, "Pioctl command 0x%x for vp 0x%lx, follow=%d"
ec CM_TRACE_CHECKCODE, "Returning code %d from %d"
ec CM_TRACE_READ, "Read vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)"
ec CM_TRACE_PARTIALWRITE, "Partial write vp 0x%lx length (0x%x, 0x%x)"
ec CM_TRACE_GETATTR, "Getattr vp 0x%lx len (0x%x, 0x%x)"
- ec CM_TRACE_SETATTR, "Setattr vp 0x%lx len (0x%x, 0x%x)"
+ ec CM_TRACE_SETATTR, "Setattr vp 0x%lx mask 0x%x newlen (0x%x, 0x%x) oldlen (0x%x, 0x%x)"
ec CM_TRACE_ACCESS, "Access vp 0x%lx mode 0x%x len (0x%x, 0x%x)"
ec CM_TRACE_LOOKUP, "Lookup adp 0x%lx name %s fid (%d:%d.%d.%d), code=%d"
ec CM_TRACE_LOOKUP1, "Mount point is to vp 0x%lx fid (%d:%d.%d.%d)"
ec CM_TRACE_CREATE, "create file in vp 0x%lx name %s mode 0x%x"
ec CM_TRACE_REMOVE, "remove dir 0x%lx name %s"
- ec CM_TRACE_LINK, "hard link dir 0x%lx vp %lx name %s"
+ ec CM_TRACE_LINK, "hard link dir 0x%lx vp 0x%lx name %s"
ec CM_TRACE_RENAME, "Rename d1 0x%lx name %s to d2 0x%lx name %s"
ec CM_TRACE_MKDIR, "Mkdir parent 0x%lx entry %s"
ec CM_TRACE_RMDIR, "Rmdir parent 0x%lx entry %s"
ec CM_TRACE_LOCKDONE, "%s line %d: Released lock 0x%lx level %d"
ec CM_TRACE_LOCKDOWN, "%s line %d: Downgraded lock 0x%lx to %d"
ec CM_TRACE_LOCKOBTAIN,"%s line %d: Obtained lock 0x%lx level %d"
- ec CM_TRACE_LOCKSLEPT, "%s line %d: Slept for lock 0x%lx level %d"
+ ec CM_TRACE_LOCKSLEPT, "Slept %lu us for lock 0x%lx level %d"
ec CM_TRACE_PAGE_READ, "0x%lx called page_read (returned %d) states 0x%x"
ec CM_TRACE_PAGE_WRITE, "0x%lx called page_write (returned %d) states 0x%x"
ec CM_TRACE_UPDATEPAGE, "Iupdatepage ip 0x%lx pp 0x%x count 0x%x code %d"
ec CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d"
ec CM_TRACE_FETCH64, "FetchProc for vp = 0x%lx oldserver was %d, found length (0x%x, 0x%x)"
- ec CM_TRACE_UFSLINK, "UFSHandleLink: vp = 0x%lx, tdc 0 0x%lx, len (0x%x, 0x%x)"
+ ec CM_TRACE_UFSLINK, "UFSHandleLink: vp = 0x%lx, tdc 0x%lx, len (0x%x, 0x%x)"
ec CM_TRACE_VMRDWR, "afs_vm_rdwr: vp = 0x%lx, xfrSize 0x%lx, toffset 0x%x"
ec CM_TRACE_READFAST, "ReadFast vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)"
- ec CM_TRACE_FETCH64CODE, "StartRX_FetchData64 for vp 0x%x returned %d"
- ec CM_TRACE_FETCH64LENG, "FetchData64 for vp 0x%x code = %d, length = (0x%x, 0x%x)"
- ec CM_TRACE_FETCH64READ, "FetchData64 for vp 0x%x code = %d, length = 0x%x"
- ec CM_TRACE_VMWRITE, "afs_vm_rdwr: vp 0x%x offset (0x%x, 0x%x) length (0x%x, 0x%x)"
- ec CM_TRACE_VMWRITE2, "afs_vm_rdwr: vp 0x%x first page 0x%x pages %d"
- ec CM_TRACE_VMSTOREALL, "osi_VM_StoreAllSegments for vp 0x%x call %d"
+ ec CM_TRACE_FETCH64CODE, "StartRX_FetchData64 for vp 0x%lx returned %d"
+ ec CM_TRACE_FETCH64LENG, "FetchData64 for vp 0xl%x code = %d, length = (0x%x, 0x%x)"
+ ec CM_TRACE_FETCH64READ, "FetchData64 for vp 0xl%x code = %d, length = 0x%x"
+ ec CM_TRACE_VMWRITE, "afs_vm_rdwr: vp 0x%lx offset (0x%x, 0x%x) length (0x%x, 0x%x)"
+ ec CM_TRACE_VMWRITE2, "afs_vm_rdwr: vp 0x%lx first page 0x%x pages %d"
+ ec CM_TRACE_VMSTOREALL, "osi_VM_StoreAllSegments for vp 0x%lx call %d"
ec CM_TRACE_PARTIALWRITE0, "Partial write currDirty %d maxDirty %d"
- ec CM_TRACE_DIRECTRDWR, "direct_rdwr: vp 0x%x offset (0x%x, 0x%x) resid 0x%x"
+ ec CM_TRACE_DIRECTRDWR, "direct_rdwr: vp 0x%lx offset (0x%x, 0x%x) resid 0x%x"
ec CM_TRACE_GOPRDWR, "gop_rdwr: offset (0x%x, 0x%x) len 0x%x resid 0x%x code %d"
ec CM_TRACE_GRDWR1, "Gn_rdwr error vp 0x%lx returns %d"
- ec CM_TRACE_READTDC, "UFSRead: vp 0x%lx tdc 0x%x at %d refcount 0x%x"
- ec CM_TRACE_MEMFETCH, "MemFetch: vp 0x%x mceP 0x%x offset (0x%x, 0x%x) length 0x%x"
- ec CM_TRACE_VMWRITE3, "afs_vm_rdwr: vp 0x%x code %d"
- ec CM_TRACE_STOREALL2, "StoreAll 2 vp 0x%x chunk 0x%x index %d inode %d"
+ ec CM_TRACE_READTDC, "UFSRead: vp 0x%lx tdc 0x%lx at %d refcount 0x%x"
+ ec CM_TRACE_MEMFETCH, "MemFetch: vp 0x%lx mceP 0x%lx offset (0x%x, 0x%x) length 0x%x"
+ ec CM_TRACE_VMWRITE3, "afs_vm_rdwr: vp 0x%lx code %d"
+ ec CM_TRACE_STOREALL2, "StoreAll 2 vp 0x%lx chunk 0x%x index %d inode %d"
ec CM_TRACE_MEMOPEN, "MemOpen blkno %d mceP 0x%x data 0x%x = %s"
ec CM_TRACE_VCACHE2INODE, "vcache2inode: avc 0x%x event %d"
ec CM_TRACE_STOREDATA64, "StoreData64: fid (%d:%d.%d.%d) offs (0x%x, 0x%x) len (0x%x, 0x%x) file length (0x%x, 0x%x)"
ec CM_TRACE_ADJUSTSIZE, "AdjustSize index %d oldSize %d newSize %d blocksUsed %d"
ec CM_TRACE_SETLENGTH, "%s line %d: m.Length was (0x%x, 0x%x), now (0x%x, 0x%x)"
ec CM_TRACE_DCACHEWAIT, "%s line %d: waiting for 0x%x flags 0x%x"
- ec CM_TRACE_VNODEREAD, "UFSRead: tdc 0x%x, offset (0x%x, 0x%x) len (0x%x 0x%x)"
- ec CM_TRACE_SLEEP, "Sleep: evp 0x%x, count %d seq 0x%x evp->seq 0x%x"
- ec CM_TRACE_WAKE, "Wakeup: evp 0x%x, evp->seq 0x%x"
+ ec CM_TRACE_VNODEREAD, "UFSRead: tdc 0x%lx, offset (0x%x, 0x%x) len (0x%x 0x%x)"
+ ec CM_TRACE_SLEEP, "Sleep: evp 0x%lx, count %d seq 0x%x evp->seq 0x%x"
+ ec CM_TRACE_WAKE, "Wakeup: evp 0x%lx, evp->seq 0x%x"
ec CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s"
ec CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s"
ec CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x name %s parent %s"
ec CM_TRACE_GNGETACL, "Gn_getacl vp 0x%lx (returns 0x%x)"
ec CM_TRACE_EINVAL, "EINVAL in %s at line %d"
ec CM_TRACE_VNODEREAD2, "negative length tdc 0x%lx validPos (0x%x, 0x%x) chunkBytes 0x%x dflags 0x%x"
+ ec CM_TRACE_WASHERE, "Was here: %s line %d, code = %d"
+ ec CM_TRACE_LOCKWAIT,"%s line %d: Waiting for lock 0x%lx level %d"
+ ec CM_TRACE_WRITEFAILED, "osi_Write failed len %ld resid %ld err %ld"
+ ec CM_TRACE_ADJUSTSIZE2, "AdjustSize dc = 0x%lx, chunkBytes = 0x%x
+ used = %ld, diff = %ld"
end
if (!tvc) {
/* no cache entry, better grab one */
UpgradeSToWLock(&afs_xvcache,22);
- tvc = afs_NewVCache(&nfid, NULL);
+ tvc = afs_NewVCache(&nfid, serverp);
newvcache = 1;
ConvertWToSLock(&afs_xvcache);
}
RMTSYS=""
fi
+# find out whether we have 32 or 64 bit kernel
+
+kernel=32
+if [ -x /bin/w64 ]; then
+ /bin/w64 >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ kernel=64
+ fi
+fi
+
# Load AFS into the kernel
+
cd /usr/vice/etc/dkload
-/usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext${ExportExt}
-/usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext${AFSExt}
+if [ $kernel -eq 32 ]; then
+ echo "32-bit kernel found"
+ ./cfgexport -a export.ext${ExportExt} && ./cfgafs -a afs.ext.32
+else
+ echo "64-bit kernel assumed"
+ ./cfgexport64 -a export64.ext${ExportExt} && ./cfgafs64 -a afs.ext.64
+fi
if [ $? -ne 0 ]; then
/bin/echo "Unable to load AFS extensions into kernel. Not starting client."
exit 1
# directory or online at http://www.openafs.org/dl/license10.html
echo 'Loading AFS ...'>/dev/console
-/usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext.nonfs
-/usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext
+# Load AFS into the kernel
+cd /usr/vice/etc/dkload
+./cfgexport -a /usr/vice/etc/dkload/export.ext.nonfs
+if [ $? -eq 0 ]; then
+ echo "32-bit kernel found"
+ ./cfgafs -a /usr/vice/etc/dkload/afs.ext.32
+else
+ echo "64-bit kernel assumed"
+ ./cfgexport64 -a /usr/vice/etc/dkload/export64.ext.nonfs
+ ./cfgafs64 -a /usr/vice/etc/dkload/afs.ext.64
+fi
+if [ $? -ne 0 ]; then
+ /bin/echo "Unable to load AFS extensions into kernel."
+ exit 1
+fi
+
install: ${DESTDIR}${libdir}/afs/export.exp ${DESTDIR}${libdir}/afs/extras.exp
-export.ext: export4.exp export5.exp
+export.exp: export4.exp export5.exp
case ${SYS_NAME} in \
rs_aix4* ) \
cp -p export4.exp export.exp ; \
${CC} -q64 ${CFLAGS} -c cfgafs.c -o cfgafs64.o
clean:
- $(RM) -f *.o *.Zlst *.map *.out cfgexport cfgafs *.ext AFS_component_version_number.c
+ $(RM) -f *.o *.Zlst *.map *.out cfgexport cfgafs *.ext AFS_component_version_number.c export.exp
${DEST}/root.client/usr/vice/etc/dkload/export.ext: export.ext
${INSTALL} $? $@
#endif
if (!myg_toc) {
+#ifdef __XCOFF64__
+ sym = sym_lookup("ktoc", 0);
+#else
sym = sym_lookup("g_toc", 0);
+#endif
if (!sym) {
printf("\nimport: can't ascertain kernel's TOC\n");
return EINVAL;
}
kfp->fdesc[0] = sym->n_value;
- kfp->fdesc[1] = myg_toc;
+ kfp->fdesc[1] = *myg_toc;
kfp->fdesc[2] = 0;
#ifdef __XCOFF64__
--- /dev/null
+#!/unix
+*
+* $Locker$
+*
+* EXPORT exports
+*
+import_kfunc
+import_kvar
+*
+* Overwrite vanilla system calls
+*
+osetgroups syscall
+okioctl syscall
+
+
+
--- /dev/null
+#!/unix
+*
+* $Locker$
+*
+* EXPORT exports
+*
+import_kfunc
+import_kvar
+*
+* Overwrite vanilla system calls
+*
+okioctl syscall
+
+
+
*
* Overwrite vanilla system calls
*
-*osetgroups syscall
-okioctl syscall
+okioctl32 syscall
srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
-
# OS specific object files:
AFS_OS_OBJS = \
osi_assem.o \
IMPORTS = -bI:/lib/kernex.exp -bI:/lib/syscalls.exp -bI:/lib/sockets.exp \
-bI:/lib/netinet.exp \
- -bI:${TOP_LIBDIR}/extras.exp -bI:${TOP_LIBDIR}/export.exp
+ -bI:${TOP_LIBDIR}/extras.exp
+IMPORTS32 = -bI:${TOP_LIBDIR}/export.exp
+IMPORTS64 = -bI:${TOP_LIBDIR}/export64.exp
KDEFS = -U_IBMR2 -D_POWER -D_AIX -DNLS -D_NLS -DMSG -D__STR31__ -Daiws \
-D_POWER_RS -D_POWER_PC -D_POWER_RS1 -D_POWER_RS2 -D_POWER_RSC \
-D_POWER_601 -D_POWER_603 -D_POWER_604 -D_THREADS -M -D_KERNEL \
-DGETMOUNT -H8 -DAFS -DAFS_COMMON -D_VOPS -D_SUN -DKERNEL
LDSTUFF= -b"binder:/usr/lib/bind glink:/usr/lib/glink.o" -bnoentry -b h:4 \
-D0 -T512
+LDSTUFF64= -b"binder:/usr/lib/bind glink:/usr/lib/glink64.o" -bnoentry -b h:4 \
+ -D0 -T512
LDFLAGS = -m -eafs_config -bexport:${TOP_LIBDIR}/afs.exp ${IMPORTS} \
- -lsys -lcsys
+ -lsys -lcsys ${KLDOPTS}
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(KDEFS) $(KOPTS) ${DBUG}
# Name of directory to hold object files and libraries.
-KOBJ = MODLOAD
+KOBJ = MODLOAD MODLOAD64
# This tells Makefile.common to use it's single directory build target.
-COMPDIRS = single_compdir
-INSTDIRS = single_instdir
-DESTDIRS = single_destdir
+COMPDIRS = aix_compdirs
+INSTDIRS = aix_instdirs
+DESTDIRS = aix_destdirs
include Makefile.common
setup:
- -mkdir $(KOBJ)
- -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
- ln -fs ../Makefile $(KOBJ)/Makefile
- ln -fs ../Makefile.common $(KOBJ)/Makefile.common
- ln -fs ../config $(KOBJ)/config
-$(RM) -f h net netinet rpc ufs nfs machine sys
ln -fs /usr/include/sys h
ln -fs /usr/include/net net
ln -fs /usr/include/sys sys
ln -fs /usr/include/nfs nfs
ln -fs /usr/include/jfs ufs
-
+ for m in 32 64 ; do \
+ KDIR=MODLOAD-$$m ; \
+ mkdir -p $${KDIR} ; \
+ ln -fs ../Makefile $${KDIR}/Makefile ; \
+ ln -fs ../Makefile.common $${KDIR}/Makefile.common ; \
+ ln -fs ../config $${KDIR}/config ; \
+ done
+
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
+ for m in 32 64 ; do \
+ KDIR=MODLOAD-$$m ; \
+ echo Building in directory: $${KDIR} ; \
+ if [ "$$m" = "32" ] ; then \
+ KOPTS="-q32" ; \
+ KLDOPTS="-b32" ; \
+ KASOPTS="32" ; \
+ TARG="afs.ext.32" ; \
+ elif [ "$$m" = "64" ] ; then \
+ KOPTS="-q64 -DAFS_64BIT_KERNEL -D__64BIT_KERNEL" ; \
+ KLDOPTS="-b64" ; \
+ KASOPTS="64" ; \
+ TARG="afs.ext.64" ; \
+ fi ; \
+ cd $${KDIR} ; \
+ $(MAKE) DEST="$${DEST}" KOPTS="$${KOPTS}" KLDOPTS="$${KLDOPTS}" KASOPTS="$${KASOPTS}" $@_$${TARG} || exit $$?; \
+ cd ../ ; \
+ done
+
+aix_compdirs_afs.ext.32: afs.ext.32
+aix_compdirs_afs.ext.64: afs.ext.64
+aix_instdirs_afs.ext.32: install_afs.ext.32
+aix_instdirs_afs.ext.64: install_afs.ext.64
+aix_destdirs_afs.ext.32: dest_afs.ext.32
+aix_destdirs_afs.ext.64: dest_afs.ext.64
+
+dest_afs.ext.32: $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32
+ echo Install for 32-bit Kernel Complete
+
+dest_afs.ext.64: $(DEST)/root.client/usr/vice/etc/dkload/afs.ext.64
+ echo Install for 64-bit Kernel Complete
# Standard AFS->NFS translator support is removed in AFS 3.5 in favor of
# the iauth authentication mechanism. The model was changed by IBM in the
LIBAFS = afs.ext
DEST_LIBAFSIAUTH = $(DEST)/root.client/usr/vice/etc/dkload/$(LIBAFSIAUTH)
-DEST_LIBAFS = $(DEST)/root.client/usr/vice/etc/dkload/$(LIBAFS)
INST_LIBAFSIAUTH = ${DESTDIR}${afskerneldir}/$(LIBAFSIAUTH)
INST_LIBAFS = ${DESTDIR}${afskerneldir}/$(LIBAFS)
-$(DEST_LIBAFS): $(LIBAFS)
+$(DEST)/root.client/usr/vice/etc/dkload/afs.ext.32: afs.ext.32
$(INSTALL) -f $? $@
- -${STRIP} $@
+ -${STRIP} -X 32 $@
+ $(INSTALL) -f $?.map $@.map
+
+$(DEST)/root.client/usr/vice/etc/dkload/afs.ext.64: afs.ext.64
+ $(INSTALL) -f $? $@
+ -${STRIP} -X 64 $@
$(INSTALL) -f $?.map $@.map
$(DEST_LIBAFSIAUTH): $(LIBAFSIAUTH)
$(LIBAFSIAUTH): $(AFSAOBJS) $(AFSIAUTHOBJS)
${LD} ${LDSTUFF} -bloadmap:afs.ext.iauth.loadmap \
-bmap:afs.ext.iauth.map -o afs.ext.iauth \
- ${AFSAOBJS} ${AFSIAUTHOBJS} ${LIBS} ${LDFLAGS}
+ ${AFSAOBJS} ${AFSIAUTHOBJS} ${LIBS} ${LDFLAGS} ${IMPORTS32}
-$(LIBAFS): $(AFSAOBJS) $(AFSNOIAUTHOBJS)
- ${LD} ${LDSTUFF} -bloadmap:afs.ext.loadmap \
- -bmap:afs.ext.map -o afs.ext \
- ${AFSAOBJS} ${AFSNOIAUTHOBJS} ${LIBS} ${LDFLAGS}
+afs.ext.32: $(AFSAOBJS) $(AFSNOIAUTHOBJS)
+ ${LD} ${LDSTUFF} -bloadmap:afs.ext.32.loadmap \
+ -bmap:afs.ext.32.map -o afs.ext.32 \
+ ${AFSAOBJS} ${AFSNOIAUTHOBJS} ${LIBS} \
+ ${LDFLAGS} ${IMPORTS32}
-libafs: $(LIBAFS) $(LIBAFSIAUTH)
+afs.ext.64: $(AFSAOBJS) $(AFSNOIAUTHOBJS)
+ ${LD} ${LDSTUFF64} -b64 -bloadmap:afs.ext.64.loadmap \
+ -bmap:afs.ext.64.map -o afs.ext.64 \
+ ${AFSAOBJS} ${AFSNOIAUTHOBJS} ${LIBS} \
+ ${LDFLAGS} ${IMPORTS64}
+
+libafs: $(LIBAFS) $(LIBAFS64) $(LIBAFSIAUTH)
install_libafs: $(INST_LIBAFS) $(INST_LIBAFSIAUTH)
dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSIAUTH)
-osi_assem.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem.s
- ${AS} -o osi_assem.o $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem.s
+osi_assem.o: osi_assem.s
+ ${AS} -a${KASOPTS} -o osi_assem.o osi_assem.s
+osi_assem.s: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem32.s $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem64.s
+ case bit${KASOPTS} in \
+ bit64 ) \
+ cp -p $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem64.s osi_assem.s ;; \
+ * ) \
+ cp -p $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_assem32.s osi_assem.s ;; \
+ esac
+
# Build rules for iauth objects.
afs_call_iauth.o: $(AFS)/afs_call.c
- $(CRULE_NOOPT) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o
afs_nfsclnt_iauth.o: $(AFS)/afs_nfsclnt.c
- $(CRULE_NOOPT) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o
afs_pioctl_iauth.o: $(AFS)/afs_pioctl.c
- $(CRULE_NOOPT) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o
-osi_vfsops_iauth.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_vnodeops.c
- $(CRULE_NOOPT) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o
-osi_vnodeops_iauth.o: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/osi_vnodeops.c
- $(CRULE_NOOPT) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o
+osi_vfsops_iauth.o: $(AFS)/osi_vfsops.c
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o
+osi_vnodeops_iauth.o: $(AFS)/osi_vnodeops.c
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o
#define CV_SIGNAL(_cv) e_wakeup_one(_cv)
#define CV_BROADCAST(_cv) e_wakeup(_cv)
typedef simple_lock_data afs_kmutex_t;
-typedef int afs_kcondvar_t;
+typedef tid_t afs_kcondvar_t;
#define osi_rxWakeup(cv) e_wakeup(cv)
tlen = ntohs((u_short)tvu->ui_ulen);
if ((int)ti->ip_len != tlen) {
if (tlen > (int)ti->ip_len) {
+#ifdef RX_KERNEL_TRACE
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner) AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_INT32, tlen);
+ if (!glockOwner) AFS_GUNLOCK();
+#endif
m_free(am);
return;
}
* underlying network (and interfaces and drivers and
* DMA hardware, etc!) is error-free. First, fill
* in entire virtual ip header. */
+#ifndef AFS_64BIT_KERNEL
tvu->ui_next = 0;
tvu->ui_prev = 0;
+#endif
tvu->ui_x1 = 0;
tvu->ui_len = tvu->ui_ulen;
am->m_flags |= M_PKTHDR;
am->m_pkthdr.len = tlen;
+#if !defined(AFS_AIX51_ENV) || !defined(AFS_64BIT_KERNEL)
if (in_cksum(am, sizeof(struct ip) + tlen)) {
/* checksum, including cksum field, doesn't come out 0, so
this packet is bad */
+#ifdef RX_KERNEL_TRACE
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner) AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_INT32, tlen);
+ if (!glockOwner) AFS_GUNLOCK();
+#endif
m_freem(am);
return;
}
+#else
+#ifdef notdef
+ { /* in_cksum() doesn't work correctly or the length is wrong? */
+ int cksum;
+ int glockOwner = ISAFS_GLOCK();
+ cksum = in_cksum(am, sizeof(struct ip) + tlen);
+ if (!glockOwner)
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_INT32, cksum);
+ if (!glockOwner)
+ AFS_GUNLOCK();
+ }
+#endif
+#endif
}
/*
#include "netinet/in.h"
#include "afs/afs_args.h"
#include "afs/afs_osi.h"
+#ifdef RX_KERNEL_TRACE
+#include "rx_kcommon.h"
+#endif
#if (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV))
#include "h/systm.h"
#endif
#define CLEAR_CALL_QUEUE_LOCK(C)
#endif /* RX_ENABLE_LOCKS */
struct rx_serverQueueEntry *rx_waitForPacket = 0;
+struct rx_serverQueueEntry *rx_waitingForPacket = 0;
/* ------------Exported Interfaces------------- */
queue_Append(&rx_idleServerQueue, sq);
#ifndef AFS_AIX41_ENV
rx_waitForPacket = sq;
+#else
+ rx_waitingForPacket = sq;
#endif /* AFS_AIX41_ENV */
do {
CV_WAIT(&sq->cv, &rx_serverPool_lock);
clock_GetTime(&call->startTime);
call->state = RX_STATE_ACTIVE;
call->mode = RX_MODE_RECEIVING;
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner)
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_POINTER, call);
+ if (!glockOwner)
+ AFS_GUNLOCK();
+ }
+#endif
rxi_calltrace(RX_CALL_START, call);
dpf(("rx_GetCall(port=%d, service=%d) ==> call %x\n",
clock_GetTime(&call->startTime);
call->state = RX_STATE_ACTIVE;
call->mode = RX_MODE_RECEIVING;
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner)
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_POINTER, call);
+ if (!glockOwner)
+ AFS_GUNLOCK();
+ }
+#endif
rxi_calltrace(RX_CALL_START, call);
dpf(("rx_GetCall(port=%d, service=%d) ==> call %x\n",
}
call->state = RX_STATE_ACTIVE;
call->mode = RX_MODE_RECEIVING;
+#ifdef RX_KERNEL_TRACE
+ {
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner)
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_POINTER, call);
+ if (!glockOwner)
+ AFS_GUNLOCK();
+ }
+#endif
if (call->flags & RX_CALL_CLEARED) {
/* send an ack now to start the packet flow up again */
call->flags &= ~RX_CALL_CLEARED;
/* Configurable parameters */
#define RX_IDLE_DEAD_TIME 60 /* default idle dead time */
#define RX_MAX_SERVICES 20 /* Maximum number of services that may be installed */
+#if defined(KERNEL) && defined(AFS_AIX51_ENV) && defined(__64__)
+#define RX_DEFAULT_STACK_SIZE 24000
+#else
#define RX_DEFAULT_STACK_SIZE 16000 /* Default process stack size; overriden by rx_SetStackSize */
+#endif
/* This parameter should not normally be changed */
#define RX_PROCESS_PRIORITY LWP_NORMAL_PRIORITY
#if defined(AFS_SGI61_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL)
#define clock_GetTime(cv) osi_GetTime((osi_timeval_t *)cv)
#else
+#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
+#define clock_GetTime(cv) \
+ BEGIN \
+ struct timeval tv; \
+ osi_GetTime(&tv); \
+ (cv)->sec = (afs_int32)tv.tv_sec; \
+ (cv)->usec = (afs_int32)tv.tv_usec; \
+ END
+#else /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
#define clock_GetTime(cv) osi_GetTime((struct timeval *)cv)
+#endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
#endif
#define clock_Sec() osi_Time()
#define clock_NewTime() /* don't do anything; clock is fast enough in kernel */
nbytes = tlen + sizeof(afs_int32);
#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
AFS_GLOCK();
afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
ICL_TYPE_STRING, "before osi_NetRecive()");
AFS_GUNLOCK();
+ }
#endif
code = osi_NetReceive(rx_socket, &from, p->wirevec, p->niovecs,
&nbytes);
#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
AFS_GLOCK();
afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
ICL_TYPE_STRING, "after osi_NetRecive()");
AFS_GUNLOCK();
+ }
#endif
/* restore the vec to its correct state */
p->wirevec[p->niovecs-1].iov_len = savelen;
#include "afs/longc_procs.h"
#include "afs/afs_stats.h"
#include "h/errno.h"
-#if 0/*def KERNEL*/
+#ifdef KERNEL
#include "afs/sysincludes.h"
#include "afsincludes.h"
#endif
#include "rx/rx_queue.h"
#include "rx/rx_packet.h"
#else /* defined(UKERNEL) */
+#ifdef RX_KERNEL_TRACE
+#include "../rx/rx_kcommon.h"
+#endif
#include "h/types.h"
#ifndef AFS_LINUX20_ENV
#include "h/systm.h"
}
AFS_RXGUNLOCK();
#ifdef KERNEL
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ if (!waslocked) AFS_GLOCK();
+ afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
+ ICL_TYPE_STRING, "before osi_NetSend()");
+ AFS_GUNLOCK();
+ } else
+#else
if (waslocked) AFS_GUNLOCK();
#endif
+#endif
/* debug packets are not reliably delivered, hence the cast below. */
(void) osi_NetSend(asocket, &taddr, apacket->wirevec, apacket->niovecs,
apacket->length+RX_HEADER_SIZE, istack);
#ifdef KERNEL
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ AFS_GLOCK();
+ afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
+ ICL_TYPE_STRING, "after osi_NetSend()");
+ if (!waslocked) AFS_GUNLOCK();
+ } else
+#else
if (waslocked) AFS_GLOCK();
#endif
+#endif
AFS_RXGLOCK();
if (saven) { /* means we truncated the packet above. */
apacket->wirevec[i-1].iov_len = savelen;
AFS_RXGUNLOCK();
#ifdef KERNEL
waslocked = ISAFS_GLOCK();
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ if (!waslocked) AFS_GLOCK();
+ afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
+ ICL_TYPE_STRING, "before osi_NetSend()");
+ AFS_GUNLOCK();
+ } else
+#else
if (waslocked) AFS_GUNLOCK();
#endif
+#endif
if ((code = osi_NetSend(socket, &addr, p->wirevec, p->niovecs,
p->length+RX_HEADER_SIZE, istack)) != 0) {
/* send failed, so let's hurry up the resend, eh? */
#endif
}
#ifdef KERNEL
+#ifdef RX_KERNEL_TRACE
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ AFS_GLOCK();
+ afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP,
+ ICL_TYPE_STRING, "after osi_NetSend()");
+ if (!waslocked) AFS_GUNLOCK();
+ } else
+#else
if (waslocked) AFS_GLOCK();
#endif
+#endif
AFS_RXGLOCK();
#ifdef RXDEBUG
}
#ifdef KERNEL
#ifndef UKERNEL
+#ifdef RX_KERNEL_TRACE
+#include "rx_kcommon.h"
+#endif
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#include "afs/sysincludes.h"
#else
call->mode = (call->conn->type == RX_CLIENT_CONNECTION ?
RX_MODE_RECEIVING: RX_MODE_EOF);
+#ifdef RX_KERNEL_TRACE
+ {
+ int glockOwner = ISAFS_GLOCK();
+ if (!glockOwner)
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE,
+ ICL_TYPE_STRING, __FILE__,
+ ICL_TYPE_INT32, __LINE__,
+ ICL_TYPE_POINTER, call);
+ if (!glockOwner)
+ AFS_GUNLOCK();
+ }
+#endif
+
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
/* Wait until TQ_BUSY is reset before adding any
* packets to the transmit queue
bool_t xdr_afs_int64(register XDR *xdrs, afs_int64 *ulp)
{
- static afs_int32 high;
- static afs_uint32 low;
+ afs_int32 high;
+ afs_uint32 low;
if (xdrs->x_op == XDR_DECODE) {
if (!XDR_GETINT32(xdrs, (afs_int32 *) &high)) return (FALSE);
}
bool_t xdr_afs_uint64(register XDR *xdrs, afs_uint64 *ulp)
{
- static afs_uint32 high;
- static afs_uint32 low;
+ afs_uint32 high;
+ afs_uint32 low;
if (xdrs->x_op == XDR_DECODE) {
if (!XDR_GETINT32(xdrs, (afs_uint32 *) &high)) return (FALSE);
srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
+CFLAGS=-I. -I${srcdir} ${DBUG} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
SFLAGS=-P -I${TOP_INCDIR}
LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
${TOP_INCDIR}/afs/afs.exp \
${TOP_INCDIR}/afs/xfsattrs.h \
${TOP_LIBDIR}/afs.exp \
- ${TOP_LIBDIR}/libsys.a
+ ${TOP_LIBDIR}/libsys.a \
+ ${KERNELDIR}/afs \
+ ${KERNELDIR}/afs/xfsattrs.h \
+ ${UKERNELDIR}/afs \
+ ${UKERNELDIR}/afs/afsl.exp
-libsys.a: ${OBJECTS} ${RMTOBJS} AFS_component_version_number.o
+libsys.a: ${OBJECTS} ${RMTOBJS} afsl.exp AFS_component_version_number.o
-$(RM) -f $@
$(AR) crv $@ ${OBJECTS} ${RMTOBJS} \
AFS_component_version_number.o ${LIBSYS_AIX_EXP}
$(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
esac
+afs.exp: afs4.exp afs5.exp
+ case ${SYS_NAME} in \
+ rs_aix5* ) \
+ cp -p afs5.exp afs.exp ;; \
+ * ) \
+ cp -p afs4.exp afs.exp ;; \
+ esac
+
+afsl.exp: afsl4.exp afsl5.exp
+ case ${SYS_NAME} in \
+ rs_aix5* ) \
+ cp -p afsl5.exp afsl.exp ;; \
+ * ) \
+ cp -p afsl4.exp afsl.exp ;; \
+ esac
+
#
# Installation targets
#
${TOP_LIBDIR}/libsys.a: libsys.a
${INSTALL} $? $@
+${UKERNELDIR}/afs:
+ mkdir -p $@
+
+${UKERNELDIR}/afs/afsl.exp: afsl.exp
+ ${INSTALL} $? $@
+
+${KERNELDIR}/afs:
+ mkdir -p $@
+
+${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
+ ${INSTALL} $? $@
+
install: \
${DESTDIR}${libdir}/afs/libsys.a \
${DESTDIR}${sbindir}/rmtsysd \
clean:
$(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
- rmtsysd AFS_component_version_number.c pagsh pagsh.krb
+ rmtsysd AFS_component_version_number.c pagsh pagsh.krb \
+ afs.exp afsl.exp
--- /dev/null
+#!/unix
+*
+* $Locker$
+*
+*
+* Exports for the AFS kernel extension for AIX 3.1
+*
+icreate syscall
+syscall syscall
+iopen syscall
+iinc syscall
+idec syscall
+* iread syscall
+* iwrite syscall
+lsetpag syscall
+lpioctl syscall
+
+*
+* Exported variables (useful for debugging)
+*
+* afs_debug
+
+*
+* We replace the following system calls
+*
+*setgroups syscall
+kioctl32 syscall
+
+*
+*
+*
+root_exported
+afs_users
+CellLRU
+afs_servers
+afs_volumes
+afs_vhashT
+afs_cmstats
+afs_stats_cmperf
+afs_xvcache
+afs_xdcache
+afs_xserver
+afs_xvcb
+afs_xbrs
+afs_xcell
+afs_xconn
+afs_xuser
+afs_xvolume
+afs_setTimeHost
+afs_volCounter
+afs_cellindex
+afs_sysname
+afs_marinerHost
+* afs_marinerPort
+afs_mariner
+cacheInfoModTime
+freeVCList
+afs_freeDCList
+afs_freeDCCount
+afs_freeDSList
+cacheInode
+volumeInode
+cacheDiskType
+afs_indexCounter
+afs_cacheFiles
+afs_cacheBlocks
+afs_cacheStats
+afs_blocksUsed
+afs_fsfragsize
+osi_flplock
+rx_epoch
+rx_stats
+rx_extraQuota
+rx_extraPackets
+rx_stackSize
+rx_connDeadTime
+rx_idleConnectionTime
+rx_idlePeerTime
+rx_nPackets
+rx_nFreePackets
+rx_socket
+rx_port
+* rx_selectMask
+* rx_maxSocketNumber
+rx_packetQuota
+rx_nextCid
+rx_waitingForPackets
+rxi_nCalls
+rxi_dataQuota
+rxi_availProcs
+rxi_totalMin
+rxi_minDeficit
+rx_peerHashTable
+rx_connHashTable
+rx_services
+afs_indexTable
+afs_indexFlags
+afs_indexTimes
+rxi_Alloccnt
+rxi_Allocsize
+afs_dcentries
+rxevent_nFree
+rxevent_nPosted
+afs_brsWaiters
+afs_brsDaemons
+afs_brs
+afs_callo
+VLRU
+afs_DLRU
+afs_xcbhash
+rx_serverPool_lock
+rx_incomingCallQueue
+rx_freeCallQueue
+rx_idleServerQueue
+rx_freePktQ_lock
+freeSQEList_lock
+rx_freeCallQueue_lock
+rx_waitingForPackets_cv
+rx_peerHashTable_lock
+rx_connHashTable_lock
+rxevent_lock
+* rxdb_idHash
+* rxdb_lockList
+afs_duplicate_nfs_fids
+rx_tq_debug
+afs_totalServers
+afs_totalSrvAddrs
+afs_srvAddrs
+afs_global_lock
+afs_indexUnique
+afs_dvnextTbl
+afs_dcnextTbl
+afs_discardDCCount
+afs_TruncateDaemonRunning
+afs_CacheTooFull
+afs_blocksDiscarded
+afs_gcpags
+afs_gcpags_procsize
+afs_discardDCList
+afs_WaitForCacheDrain
--- /dev/null
+#!/unix
+*
+* $Locker$
+*
+*
+* Exports for the AFS kernel extension for AIX 3.1
+*
+icreate syscall
+syscall syscall
+iopen syscall
+iinc syscall
+idec syscall
+* iread syscall
+* iwrite syscall
+lsetpag syscall
+lpioctl syscall
+
+*
+* Exported variables (useful for debugging)
+*
+* afs_debug
+
+*
+* We replace the following system calls
+*
+*setgroups syscall
+kioctl32 syscall
int code, unixauthneeded, password_expires = -1;
*reenter = 0;
- *message = NULL;
+ *message = (char *)0;
if (response) {
pword = response;
} else {
return AUTH_FAILURE;
}
if (code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG, userName,
- NULL, NULL, pword, 0, &password_expires, 0, &reason)) {
+ (char *)0, (char *)0, pword, 0, &password_expires, 0, &reason)) {
if (code == KANOENT)
return AUTH_NOTFOUND;
*message = (char *)malloc(1024);
}
struct group *afs_getgrgid (int id) {
+#ifdef AFS_AIX51_ENV
+ static char name[64];
+ static char passwd[64];
+ static struct group grp;
+ struct group *g;
+ char *mem = NULL;
+
+ while ((g = getgrent()) != NULL) {
+ if (g->gr_gid == id) {
+ strncpy(&name, g->gr_name, sizeof(name));
+ strncpy(&passwd, g->gr_passwd, sizeof(passwd));
+ grp.gr_name = &name;
+ grp.gr_passwd = &passwd;
+ grp.gr_gid = g->gr_gid;
+ grp.gr_mem = &mem;
+ break;
+ }
+ }
+ endgrent();
+ if (g)
+ return &grp;
+#endif
return NULL;
}
}
#ifdef AFS_AIX51_ENV
-/*
- * This is a nasty hack. It seems getpwnam calls this routine and is not
- * happy with NULL as result. Trying to call here getpwnam in order to get
- * a reasonable result kills the whole program. So I tried to return
- * a dummy pwd and it seems to work!
- */
struct passwd *afs_getpwnam (char *user) {
- char name[64];
- char *passwd = "*";
- char *gecos = "";
- char *dir = "/";
- char *shell = "/bin/sh";
- char *nobody = "nobody";
- struct passwd p;
-
- strncpy((char *)&name, user, sizeof(name));
- name[63] = 0;
- p.pw_name = &name;
- p.pw_name = nobody;
- p.pw_passwd = passwd;
- p.pw_uid = 4294967294;
- p.pw_gid = 4294967294;
- p.pw_gecos = gecos;
- p.pw_dir = dir;
- p.pw_shell = shell;
-
- return &p;
+ static char name[64];
+ static char passwd[64];
+ static char gecos[256];
+ static char dir[256];
+ static char shell[256];
+ static struct passwd pwd;
+ struct passwd *p;
+
+ while ((p = getpwent()) != NULL) {
+ if (!strcmp(p->pw_name, user)) {
+ strncpy(&name, p->pw_name, sizeof(name));
+ strncpy(&passwd, p->pw_passwd, sizeof(passwd));
+ strncpy(&gecos, p->pw_gecos, sizeof(gecos));
+ strncpy(&dir, p->pw_dir, sizeof(dir));
+ strncpy(&shell, p->pw_shell, sizeof(shell));
+ pwd.pw_name = &name;
+ pwd.pw_passwd = &passwd;
+ pwd.pw_uid = p->pw_uid;
+ pwd.pw_gid = p->pw_gid;
+ pwd.pw_gecos = &gecos;
+ pwd.pw_dir = &dir;
+ pwd.pw_shell = &shell;
+ break;
+ }
+ }
+ endpwent();
+ return &pwd;
}
#else
int afs_getpwnam(int id)
#include <afs/icl.h>
#include <afs/afsutil.h>
-#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV)
+#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
/* For SGI 6.2, this is changed to 1 if it's a 32 bit kernel. */
int afs_icl_sizeofLong = 2;
#else
int afs_icl_sizeofLong = 1;
#endif
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
int afs_64bit_kernel = 1; /* Default for 6.2+, and always for 6.1 */
extern int afs_icl_sizeofLong; /* Used in ICL_SIZEHACK() */
#ifdef AFS_SGI62_ENV
* by typesp. Also watch for prematurely running out of parameters
* before the string is gone.
*/
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
static int CheckTypes(bufferp, typesp, typeCount, outMsgBuffer)
char *bufferp;
int *typesp;
afs_int32 rsize;
{
char msgBuffer[1024];
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
char outMsgBuffer[1024];
uint64_t tempParam;
uint64_t printfParms[ICL_MAXEXPANSION * /* max parms */ 4];
case ICL_TYPE_LONG:
case ICL_TYPE_POINTER:
printfTypes[pftix++] = 0;
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
printfParms[pfpix] = alp[pix];
printfParms[pfpix] &= 0xffffffff;
if (afs_64bit_kernel) {
#ifdef AFS_SGI64_ENV
printfStrings[pfpix++] = (char*) &alp[pix];
#else /* AFS_SGI64_ENV */
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
printfStrings[pfpix++] = (char *) &alp[pix];
#else /* AFS_SGI61_ENV */
printfParms[pfpix++] = (long) &alp[pix];
*/
printed = 0;
if (status == 0) {
-#ifdef AFS_SGI61_ENV
+#if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
if (CheckTypes(msgBuffer, printfTypes, pftix, outMsgBuffer)) {
/* we have a string to use, but it ends "(dfs / zcm)",
* so we remove the extra gunk.
}
/* free a log entry, and drop its reference count */
-int icl_LogFree(register struct afs_icl_log *logp)
+icl_LogFree(logp)
+ register struct afs_icl_log *logp;
{
logp->states |= ICL_LOGF_DELETED;
icl_LogRele(logp);
extern VInitVnodes_r();
extern Vnode *VGetVnode();
extern Vnode *VGetVnode_r();
-extern VputVnode();
-extern VputVnode_r();
+extern void VPutVnode();
+extern void VPutVnode_r();
extern VVnodeWriteToRead();
extern VVnodeWriteToRead_r();
extern Vnode *VAllocVnode();
struct iod iod;
int code = 0;
register struct iod *iodp = (struct iod *)0;
-// iod_Init(iodp, call);
+/* iod_Init(iodp, call); */
if (!code) code = SizeDumpDumpHeader(iodp, vp, fromtime, v_size);
if (!code) code = SizeDumpPartial(iodp, vp, fromtime, dumpAllDirs, v_size);
int code = 0;
int UseLatestReadOnlyClone = 1;
afs_int32 dumpTimes[2];
-// iodp->device = vp->device;
-// iodp->parentId = V_parentId(vp);
-// iodp->dumpPartition = vp->partition;
+/* iodp->device = vp->device; */
+/* iodp->parentId = V_parentId(vp); */
+/* iodp->dumpPartition = vp->partition; */
v_size->dump_size = 0; /* initialize the size */
/* if (!code) code = DumpDouble(iodp, D_DUMPHEADER, DUMPBEGINMAGIC, DUMPVERSION); */