From: Johan Danielsson Date: Sat, 10 Feb 2001 20:57:28 +0000 (+0000) Subject: tru64-50-initial-support-20010210 X-Git-Tag: BP-openafs-devel-autoconf~88 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=d089415117684aea0f975e036615433b6c94f1b0 tru64-50-initial-support-20010210 makes client work under 5.0A, untested with 5.0 or 5.1 --- diff --git a/src/Makefile b/src/Makefile index 59a3995..8d528f9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -444,7 +444,7 @@ libafs_setup: config minproject export # Warning: The next few lines are _extremely_ sensitive to spaces and tabs. ${WASHTOOL} object libafs case ${SYS_NAME} in \ - alpha_dux4* ) \ + alpha_dux* ) \ MKAFS_OSTYPE=DUX;; \ hp_ux* ) \ MKAFS_OSTYPE=HPUX;; \ @@ -475,7 +475,7 @@ libuafs_setup: config minproject export MKAFS_OSTYPE=AIX;; \ sun4x_5* ) \ MKAFS_OSTYPE=SOLARIS;; \ - alpha_dux4* ) \ + alpha_dux* ) \ MKAFS_OSTYPE=DUX;; \ sgi_6* ) \ MKAFS_OSTYPE=IRIX;; \ diff --git a/src/afs/DUX/osi_inode.c b/src/afs/DUX/osi_inode.c index b0c2714..aefc9bd 100644 --- a/src/afs/DUX/osi_inode.c +++ b/src/afs/DUX/osi_inode.c @@ -56,6 +56,9 @@ getinode(fs, dev, inode, ipp, perror) } MOUNTLIST_LOCK(); } +#ifdef AFS_DUX50_ENV +#define m_next m_nxt +#endif mp = mp->m_next; } while (mp != rootfs); MOUNTLIST_UNLOCK(); @@ -212,6 +215,9 @@ afs_syscall_iopen(dev, inode, usrmod, retval) int fd; extern struct fileops vnops; register int code; +#ifdef AFS_DUX50_ENV + struct ufile_entry *fe; +#endif AFS_STATCNT(afs_syscall_iopen); @@ -222,10 +228,17 @@ afs_syscall_iopen(dev, inode, usrmod, retval) if (code) { return(code); } +#ifdef AFS_DUX50_ENV + if ((code = falloc(&fp, &fd, &fe)) != 0) { + iput(ip); + return(code); + } +#else if ((code = falloc(&fp, &fd)) != 0) { iput(ip); return(code); } +#endif IN_UNLOCK(ip); FP_LOCK(fp); @@ -235,7 +248,11 @@ afs_syscall_iopen(dev, inode, usrmod, retval) fp->f_data = (caddr_t)ITOV(ip); FP_UNLOCK(fp); +#ifdef AFS_DUX50_ENV + u_set_fe(fd, fe, fd, &u.u_file_state); +#else U_FD_SET(fd, fp, &u.u_file_state); +#endif *retval = fd; return(0); } diff --git a/src/afs/DUX/osi_vfsops.c b/src/afs/DUX/osi_vfsops.c index ecba5e5..7052de6 100644 --- a/src/afs/DUX/osi_vfsops.c +++ b/src/afs/DUX/osi_vfsops.c @@ -200,6 +200,14 @@ int mp_afs_sync(struct mount *mp, int flags) } +#ifdef AFS_DUX50_ENV +int mp_afs_smoothsync(struct mount *mp, u_int age, u_int smsync_flag) +{ + AFS_STATCNT(afs_sync); + return 0; +} +#endif + int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) { struct vrequest treq; @@ -350,7 +358,10 @@ struct vfsops afs_vfsops = { mp_afs_vptofh, mp_Afs_init, mp_afs_mountroot, - mp_afs_swapvp + mp_afs_swapvp, +#ifdef AFS_DUX50_ENV + mp_afs_smoothsync +#endif }; diff --git a/src/afs/DUX/osi_vnodeops.c b/src/afs/DUX/osi_vnodeops.c index f57b82b..b4424ad 100644 --- a/src/afs/DUX/osi_vnodeops.c +++ b/src/afs/DUX/osi_vnodeops.c @@ -40,6 +40,7 @@ int mp_afs_reclaim(), mp_afs_bmap(), mp_afs_strategy(), mp_afs_print(); int mp_afs_page_read(), mp_afs_page_write(), mp_afs_swap(), mp_afs_bread(); int mp_afs_brelse(), mp_afs_lockctl(), mp_afs_syncdata(), mp_afs_close(); int mp_afs_closex(); +int mp_afs_ioctl(); /* AFS vnodeops */ struct vnodeops Afs_vnodeops = { @@ -53,7 +54,7 @@ struct vnodeops Afs_vnodeops = { mp_afs_setattr, mp_afs_ubcrdwr, mp_afs_ubcrdwr, - afs_badop, /* vn_ioctl */ + mp_afs_ioctl, /* vn_ioctl */ seltrue, /* vn_select */ mp_afs_mmap, mp_afs_fsync, @@ -510,8 +511,13 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) flags = 0; ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); +#ifdef AFS_DUX50_ENV + code = ubc_lookup(((struct vnode *)avc)->v_object, pageBase, + PAGE_SIZE, PAGE_SIZE, &page, &flags, NULL); +#else code = ubc_lookup(((struct vnode *)avc)->v_object, pageBase, PAGE_SIZE, PAGE_SIZE, &page, &flags); +#endif AFS_GLOCK(); ObtainWriteLock(&avc->lock,163); @@ -561,9 +567,7 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) } AFS_GUNLOCK(); ubc_page_wait(page); - data = (char *)page->pg_addr; /* DUX 4.0D */ - if (data == 0) - data = (char *)PHYS_TO_KSEG(page->pg_phys_addr); /* DUX 4.0E */ + data = ubc_load(page, pageOffset, page_size); AFS_GLOCK(); ReleaseWriteLock(&avc->lock); /* uiomove may page fault */ AFS_GUNLOCK(); @@ -666,6 +670,12 @@ out: return code; } +int +mp_afs_ioctl(struct vnode *vp, int com, caddr_t data, int fflag, + struct ucred *cred, int *retval) +{ + return ENOSYS; +} /* * Now for some bad news. Since we artificially hold on to vnodes by doing @@ -724,15 +734,25 @@ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) } -int mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) +int mp_afs_getpage(vop, offset, len, protp, pl, plsz, +#ifdef AFS_DUX50_ENV + policy, +#else + mape, addr, +#endif + rw, cred) vm_ubc_object_t vop; vm_offset_t offset; vm_size_t len; vm_prot_t *protp; vm_page_t *pl; int plsz; +#ifdef AFS_DUX50_ENV + struct vm_policy *policy; +#else vm_map_entry_t mape; vm_offset_t addr; +#endif int rw; struct ucred *cred; { @@ -774,8 +794,13 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) flags = 0; ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); +#ifdef AFS_DUX50_ENV + code = ubc_lookup(((struct vnode *)avc)->v_object, off, + PAGE_SIZE, PAGE_SIZE, pagep, &flags, NULL); +#else code = ubc_lookup(((struct vnode *)avc)->v_object, off, PAGE_SIZE, PAGE_SIZE, pagep, &flags); +#endif AFS_GLOCK(); ObtainWriteLock(&avc->lock,168); if (code) { @@ -815,7 +840,11 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) } if ((rw & B_READ) == 0) { AFS_GUNLOCK(); +#ifdef AFS_DUX50_ENV + ubc_page_dirty(pl[i], 0); +#else ubc_page_dirty(pl[i]); +#endif AFS_GLOCK(); } else { if (protp && (flags & B_DIRTY) == 0) { @@ -1045,6 +1074,21 @@ mp_afs_write_check(vm_ubc_object_t vop, vm_page_t pp) return TRUE; } +#ifdef AFS_DUX50_ENV +int +mp_afs_objtovp(vm_ubc_object_t vop, struct vnode **vp) +{ + *vp = vop->vu_vp; + return 0; +} + +int +mp_afs_setpgstamp(vm_page_t pp, unsigned int tick) +{ + pp->pg_stamp = tick; + return 0; +} +#endif struct vfs_ubcops afs_ubcops = { @@ -1053,6 +1097,10 @@ struct vfs_ubcops afs_ubcops = { mp_afs_getpage, /* get page */ mp_afs_putpage, /* put page */ mp_afs_write_check, /* check writablity */ +#ifdef AFS_DUX50_ENV + mp_afs_objtovp, /* get vnode pointer */ + mp_afs_setpgstamp /* set page stamp */ +#endif }; diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 01f8856..e73c1f4 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -639,7 +639,9 @@ struct vrequest *areq; { #if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) -#ifdef AFS_DUX40_ENV +#ifdef AFS_DUX50_ENV +#define vno_close(X) vn_close((X), 0, NOCRED) +#elif defined(AFS_DUX40_ENV) #define vno_close vn_close #endif /* We don't need this for AIX since: diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index c66e135..2b2fd20 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -713,6 +713,13 @@ void afs_osi_TraverseProcTable() void afs_osi_TraverseProcTable() { struct pid_entry *pe; +#ifdef AFS_DUX50_ENV +extern struct pid_entry *pidtab; +extern int npid; +#define pidNPID (pidtab + npid) +#define PID_LOCK() +#define PID_UNLOCK() +#endif PID_LOCK(); for (pe = pidtab; pe < pidNPID; ++pe) { if (pe->pe_proc != PROC_NULL) diff --git a/src/config/Makefile.alpha_dux50 b/src/config/Makefile.alpha_dux50 new file mode 100644 index 0000000..7bc6378 --- /dev/null +++ b/src/config/Makefile.alpha_dux50 @@ -0,0 +1,29 @@ +# 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 + +AFS_OSTYPE = DUX + +MT_CC=cc +XCFLAGS= -D_NO_PROTO -DOSF +MT_CFLAGS=-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS} +SHLIB_SUFFIX=so +SHLIB_CFLAGS= +XLIBS= +MTLIBS=-pthread -lpthread -lmach -lexc -lc +NON_SHARED=-non_shared +TXLIBS= -lcurses +LWP_OPTMZ=-O2 +OPTMZ=-O2 +DBG=-g3 +CP=cp +CSTATIC=-non_shared +RANLIB=/bin/true +WASHTOOL=${SRCDIR}bin/washtool +INSTALL=${SRCDIR}bin/install + +#this is for the vol package +FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 7f5ed76..ada6df6 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -100,6 +100,7 @@ #define SYS_NAME_ID_alpha_osf32 1203 #define SYS_NAME_ID_alpha_osf32c 1204 #define SYS_NAME_ID_alpha_dux40 1205 +#define SYS_NAME_ID_alpha_dux50 1206 #define SYS_NAME_ID_ncrx86_20 1300 #define SYS_NAME_ID_ncrx86_30 1301 diff --git a/src/config/param.alpha_dux50.h b/src/config/param.alpha_dux50.h new file mode 100644 index 0000000..29926ae --- /dev/null +++ b/src/config/param.alpha_dux50.h @@ -0,0 +1,108 @@ +/* + * 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 + */ + +#ifndef _PARAM_OSF1_H_ +#define _PARAM_OSF1_H_ + +#define AFS_OSF_ENV 1 +#define AFS_OSF20_ENV 1 +#define AFS_OSF30_ENV 1 +#define AFS_OSF32_ENV 1 +#define AFS_OSF32C_ENV 1 +#define AFS_DUX40_ENV 1 +#define AFS_DUX50_ENV 1 +#define __alpha 1 +#define AFS_ALPHA_ENV 1 +#define AFS_DECOSF_ENV 1 +#define AFS_64BIT_ENV 1 + +#include + +#define AFS_VM_RDWR_ENV 1 +#define AFS_VFS_ENV 1 +#define AFS_GREEDY43_ENV 1 +#define AFS_ENV 1 +#define AFS_MINPHYS_ENV 1 +#define CMUSTD_ENV 1 + +#define AFS_SYSCALL 232 +#define AFS_MOUNT_AFS 13 + +#ifndef MOUNT_AFS +#define MOUNT_AFS AFS_MOUNT_AFS +#endif +#define SYS_NAME "alpha_dux50" +#define SYS_NAME_ID SYS_NAME_ID_alpha_dux50 + +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_STATVFS 1 /* System supports statvfs */ + +#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ +#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode spares */ +#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ + +#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) +#include +#if BYTE_ORDER == BIG_ENDIAN +#define AFSBIG_ENDIAN 1 +#else +#if BYTE_ORDER == LITTLE_ENDIAN +#define AFSLITTLE_ENDIAN 1 +#else +#error machine/endian.h must define BYTE_ORDER! +#endif +#endif +#endif /* ! ASSEMBLER && ! __LANGUAGE_ASSEMBLY__ */ + +#define NEARINODE_HINT 1 /* hint to ufs module to scatter inodes on disk*/ +#define nearInodeHash(volid, hval) { \ + unsigned char* ts = (unsigned char*)&(volid);\ + for ((hval)=0; ts<(unsigned char*)&(volid)+sizeof(volid);ts++){\ + (hval) *= 173; \ + (hval) += *ts; \ + } \ + } + +/* Extra kernel definitions (from kdefs file) */ +#ifdef _KERNEL +#define AFS_GLOBAL_SUNLOCK 1 +#define AFS_VFS34 1 /* What is VFS34??? */ +#define AFS_SHORTGID 1 /* are group id's short? */ +#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 m_stat.f_bsize +#define vfs_fsid m_stat.f_fsid +#define va_nodeid va_fileid +#define vfs_vnodecovered m_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))) + +#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) +enum vcexcl {NONEXCL, EXCL}; + +#include + +#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ +#endif /* _KERNEL */ + +#endif /* _PARAM_OSF1_H_ */ diff --git a/src/config/param.alpha_dux50_usr.h b/src/config/param.alpha_dux50_usr.h new file mode 100644 index 0000000..76139e4 --- /dev/null +++ b/src/config/param.alpha_dux50_usr.h @@ -0,0 +1,67 @@ +/* + * 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 + */ + +#ifndef _PARAM_ALPHA_DUX50_USR_H_ +#define _PARAM_ALPHA_DUX50_USR_H_ + +#define AFS_VFS_ENV 1 +/* Used only in vfsck code; is it needed any more???? */ +#define RXK_LISTENER_ENV 1 +#define AFS_USERSPACE_IP_ADDR 1 +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ + +#define UKERNEL 1 /* user space kernel */ +#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */ +#define AFS_64BIT_ENV 1 +#define AFS_ENV 1 +#define AFS_USR_OSF_ENV 1 +#define AFS_USR_DUX40_ENV 1 + +#include + +/*#define AFS_GLOBAL_SUNLOCK 1*/ /* For global locking */ + +#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ +#define AFS_SYSCALL 232 + +/* File system entry (used if mount.h doesn't define MOUNT_AFS */ +#define AFS_MOUNT_AFS 1 + +/* Machine / Operating system information */ +#define sys_alpha_dux40 1 +#define SYS_NAME "alpha_dux50" +#define SYS_NAME_ID SYS_NAME_ID_alpha_dux50 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ +#define AFSLITTLE_ENDIAN 1 + +/* Extra kernel definitions (from kdefs file) */ +#ifdef KERNEL +#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */ +#define AFS_SYSVLOCK 1 /* sys v locking supported */ +/*#define AFS_USEBUFFERS 1*/ +#define afsio_iov uio_iov +#define afsio_iovcnt uio_iovcnt +#define afsio_offset uio_offset +#define afsio_seg uio_segflg +#define afsio_fmode uio_fmode +#define afsio_resid uio_resid +#define AFS_UIOSYS 1 +#define AFS_UIOUSER UIO_USERSPACE +#define AFS_CLBYTES MCLBYTES +#define AFS_MINCHANGE 2 +#define VATTR_NULL usr_vattr_null +#endif /* KERNEL */ +#define AFS_DIRENT +#ifndef CMSERVERPREF +#define CMSERVERPREF +#endif +#define ROOTINO UFSROOTINO + +#endif /* _PARAM_ALPHA_DUX50_USR_H_ */ diff --git a/src/libafs/MakefileProto.DUX b/src/libafs/MakefileProto.DUX index 6aa6589..2d4ed95 100644 --- a/src/libafs/MakefileProto.DUX +++ b/src/libafs/MakefileProto.DUX @@ -77,6 +77,8 @@ DEST_LIBAFSNONFS = ${DESTDIR}/root.client/bin/${LIBAFSNONFS} # libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS) + +.PHONY: libafs libafs: $(DEST_LIBAFSNONFS) diff --git a/src/rx/Makefile b/src/rx/Makefile index 44e2a0f..bc09d2d 100644 --- a/src/rx/Makefile +++ b/src/rx/Makefile @@ -119,8 +119,8 @@ includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_glo kinstall: includes set $(KERNELDIR)rx; $(MKDIR_IF_NEEDED) $(INSTALL) $(KSRCS) $(KERNELDIR)rx - @case ${SYS_NAME} in \ - alpha_dux4* ) \ + case ${SYS_NAME} in \ + alpha_dux* ) \ $(INSTALL) DUX/*.[ch] $(KERNELDIR)rx;; \ hp_ux* ) \ $(INSTALL) HPUX/*.[ch] $(KERNELDIR)rx;; \ @@ -139,7 +139,7 @@ kinstall: includes ukinstall webinstall: includes set $(UKERNELDIR)rx; $(MKDIR_IF_NEEDED) $(INSTALL) $(UKSRCS) $(UKERNELDIR)rx - $(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)rx + -$(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)rx clean: rm -f *.o *.a core *_component_version_number.c