From b32073b9d3a95d014a43747cb873a2d6a8400ae3 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 3 Aug 2006 03:57:06 +0000 Subject: [PATCH] death-to-efs-20060802 We never define AFS_SGI_EFS_IOPS_ENV any more, so kill all the now-dead EFS code. --- src/afs/IRIX/osi_file.c | 40 ------- src/afs/IRIX/osi_inode.c | 104 ------------------ src/afs/IRIX/osi_vnodeops.c | 13 --- src/afs/sysincludes.h | 3 - src/vol/devname.c | 4 - src/vol/listinodes.c | 204 ------------------------------------ src/vol/volume.c | 6 -- src/vol/xfs_size_check.c | 3 - 8 files changed, 377 deletions(-) diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index 556c9596f..c3c8c9dbf 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -23,31 +23,6 @@ afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; - -/* As of 6.2, we support either XFS or EFS clients. osi_UFSOpen - * 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; - int error; - - if ((error = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, ainode, &ip))) { - osi_Panic("afs_EFSIGetVnode: igetinode failed, error=%d", error); - } - /* We don't care about atimes on the cache files, so disable them. I'm not - * sure that this is the right place to do this: it should be *after* readi - * and getattr and stuff. - */ - ip->i_flags &= ~(ISYN | IACC); - iunlock(ip); - return (EFS_ITOV(ip)); -} -#endif /* AFS_SGI_EFS_IOPS_ENV */ - vnode_t * afs_XFSIGetVnode(ino_t ainode) { @@ -153,18 +128,6 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) return code; } -#ifdef AFS_SGI_EFS_IOPS_ENV -void -osi_DisableAtimes(struct vnode *avp) -{ - if (afs_CacheFSType == AFS_SGI_EFS_CACHE) { - struct inode *ip = EFS_VTOI(avp); - ip->i_flags &= ~IACC; - } - -} -#endif /* AFS_SGI_EFS_IOPS_ENV */ - /* Generic read interface */ int @@ -198,9 +161,6 @@ afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, 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, ICL_TYPE_INT32, code); diff --git a/src/afs/IRIX/osi_inode.c b/src/afs/IRIX/osi_inode.c index 62f9825ed..7bad9dac8 100644 --- a/src/afs/IRIX/osi_inode.c +++ b/src/afs/IRIX/osi_inode.c @@ -292,60 +292,9 @@ struct icreateargs { int icreate(struct icreateargs *uap, rval_t * rvp) { -#ifdef AFS_SGI_EFS_IOPS_ENV - AFS_STATCNT(icreate); - return (afs_syscall_icreate - (uap->dev, uap->near_inode, uap->param1, uap->param2, uap->param3, - uap->param4, rvp)); -#else return ENOSYS; -#endif } -#ifdef AFS_SGI_EFS_IOPS_ENV -int -afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp) - afs_uint32 dev, near_inode, param1, param2, param3, param4; - rval_t *rvp; -{ - struct inode *ip, *newip; - struct afsparms *ap; - struct cred cr; - int error; - - AFS_STATCNT(afs_syscall_icreate); - if (!afs_suser(NULL)) - return EPERM; - - if (error = getinode(0, (dev_t) dev, 2, &ip)) - return error; - - cr.cr_uid = 0; - cr.cr_gid = -2; - if (error = efs_ialloc(ip, IFREG, 1, NODEV, &newip, &cr)) { - iput(ip); - return error; - } - iput(ip); - osi_Assert(newip); - newip->i_flags |= IACC | IUPD | ICHG; - - osi_Assert(newip->i_afs == NULL); - newip->i_afs = kmem_alloc(sizeof(struct afsparms), KM_SLEEP); - if (param2 == INODESPECIAL) - newip->i_version = EFS_IVER_AFSSPEC; - else - newip->i_version = EFS_IVER_AFSINO; - ap = (struct afsparms *)newip->i_afs; - ap->vicep1 = param1; /* VOLid */ - ap->vicep2 = param2; /* Vnode # */ - ap->vicep3 = param3; /* SPEC:type INO:vnode uniq */ - ap->vicep4 = param4; /* SPEC:parentId INO:data version */ - rvp->r_val1 = newip->i_number; - iput(newip); - return 0; -} -#else /* !AFS_SGI_EFS_IOPS_ENV */ int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp) afs_uint32 dev, near_inode, param1, param2, param3, param4; @@ -353,7 +302,6 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp) { return ENOSYS; } -#endif /* AFS_SGI_EFS_IOPS_ENV */ #ifdef AFS_SGI_XFS_IOPS_ENV /* inode creation routines for icreatename64 entry point. Use for EFS/XFS @@ -646,19 +594,6 @@ 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)) - return error; - vp = EFS_ITOV(ip); - if (error = vfile_alloc((usrmod + 1) & (FMASK), &fp, &fd)) { - iput(ip); - return error; - } - iunlock(ip); - } 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)) @@ -788,40 +723,6 @@ afs_syscall_iopen(dev, inode, usrmod, 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. - */ -static int -efs_iincdec(vfsp, inode, inode_p1, amount) - struct vfs *vfsp; - int inode, inode_p1, amount; -{ - struct inode *ip; - int error; - - if (error = igetinode(vfsp, NULL, inode, &ip)) - return error; - - if (!IS_VICEMAGIC(ip)) - error = EPERM; - else if (((struct afsparms *)ip->i_afs)->vicep1 != inode_p1) - error = ENXIO; - else { - ip->i_nlink += amount; - osi_Assert(ip->i_nlink >= 0); - if (ip->i_nlink == 0) { - CLEAR_VICEMAGIC(ip); - afsidestroy(ip); - } - ip->i_flags |= ICHG; - } - /* XXX sync write?? */ - iput(ip); - return error; -} -#endif /* AFS_SGI_EFS_IOPS_ENV */ /* xfs_iincdec * @@ -989,11 +890,6 @@ 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; } diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c index c6a0b7f7d..e673b8952 100644 --- a/src/afs/IRIX/osi_vnodeops.c +++ b/src/afs/IRIX/osi_vnodeops.c @@ -1912,19 +1912,6 @@ afs_InitDualFSCacheOps(struct vnode *vp) return; inited = 1; - -#ifdef AFS_SGI_EFS_IOPS_ENV - swp = vfs_getvfssw("efs"); - if (swp) { - afs_efs_vnodeopsp = swp->vsw_vnodeops; - if (vp && vp->v_op == afs_efs_vnodeopsp) { - afs_CacheFSType = AFS_SGI_EFS_CACHE; - afs_IGetVnode = afs_EFSIGetVnode; - found = 1; - } - } -#endif /* AFS_SGI_EFS_IOPS_ENV */ - swp = vfs_getvfssw("xfs"); if (swp) { afs_xfs_vnodeopsp = swp->vsw_vnodeops; diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index e67c7bc33..787bcd39a 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -160,9 +160,6 @@ typedef unsigned short etap_event_t; #endif #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/vol/devname.c b/src/vol/devname.c index f614bc3b9..0d5a017fa 100644 --- a/src/vol/devname.c +++ b/src/vol/devname.c @@ -64,10 +64,6 @@ RCSID #if defined(AFS_SGI_ENV) #include #include -#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 979cbea97..597ba2cce 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -455,201 +455,6 @@ 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(); - -/* afs_efs_figet() replaces the SGI library routine because we are malloc'ing - * memory for all the inodes on all the cylinder groups without releasing - * it when we're done. Using afs_efs_figet ensures more efficient use of - * memory. - */ -struct efs_dinode * -afs_efs_figet(EFS_MOUNT * mp, struct efs_dinode *dinodeBuf, int *last_cgno, - ino_t inum) -{ - int cgno = EFS_ITOCG(mp->m_fs, inum); - - - if (cgno != *last_cgno) { - if (efs_readb - (mp->m_fd, (char *)dinodeBuf, EFS_CGIMIN(mp->m_fs, cgno), - mp->m_fs->fs_cgisize) != mp->m_fs->fs_cgisize) { - Log("Unable to read inodes for cylinder group %d.\n", cgno); - return NULL; - } - *last_cgno = cgno; - } - - return dinodeBuf + (inum % (mp->m_fs->fs_cgisize * EFS_INOPBB)); -} - - -int -efs_ListViceInodes(char *devname, char *mountedOn, char *resultFile, - int (*judgeInode) (), int judgeParam, int *forcep, - int forceR, char *wpath, void *rock) -{ - FILE *inodeFile = NULL; - char dev[50], rdev[51]; - struct stat status; - struct efs_dinode *p; - struct ViceInodeInfo info; - int ninodes = 0, err = 0; - struct efs_dinode *dinodeBuf = NULL; - int last_cgno; - EFS_MOUNT *mp; - ino_t imax, inum; /* total number of I-nodes in file system */ - - *forcep = 0; - - partition = mountedOn; - sprintf(dev, "/dev/dsk/%s", devname); - sprintf(rdev, "/dev/rdsk/%s", devname); - - - /* - * open raw device - */ - efs_init(Log); - if ((stat(rdev, &status) == -1) - || ((mp = efs_mount(rdev, O_RDONLY)) == NULL)) { - sprintf(rdev, "/dev/r%s", devname); - mp = efs_mount(rdev, O_RDONLY); - } - if (mp == NULL) { - Log("Unable to open `%s' inode for reading\n", rdev); - return -1; - } - - inodeFile = fopen(resultFile, "w"); - if (inodeFile == NULL) { - Log("Unable to create inode description file %s\n", resultFile); - goto out; - } - - /* Allocate space for one cylinder group's worth of inodes. */ - dinodeBuf = (struct efs_dinode *)malloc(mp->m_fs->fs_cgisize * BBSIZE); - if (!dinodeBuf) { - Log("Unable to malloc %lu bytes for inode buffer.\n", - mp->m_fs->fs_cgisize * BBSIZE); - goto out; - } - - /* - * calculate the maximum number of inodes possible - */ - imax = mp->m_fs->fs_ncg * mp->m_fs->fs_ipcg; - - last_cgno = -1; - for (inum = 2; inum < imax; ++inum) { - p = afs_efs_figet(mp, dinodeBuf, &last_cgno, inum); - if (!p) { - Log("Unable to read all inodes from partition.\n"); - goto out; - } - if (!IS_DVICEMAGIC(p) || !((p->di_mode & IFMT) == IFREG)) { - continue; - } -#if defined(AFS_SGI_EXMAG) - /* volume ID */ - info.u.param[0] = - dmag(p, 0) << 24 | dmag(p, 1) << 16 | dmag(p, 2) << 8 | dmag(p, - 3) << - 0; - if ((p)->di_version == EFS_IVER_AFSSPEC) { - info.u.param[1] = INODESPECIAL; - /* type */ - info.u.param[2] = dmag(p, 8); - /* parentId */ - info.u.param[3] = - dmag(p, 4) << 24 | dmag(p, 5) << 16 | dmag(p, - 6) << 8 | dmag(p, - 7) - << 0; - } else { - /* vnode number */ - info.u.param[1] = - dmag(p, 4) << 16 | dmag(p, 5) << 8 | dmag(p, 6) << 0; - /* disk uniqifier */ - info.u.param[2] = - dmag(p, 7) << 16 | dmag(p, 8) << 8 | dmag(p, 9) << 0; - /* data version */ - info.u.param[3] = - dmag(p, 10) << 16 | dmag(p, 11) << 8 | (p)->di_spare; - } -#else - BOMB ! ! -#endif - info.inodeNumber = inum; - info.byteCount = p->di_size; - info.linkCount = p->di_nlink; -#ifdef notdef - Log("Ino=%d, bytes=%d, linkCnt=%d, [%x,%x,%x,%x]\n", inum, p->di_size, - p->di_nlink, info.u.param[0], info.u.param[1], info.u.param[2], - info.u.param[3]); -#endif - if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0) - continue; - - if (fwrite(&info, sizeof info, 1, inodeFile) != 1) { - Log("Error writing inode file for partition %s\n", partition); - goto out; - } - ++ninodes; - } - - if (fflush(inodeFile) == EOF) { - Log("Unable to successfully flush inode file for %s\n", partition); - err = -2; - goto out1; - } - if (fsync(fileno(inodeFile)) == -1) { - Log("Unable to successfully fsync inode file for %s\n", partition); - err = -2; - goto out1; - } - if (fclose(inodeFile) == EOF) { - Log("Unable to successfully close inode file for %s\n", partition); - err = -2; - goto out1; - } - - /* - * Paranoia: check that the file is really the right size - */ - if (stat(resultFile, &status) == -1) { - Log("Unable to successfully stat inode file for %s\n", partition); - err = -2; - goto out1; - } - if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) { - Log("Wrong size (%d instead of %d) in inode file for %s\n", - status.st_size, ninodes * sizeof(struct ViceInodeInfo), - partition); - err = -2; - goto out1; - } - efs_umount(mp); - if (dinodeBuf) { - free(dinodeBuf); - } - return 0; - - out: - err = -1; - out1: - if (dinodeBuf) { - free(dinodeBuf); - } - efs_umount(mp); - if (inodeFile) - fclose(inodeFile); - - return err; -} -#endif /* AFS_SGI_EFS_IOPS_ENV */ - #ifdef AFS_SGI_XFS_IOPS_ENV #include #include @@ -1069,9 +874,6 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, 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; @@ -1091,12 +893,6 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, return xfs_ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, forcep, forceR, wpath, rock); } else -#endif -#ifdef AFS_SGI_EFS_IOPS_ENV - if (root_inode.st_ino == EFS_ROOTINO) { - return efs_ListViceInodes(devname, mountedOn, resultFile, judgeInode, - judgeParam, forcep, forceR, wpath, rock); - } else #endif { Log("%s is not root of a filesystem\n", mountedOn); diff --git a/src/vol/volume.c b/src/vol/volume.c index 84a588559..c61013b96 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -82,12 +82,6 @@ RCSID #if defined(AFS_SGI_ENV) #include #include -#ifdef AFS_SGI_EFS_IOPS_ENV -#define ROOTINO EFS_ROOTINO -#include -#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 38cd0ee32..0d60ef511 100644 --- a/src/vol/xfs_size_check.c +++ b/src/vol/xfs_size_check.c @@ -23,9 +23,6 @@ RCSID("$Header$"); #include #include #include "partition.h" -#ifdef AFS_SGI_EFS_IOPS_ENV -#include "sgiefs/efs.h" -#endif #include char *prog = "xfs_size_check"; -- 2.39.5