From: Hartmut Reuter Date: Wed, 31 Jan 2001 21:27:44 +0000 (+0000) Subject: sgi_65-compilation-patches-20010131 X-Git-Tag: BP-openafs-devel-autoconf~97 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=1ce1e6ed4900575fc341ace6c48e69d8fb98130b sgi_65-compilation-patches-20010131 Remove references to missing EFS support library so sgi_65 support compiles --- diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index 6c861a4..805ecae 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -23,6 +23,7 @@ extern struct vfs *afs_cacheVfsp; * now vectors to the correct EFS or XFS function. If new functionality is * added which accesses the inode, that will also need EFS/XFS variants. */ +#ifdef AFS_SGI_EFS_IOPS_ENV vnode_t *afs_EFSIGetVnode(ino_t ainode) { struct inode *ip; @@ -39,6 +40,7 @@ vnode_t *afs_EFSIGetVnode(ino_t ainode) iunlock(ip); return (EFS_ITOV(ip)); } +#endif /* AFS_SGI_EFS_IOPS_ENV */ vnode_t *afs_XFSIGetVnode(ino_t ainode) { @@ -142,6 +144,7 @@ osi_UFSTruncate(afile, asize) return code; } +#ifdef AFS_SGI_EFS_IOPS_ENV void osi_DisableAtimes(avp) struct vnode *avp; { @@ -152,6 +155,7 @@ struct vnode *avp; } } +#endif /* AFS_SGI_EFS_IOPS_ENV */ /* Generic read interface */ @@ -185,7 +189,9 @@ afs_osi_Read(afile, offset, aptr, asize) if (code == 0) { code = asize - resid; afile->offset += code; +#ifdef AFS_SGI_EFS_IOPS_ENV osi_DisableAtimes(afile->vnode); +#endif /* AFS_SGI_EFS_IOPS_ENV */ } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, diff --git a/src/afs/IRIX/osi_inode.c b/src/afs/IRIX/osi_inode.c index 33709bc..b896c1a 100644 --- a/src/afs/IRIX/osi_inode.c +++ b/src/afs/IRIX/osi_inode.c @@ -166,7 +166,8 @@ getinode(struct vfs *vfsp, dev_t dev, ino_t inode, struct inode **ipp) return ENOSYS; #endif - if (error = iget(vfstom(vfsp), (unsigned int)(inode&0xffffffff), &ip)) { + if (error = iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (unsigned int)(inode&0xffffffff), &ip)) { return error; } *ipp = ip; @@ -216,8 +217,10 @@ int xfs_getinode(struct vfs *vfsp, dev_t dev, ino_t inode, } #endif - if (error = xfs_iget(vfstom(vfsp), (void*)0, - (xfs_ino_t)inode,XFS_ILOCK_SHARED, &ip, (daddr_t)0)) { + if (error = xfs_iget((((struct mount *) + ((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (void*)0, (xfs_ino_t)inode, + XFS_ILOCK_SHARED, &ip, (daddr_t)0)) { SET_XFS_ERROR(3, vfsp->vfs_dev, inode); return error; } @@ -277,6 +280,7 @@ struct icreateargs { }; /* EFS only fs suite uses this entry point - icreate in afssyscalls.c. */ +#ifdef AFS_SGI_EFS_IOPS_ENV int icreate(struct icreateargs *uap, rval_t *rvp) { @@ -327,6 +331,7 @@ rval_t *rvp; iput(newip); return 0; } +#endif /* AFS_SGI_EFS_IOPS_ENV */ #ifdef AFS_SGI_XFS_IOPS_ENV /* inode creation routines for icreatename64 entry point. Use for EFS/XFS @@ -620,6 +625,7 @@ afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t *rvp) if (!vfsp) return ENXIO; +#ifdef AFS_SGI_EFS_IOPS_ENV if (vfsp->vfs_fstype == efs_fstype) { struct inode *ip; if (error = igetinode(vfsp, (dev_t)dev, inode, &ip)) @@ -631,20 +637,22 @@ afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t *rvp) } iunlock(ip); } - else if (vfsp->vfs_fstype == xfs_fstype) { - struct xfs_inode *xip; - if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip)) - return error; - vp = XFS_ITOV(xip); - if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) { - VN_RELE(vp); - return error; - } - } - else { - osi_Panic("afs_syscall_iopen: bad fstype = %d\n", - vfsp->vfs_fstype); - } + else +#endif /* AFS_SGI_EFS_IOPS_ENV */ + if (vfsp->vfs_fstype == xfs_fstype) { + struct xfs_inode *xip; + if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip)) + return error; + vp = XFS_ITOV(xip); + if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) { + VN_RELE(vp); + return error; + } + } + else { + osi_Panic("afs_syscall_iopen: bad fstype = %d\n", + vfsp->vfs_fstype); + } vfile_ready(fp, vp); rvp->r_val1 = fd; return 0; @@ -765,6 +773,7 @@ rval_t *rvp; * Only VICEMAGIC type inodes. */ #ifdef AFS_SGI_XFS_IOPS_ENV +#ifdef AFS_SGI_EFS_IOPS_ENV /* efs_iincdec * * XFS/EFS iinc/idec code for EFS. Uses 32 bit inode numbers. @@ -796,6 +805,7 @@ int inode, inode_p1, amount; iput(ip); return error; } +#endif /* AFS_SGI_EFS_IOPS_ENV */ /* xfs_iincdec * @@ -814,8 +824,9 @@ static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, int nlink; int vol; - code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED, - &ip, (daddr_t)0); + code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED, &ip, + (daddr_t)0); if (code) return code; @@ -963,9 +974,11 @@ iincdec64(int dev, int inode_hi, int inode_lo, int inode_p1, int amount) inode |= inode_lo; return xfs_iincdec64(vfsp, inode, inode_p1, amount); } +#ifdef AFS_SGI_EFS_IOPS_ENV else if (vfsp->vfs_fstype == efs_fstype) { return efs_iincdec(vfsp, inode_lo, inode_p1, amount); } +#endif /* AFS_SGI_EFS_IOPS_ENV */ return ENXIO; } @@ -1143,7 +1156,8 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, inode = inode_hi; inode <<= 32; inode |= inode_lo; - code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode, + code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED, &ip, (daddr_t)0); if (code) return code; diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 0224207..6139b6a 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -79,7 +79,10 @@ struct xfs_inode_info {}; #ifdef AFS_SGI64_ENV #include #endif /* AFS_SGI64_ENV */ +#include "../fs/efs_inode.h" +#ifdef AFS_SGI_EFS_IOPS_ENV #include "../sgiefs/efs.h" +#endif #include "../sys/kmem.h" #include "../sys/cred.h" #include "../sys/resource.h" diff --git a/src/libafs/MakefileProto.IRIX b/src/libafs/MakefileProto.IRIX index 430f871..9049f84 100644 --- a/src/libafs/MakefileProto.IRIX +++ b/src/libafs/MakefileProto.IRIX @@ -218,7 +218,7 @@ setup: -ln -s /usr/include/sys h -ln -s /usr/include/net /usr/include/netinet . -ln -s /usr/include/rpc /usr/include/sys . - -ln -s ../../obj/sgiefs sgiefs + -ln -s /usr/include/sys/fs . -mkdir ${DESTDIR}root.client/bin -mkdir ${DESTDIR}root.client/usr/vice/etc/sgiload @@ -342,14 +342,13 @@ ${COMPDIRS}: export CPU_KDEFS ;\ export LDFLAGS ;\ cd $$dir ; \ - $(MAKE) IPNO=$$p DESTDIR=../${DESTDIR} $$t.libafs || exit $$?; \ + $(MAKE) IPNO=$$p DESTDIR=${DESTDIR} $$t.libafs || exit $$?; \ cd ../ ; \ done; \ done -LIBAFSA = libafs.a LIBAFSNONFSA = libafs.nonfs.a COPYFILES = copyfiles LINKFILES = linkfiles @@ -358,47 +357,31 @@ STATICCLIENTDIR = ${DESTDIR}root.client/bin MODLOADCLIENTDIR = ${DESTDIR}root.client/usr/vice/etc/sgiload # Make the NFS and no-NFS clients for this directory. -# STATIC.libafs: ${LIBAFSA} ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES} +# STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES} STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES} - ${CP} ${LIBAFSA} \ - ${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.a ${CP} ${LIBAFSNONFSA} \ ${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.a - ${CP} ${LIBAFSA} \ - ${STATICCLIENTDIR}/libafs.${IPNO}.a ${CP} ${LIBAFSNONFSA} \ ${STATICCLIENTDIR}/libafs.${IPNO}.nonfs.a -${LIBAFSA}: $(AFSAOBJS) $(AFSNFSOBJS) - $(AR) cru $@ $? - ${LIBAFSNONFSA}: $(AFSAOBJS) $(AFSNONFSOBJS) $(AR) cru $@ $? -LIBAFSO = libafs.o LIBAFSNONFSO = libaf.nonfs.o -# MODLOAD.libafs: ${LIBAFSO} ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES} +# MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES} MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES} - ${CP} ${LIBAFSO} \ - ${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.o ${CP} ${LIBAFSNONFSO} \ ${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.o - ${CP} ${LIBAFSO} \ - ${MODLOADCLIENTDIR}/libafs.${IPNO}.o ${CP} ${LIBAFSNONFSO} \ ${MODLOADCLIENTDIR}/libafs.${IPNO}.nonfs.o -${LIBAFSO}: $(AFSAOBJS) $(AFSNFSOBJS) - $(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSO} $(AFSAOBJS) $(AFSNFSOBJS) - - ${LIBAFSNONFSO}: $(AFSAOBJS) $(AFSNONFSOBJS) $(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSNONFSO} \ $(AFSAOBJS) $(AFSNONFSOBJS) diff --git a/src/rx/rx.c b/src/rx/rx.c index eca7a5b..2db8ba8 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -455,7 +455,7 @@ int rx_Init(u_int port) #else struct sockaddr_in addr; int addrlen = sizeof(addr); - if (getsockname(rx_socket, (struct sockaddr *) &addr, &addrlen)) { + if (getsockname((int)rx_socket, (struct sockaddr *) &addr, &addrlen)) { rx_Finalize(); return -1; } diff --git a/src/vol/Makefile b/src/vol/Makefile index 127e338..711de2b 100644 --- a/src/vol/Makefile +++ b/src/vol/Makefile @@ -81,9 +81,6 @@ salvager: vol-salvage.o physio.o vlib.a *linux* ) \ ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \ ${LIBS} ;; \ - sgi_* ) \ - ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \ - ${LIBS} ../sgiefs/libefs.a ;; \ *) \ ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \ ${LIBS};; \ diff --git a/src/vol/devname.c b/src/vol/devname.c index 8b2c8e9..1dc4309 100644 --- a/src/vol/devname.c +++ b/src/vol/devname.c @@ -54,8 +54,10 @@ #if defined(AFS_SGI_ENV) #include #include -#include "../sgiefs/efs.h" +#ifdef AFS_SGI_EFS_IOPS_ENV #define ROOTINO EFS_ROOTINO +#include "../sgiefs/efs.h" +#endif #else #ifdef AFS_LINUX22_ENV #include diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 4ac1e7c..8e9bf01 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -417,6 +417,7 @@ ginode(inum) { /* libefs.h includes , which we don't want */ #define __ASSERT_H__ +#ifdef AFS_SGI_EFS_IOPS_ENV #include "../sgiefs/libefs.h" extern int Log(); @@ -606,6 +607,7 @@ Log("Ino=%d, bytes=%d, linkCnt=%d, [%x,%x,%x,%x]\n", inum, p->di_size, p->di_nli return err; } +#endif /* AFS_SGI_EFS_IOPS_ENV */ #ifdef AFS_SGI_XFS_IOPS_ENV #include @@ -1022,7 +1024,9 @@ int *forcep, forceR; int ninodes = 0, err = 0; struct efs_dinode *dinodeBuf = NULL; int last_cgno; +#ifdef AFS_SGI_EFS_IOPS_ENV EFS_MOUNT *mp; +#endif ino_t imax, inum; /* total number of I-nodes in file system */ *forcep = 0; @@ -1044,15 +1048,18 @@ int *forcep, forceR; } else #endif - { - if (root_inode.st_ino != EFS_ROOTINO) { - Log("%s is not root of a filesystem\n", mountedOn); - return -1; - } +#ifdef AFS_SGI_EFS_IOPS_ENV + if (root_inode.st_ino == EFS_ROOTINO) { return efs_ListViceInodes(devname, mountedOn, resultFile, - judgeInode, judgeParam, + judgeInode, judgeParam, forcep, forceR, wpath); } + else +#endif + { + Log("%s is not root of a filesystem\n", mountedOn); + return -1; + } } #else /* AFS_SGI_ENV */ diff --git a/src/vol/volume.c b/src/vol/volume.c index 2345e23..87398c4 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -72,13 +72,12 @@ #if defined(AFS_SGI_ENV) #include #include -#ifndef AFS_SGI_XFS_IOPS_ENV +#ifdef AFS_SGI_EFS_IOPS_ENV #define ROOTINO EFS_ROOTINO -#endif -/* #include -*/ -#include "../sgiefs/efs.h" /* until 5.1 release */ +#include "../sgiefs/efs.h" /* until 5.1 release */ +#endif + #else #ifndef AFS_LINUX20_ENV diff --git a/src/vol/xfs_size_check.c b/src/vol/xfs_size_check.c index db12aed..74aa0ac 100644 --- a/src/vol/xfs_size_check.c +++ b/src/vol/xfs_size_check.c @@ -19,7 +19,9 @@ #include #include #include "partition.h" +#ifdef AFS_SGI_EFS_IOPS_ENV #include "../sgiefs/efs.h" +#endif #include char *prog = "xfs_size_check"; diff --git a/src/volser/Makefile b/src/volser/Makefile index 751c08e..95b909c 100644 --- a/src/volser/Makefile +++ b/src/volser/Makefile @@ -107,10 +107,6 @@ volserver: $(SOBJS) $(LIBS) $(HACKS) *linux*) \ ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \ ${LDFLAGS} $(LIBS) ${XLIBS} ;; \ - sgi_*) \ - ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \ - ${LDFLAGS} $(LIBS) ${XLIBS} \ - ../sgiefs/libefs.a ;; \ *) \ ${CC} ${DBUG} -g -o volserver $(SOBJS) $(HACKS) \ ${LDFLAGS} $(LIBS) ${XLIBS} ;; \