openbsd31-cm-20021003
authorJim Rees <rees@umich.edu>
Thu, 3 Oct 2002 22:44:46 +0000 (22:44 +0000)
committerJim Rees <rees@umich.edu>
Thu, 3 Oct 2002 22:44:46 +0000 (22:44 +0000)
OpenBSD 3.1 changes for the cache manager
eliminate some unused variables

src/afs/VNOPS/afs_vnop_readdir.c
src/afs/afs.h
src/afs/afs_buffer.c
src/afs/afs_dcache.c
src/afs/afs_osi.c
src/afs/afs_osi_pag.c
src/afs/afs_prototypes.h

index 51e4c70..a5d7889 100644 (file)
@@ -140,7 +140,7 @@ struct irix5_min_dirent {     /* miniature dirent structure */
 #else
 struct min_direct {    /* miniature direct structure */
                        /* If struct direct changes, this must too */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     afs_uint32  d_fileno;
     u_short     d_reclen;
     u_char      d_type;
@@ -226,7 +226,7 @@ int afs_rd_stash_i = 0;
 #endif /* AFS_SUN56_ENV */
 #endif /* AFS_HPUX100_ENV */
 
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 int afs_readdir_type(avc, ade) 
 struct DirEntry *      ade;
 struct vcache *                avc;
@@ -386,7 +386,7 @@ afs_size_t          off;
 #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
     sdirEntry.d_off = off;
 #endif
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     sdirEntry.d_type=afs_readdir_type(vc, de);
 #endif
 
@@ -452,7 +452,6 @@ void afs_bulkstat_send( avc, req )
     struct vcache * avc;
     struct vrequest * req;
 {
-    XSTATS_DECLS
     afs_rd_stash_i = 0;
 }
 
@@ -461,7 +460,7 @@ void afs_bulkstat_send( avc, req )
  * It has to do with 'offset' (seek locations).
 */
 
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp)
     int *eofp;
 #else
@@ -521,7 +520,7 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred)
 #endif /* AFS_SGI61_ENV */
 #endif /* defined(AFS_SGI53_ENV) */
 
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     /* Not really used by the callee so we ignore it for now */
     if (eofp) *eofp = 0;
 #endif
@@ -657,7 +656,7 @@ tagain:
            } else {
                /* nothin to hand over */
            }
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
        if (eofp) *eofp = 1;    /* Set it properly */
 #endif
            if (ode) DRelease(ode, 0);
index fde6ae7..9a411be 100644 (file)
@@ -886,28 +886,30 @@ struct afs_fheader {
     afs_int32 otherCSize;
 };
 
-/* kept on disk and in dcache entries */
-struct fcache {
-    struct VenusFid fid;       /* Fid for this file */
-    afs_int32 modTime;         /* last time this entry was modified */
-    afs_hyper_t versionNo;     /* Associated data version number */
-    afs_int32 chunk;           /* Relative chunk number */
 #if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_64BIT_ENV)
-    /* Using ino64_t here so that user level debugging programs compile
-     * the size correctly.
-     */
-    ino64_t inode;             /* Unix inode for this chunk */
+/* Using ino64_t here so that user level debugging programs compile
+ * the size correctly.
+ */
+#define afs_inode_t ino64_t
 #else
 #if defined(AFS_LINUX_64BIT_KERNEL)
-    long inode;                        /* Unix inode for this chunk */
+#define afs_inode_t long
 #else
 #if defined(AFS_AIX51_ENV)
-    ino_t     inode;           /* Unix inode for this chunk */
+#define afs_inode_t ino_t
 #else
-    afs_int32 inode;           /* Unix inode for this chunk */
+#define afs_inode_t afs_int32
 #endif
 #endif
 #endif
+
+/* kept on disk and in dcache entries */
+struct fcache {
+    struct VenusFid fid;       /* Fid for this file */
+    afs_int32 modTime;         /* last time this entry was modified */
+    afs_hyper_t versionNo;     /* Associated data version number */
+    afs_int32 chunk;           /* Relative chunk number */
+    afs_inode_t inode;         /* Unix inode for this chunk */
     afs_int32 chunkBytes;      /* Num bytes in this chunk */
     char states;               /* Has this chunk been modified? */
 };
index 8528c21..dad53c5 100644 (file)
@@ -87,7 +87,7 @@ static int nbuffers;
 static afs_int32 timecounter;
 
 /* Prototypes for static routines */
-static struct buffer *afs_newslot (ino_t *afid, afs_int32 apage,register struct buffer *lp);
+static struct buffer *afs_newslot (afs_inode_t *afid, afs_int32 apage,register struct buffer *lp);
 
 static int dinit_flag = 0;
 void DInit (int abuffers)
@@ -143,7 +143,7 @@ void DInit (int abuffers)
     return;
 }
 
