sysname-list-instead-of-simple-name-20010605
[openafs.git] / src / afs / afs.h
index adca1b8..121ccd5 100644 (file)
@@ -63,6 +63,7 @@ extern int afs_shuttingdown;
 #define        PIGGYSIZE       1350        /* max piggyback size */
 #define        MAXVOLS         128         /* max vols we can store */
 #define        MAXSYSNAME      128         /* max sysname (i.e. @sys) size */
+#define MAXNUMSYSNAMES 16          /* max that current constants allow */
 #define        NOTOKTIMEOUT    (2*3600)    /* time after which to timeout conns sans tokens */
 #define        NOPAG           0xffffffff
 #define AFS_NCBRS      300         /* max # of call back return entries */
@@ -74,6 +75,11 @@ extern int afs_shuttingdown;
 #define        AFS_RXDEADTIME  50
 #define AFS_HARDDEADTIME        120
 
+struct sysname_info {
+  char *name;
+  short offset;
+  char index, allocked;
+};
 
 /* flags to use with AFSOP_CACHEINIT */
 #define AFSCALL_INIT_MEMCACHE        0x1         /* use a memory-based cache */
@@ -194,6 +200,7 @@ struct cell {
     u_short vlport;                        /* volume server port */
     short states;                          /* state flags */
     short cellIndex;                       /* relative index number per cell */
+    time_t timeout;                        /* data expire time, if non-zero */
 };
 
 #define        afs_PutCell(cellp, locktype)
@@ -509,7 +516,11 @@ struct SimpleLocks {
 #define VPageCleaning 0x2      /* Solaris - Cache Trunc Daemon sez keep out */
 
 #define        CPSIZE      2
+#if !defined(AFS_FBSD_ENV)
 #define        vrefCount   v.v_count
+#else
+#define vrefCount   v.v_usecount
+#endif /* AFS_FBSD_ENV */
 
 #define        AFS_MAXDV   0x7fffffff      /* largest dataversion number */
 #define        AFS_NOTRUNC 0x7fffffff      /* largest dataversion number */
@@ -557,7 +568,7 @@ struct vcache {
      * Do not try to get the vcache lock when the vlock is held */
     afs_rwlock_t vlock;
 #endif /* defined(AFS_SUN5_ENV) */
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV)
 #if    defined(AFS_SUN5_ENV)
     krwlock_t rwlock;
     struct cred *credp;
@@ -573,6 +584,9 @@ struct vcache {
 #ifdef AFS_AIX_ENV
     int ownslock;      /* pid of owner of excl lock, else 0 - defect 3083 */
 #endif
+#ifdef AFS_DARWIN_ENV
+    struct lock__bsd__      rwlock;
+#endif
     afs_int32 parentVnode;                     /* Parent dir, if a file. */
     afs_int32 parentUnique;
     struct VenusFid *mvid;             /* Either parent dir (if root) or root (if mt pt) */
@@ -809,8 +823,12 @@ struct fcache {
      */
     ino64_t inode;                     /* Unix inode for this chunk */
 #else
+#if defined(AFS_LINUX_64BIT_KERNEL)
+    long inode;                                /* Unix inode for this chunk */
+#else
     afs_int32 inode;                   /* Unix inode for this chunk */
 #endif
+#endif
     afs_int32 chunkBytes;              /* Num bytes in this chunk */
     char states;               /* Has this chunk been modified? */
 };
@@ -970,9 +988,15 @@ extern void shutdown_osifile();
   (((avc)->states & CStatd) ? (vcache2inode(avc), 0) : \
    afs_VerifyVCache2((avc),areq))
 #else
+#ifdef AFS_DARWIN_ENV
+#define afs_VerifyVCache(avc, areq)  \
+  (((avc)->states & CStatd) ? (osi_VM_Setup(avc), 0) : \
+   afs_VerifyVCache2((avc),areq))
+#else
 #define afs_VerifyVCache(avc, areq)  \
   (((avc)->states & CStatd) ? 0 : afs_VerifyVCache2((avc),areq))
 #endif
+#endif
 
 #define DO_STATS 1  /* bits used by FindVCache */
 #define DO_VLRU 2
@@ -1058,5 +1082,31 @@ extern int afs_norefpanic;
 #define VN_UNLOCK(vp)           simple_unlock(&(vp)->v_lock)
 #endif
 
+/* get a file's serial number from a vnode */
+#ifndef afs_vnodeToInumber
+#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#define afs_vnodeToInumber(V) VnodeToIno(V)
+#else
+#ifdef AFS_DECOSF_ENV
+#define afs_vnodeToInumber(V) osi_vnodeToInumber(V)
+#else
+#define afs_vnodeToInumber(V) (VTOI(V)->i_number)
+#endif /* AFS_DECOSF_ENV */
+#endif /* AFS_SGI62_ENV */
+#endif
+
+/* get a file's device number from a vnode */
+#ifndef afs_vnodeToDev
+#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#define afs_vnodeToDev(V) VnodeToDev(V)
+#else
+#ifdef AFS_DECOSF_ENV
+#define afs_vnodeToDev(V) osi_vnodeToDev(V)
+#else
+#define afs_vnodeToDev(V) (VTOI(V)->i_dev)
+#endif /* AFS_DECOSF_ENV */
+#endif /* AFS_SGI62_ENV */
+#endif
+
 #endif /* _AFS_H_ */