-char *DRead(register ino_t *fid, register int page)
+char *DRead(register afs_inode_t *fid, register int page)
 {
     /* Read a page from the disk. */
     register struct buffer *tb, *tb2;
@@ -267,7 +267,7 @@ static void FixupBucket(register struct buffer *ap)
 }
 
 /* lp is pointer to a fairly-old buffer */
-static struct buffer *afs_newslot (ino_t *afid, afs_int32 apage,register struct buffer *lp)
+static struct buffer *afs_newslot (afs_inode_t *afid, afs_int32 apage,register struct buffer *lp)
 {
     /* Find a usable buffer slot */
     register afs_int32 i;
@@ -419,7 +419,7 @@ int DVOffset (register void *ap)
  * of the hash function.  Oh well.  This should use the list traversal 
  * method of DRead...
  */
-void DZap (ino_t *fid)
+void DZap (afs_inode_t *fid)
 {
     register int i;
     /* Destroy all buffers pertaining to a particular fid. */
@@ -469,7 +469,7 @@ void DFlush (void)
     MReleaseReadLock(&afs_bufferLock);
 }
 
-char *DNew (register ino_t *fid, register int page)
+char *DNew (register afs_inode_t *fid, register int page)
 {
     /* Same as read, only do *not* even try to read the page, since it probably doesn't exist. */
     register struct buffer *tb;
index 0fcfa3c..4958865 100644 (file)
@@ -953,7 +953,6 @@ static void afs_GetDownDSlot(int anumber)
     struct afs_q *tq, *nq;
     struct dcache *tdc;
     int ix;
-    unsigned int i=0;
     unsigned int cnt;
 
     AFS_STATCNT(afs_GetDownDSlot);
@@ -1483,7 +1482,7 @@ struct dcache *afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
        register struct vrequest *areq, afs_size_t *aoffset, afs_size_t *alen, 
        int aflags)
 {
-    register afs_int32 i, code, code1, shortcut , adjustsize=0;
+    register afs_int32 i, code, code1=0, shortcut, adjustsize=0;
     int setLocks;
     afs_int32 index;
     afs_int32 us;
@@ -1493,9 +1492,9 @@ struct dcache *afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
     afs_size_t Position = 0;
 #ifdef AFS_64BIT_CLIENT
     afs_size_t tsize;
+    afs_size_t lengthFound;            /* as returned from server */
 #endif /* AFS_64BIT_CLIENT */
     afs_int32 size, tlen;              /* size of segment to transfer */
-    afs_size_t lengthFound;            /* as returned from server */
     struct tlocal1 *tsmall = 0;
     register struct dcache *tdc;
     register struct osi_file *file;
@@ -2614,9 +2613,7 @@ void afs_WriteThroughDSlots(void)
 
 struct dcache *afs_MemGetDSlot(register afs_int32 aslot, register struct dcache *tmpdc)
 {
-    register afs_int32 code;
     register struct dcache *tdc;
-    register char *tfile;
     int existing = 0;
 
     AFS_STATCNT(afs_MemGetDSlot);
@@ -2819,7 +2816,6 @@ struct dcache *afs_UFSGetDSlot(register afs_int32 aslot, register struct dcache
 
 int afs_WriteDCache(register struct dcache *adc, int atime)
 {
-    register struct osi_file *tfile;
     register afs_int32 code;
 
     if (cacheDiskType == AFS_FCACHE_TYPE_MEM) return 0;
index 4fbce99..2a5786b 100644 (file)
@@ -476,8 +476,6 @@ void *afs_osi_Alloc_NoSleep(size_t x)
 
 void afs_osi_Free(void *x, size_t asize)
 {
-    register struct osimem *tm, **lm, *um;
-
     AFS_STATCNT(osi_Free);
     if (x == &memZero) return; /* check for putting memZero back */
 
index 924355a..b601b0b 100644 (file)
@@ -137,7 +137,7 @@ afs_uint32 getpag(void)
 int
 #if    defined(AFS_SUN5_ENV)
 afs_setpag (struct AFS_UCRED **credpp)
-#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 afs_setpag (struct proc *p, void *args, int *retval)
 #else
 afs_setpag (void) 
@@ -164,7 +164,7 @@ afs_setpag (void)
 
 #if    defined(AFS_SUN5_ENV)
     code = AddPag(genpag(), credpp);
-#elif  defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
     code = AddPag(p, genpag(), &p->p_rcred);
 #elif  defined(AFS_AIX41_ENV)
     {
@@ -196,7 +196,7 @@ afs_setpag (void)
        code = AddPag(genpag(), &credp);
        crfree(credp);
     }
-#elif defined(AFS_DARWIN_ENV)  || defined(AFS_FBSD_ENV)
+#elif defined(AFS_DARWIN_ENV)  || defined(AFS_XBSD_ENV)
     {
        struct ucred *credp=crdup(p->p_cred->pc_ucred);
        code=AddPag(p, genpag(), &credp);
@@ -228,7 +228,7 @@ afs_setpag (void)
 int
 #if    defined(AFS_SUN5_ENV)
 afs_setpag_val (struct AFS_UCRED **credpp, int pagval)
-#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 afs_setpag_val (struct proc *p, void *args, int *retval, int pagval)
 #else
 afs_setpag_val (int pagval) 
@@ -255,7 +255,7 @@ afs_setpag_val (int pagval)
 
 #if    defined(AFS_SUN5_ENV)
     code = AddPag(pagval, credpp);
-#elif  defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
     code = AddPag(p, pagval, &p->p_rcred);
 #elif  defined(AFS_AIX41_ENV)
     {
@@ -287,7 +287,7 @@ afs_setpag_val (int pagval)
        code = AddPag(pagval, &credp);
        crfree(credp);
     }
-#elif defined(AFS_DARWIN_ENV)  || defined(AFS_FBSD_ENV)
+#elif defined(AFS_DARWIN_ENV)  || defined(AFS_XBSD_ENV)
     {
        struct ucred *credp=crdup(p->p_cred->pc_ucred);
        code=AddPag(p, pagval, &credp);
@@ -325,20 +325,20 @@ int afs_getpag_val()
 
 
 /* Note - needs to be available on AIX, others can be static - rework this */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp)
-#else  /* AFS_OSF_ENV || AFS_FBSD_ENV */
+#else  /* AFS_OSF_ENV || AFS_XBSD_ENV */
 int AddPag(afs_int32 aval, struct AFS_UCRED **credpp)
 #endif
 {
     afs_int32 newpag, code;
     AFS_STATCNT(AddPag);
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     if ((code = setpag(p, credpp, aval, &newpag, 0)))
 #else  /* AFS_OSF_ENV */
     if ((code = setpag(credpp, aval, &newpag, 0)))
 #endif
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
        return (code);
 #else
        return (setuerror(code), code);
@@ -358,7 +358,7 @@ int afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred)
         * think it's ok to use the real uid to make setuid
          * programs (without setpag) to work properly.
          */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
         av->uid = acred->cr_uid;    /* default when no pag is set */
                                     /* bsd creds don't have ruid */
 #else
@@ -426,7 +426,7 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred)
     if (cred == NULL) {
        return NOPAG;
     }
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     if (cred == NOCRED || cred == FSCRED) {
         return NOPAG;
     }
@@ -446,7 +446,7 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred)
     }
 #endif
 #else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_XBSD_ENV)
     if (cred->cr_ngroups < 2) return NOPAG;
 #endif
 #endif
index f6e1ecb..68ac3ad 100644 (file)
@@ -28,12 +28,12 @@ extern void afs_FreeAllAxs(struct axscache **headp);
 
 /* afs_buffer.c */
 extern void DInit (int abuffers);
-extern char *DRead(register ino_t *fid, register int page);
+extern char *DRead(register afs_inode_t *fid, register int page);
 extern void DRelease (register struct buffer *bp, int flag);
 extern int DVOffset (register void *ap);
-extern void DZap (ino_t *fid);
+extern void DZap (afs_inode_t *fid);
 extern void DFlush (void);
-extern char *DNew (register ino_t *fid, register int page);
+extern char *DNew (register afs_inode_t *fid, register int page);
 extern void shutdown_bufferpackage(void);
 
 /* afs_call.c */