alpha-linux26-20050403
[openafs.git] / src / afs / afs.h
index e35c0e6..1ec276d 100644 (file)
@@ -29,7 +29,7 @@ extern int afs_shuttingdown;
  * Macros to uniquely identify the AFS vfs struct
  */
 #define        AFS_VFSMAGIC            0x1234
-#if    defined(AFS_SUN_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
 #define        AFS_VFSFSID             99
 #else
 #if defined(AFS_SGI_ENV)
@@ -43,7 +43,7 @@ extern int afs_shuttingdown;
 #if     defined(AFS_HPUX102_ENV)
 #define AFS_FLOCK       k_flock
 #else
-#if     defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV)
+#if     defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV) && !defined(AFS_IA64_LINUX26_ENV) && !defined(AFS_S390X_LINUX26_ENV) && !defined(AFS_ALPHA_LINUX26_ENV))
 #define AFS_FLOCK       flock64
 #else
 #define AFS_FLOCK       flock
@@ -71,6 +71,7 @@ extern int afs_shuttingdown;
 #define        NFENTRIES       256     /* hash table size for disk volume table */
 #define        VCSIZE         1024     /* stat cache hash table size */
 #define        DCSIZE          512     /* disk cache hash table size */
+#define CBRSIZE                512     /* call back returns hash table size */
 #define        PIGGYSIZE       1350    /* max piggyback size */
 #define        MAXVOLS         128     /* max vols we can store */
 #define        MAXSYSNAME      128     /* max sysname (i.e. @sys) size */
@@ -191,7 +192,12 @@ struct vrequest {
  * callbacks.  Sent asynchronously when we run a little low on free dudes.
  */
 struct afs_cbr {
+    struct afs_cbr **pprev;
     struct afs_cbr *next;
+
+    struct afs_cbr **hash_pprev;
+    struct afs_cbr *hash_next;
+
     struct AFSFid fid;
 };
 
@@ -551,24 +557,18 @@ struct SimpleLocks {
 #define vrefCount   v.v_count
 #endif /* AFS_XBSD_ENV */
 
-#ifdef AFS_LINUX24_ENV
+#if defined(AFS_LINUX24_ENV)
 #define VREFCOUNT(v)           atomic_read(&((vnode_t *) v)->v_count)
 #define VREFCOUNT_SET(v, c)    atomic_set(&((vnode_t *) v)->v_count, c)
 #define VREFCOUNT_DEC(v)       atomic_dec(&((vnode_t *) v)->v_count)
 #define VREFCOUNT_INC(v)       atomic_inc(&((vnode_t *) v)->v_count)
-#define DLOCK()      spin_lock(&dcache_lock)
-#define DUNLOCK()    spin_unlock(&dcache_lock)
-#define DGET(d)      dget_locked(d)
-#define DCOUNT(d)    atomic_read(&(d)->d_count)
 #else
 #define VREFCOUNT(v)           ((v)->vrefCount)
 #define VREFCOUNT_SET(v, c)    (v)->vrefCount = c;
 #define VREFCOUNT_DEC(v)       (v)->vrefCount--;
 #define VREFCOUNT_INC(v)       (v)->vrefCount++;
-#define DLOCK()
-#define DUNLOCK()
-#define DGET(d)      dget(d)
-#define DCOUNT(d)    ((d)->d_count)
+#define d_unhash(d) list_empty(&(d)->d_hash)
+#define dget_locked(d) dget(d)
 #endif
 
 #define        AFS_MAXDV   0x7fffffff  /* largest dataversion number */
@@ -627,8 +627,8 @@ struct vcache {
        afs_uint32 Date;
        afs_uint32 Owner;
        afs_uint32 Group;
-       ushort Mode;            /* XXXX Should be afs_int32 XXXX */
-       ushort LinkCount;
+       afs_uint16 Mode;        /* XXXX Should be afs_int32 XXXX */
+       afs_uint16 LinkCount;
        /* vnode type is in v.v_type */
     } m;
     afs_rwlock_t lock;         /* The lock on the vcache contents. */
@@ -641,7 +641,7 @@ struct vcache {
     krwlock_t rwlock;
     struct cred *credp;
 #endif
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#ifdef AFS_BOZONLOCK_ENV
     afs_bozoLock_t pvnLock;    /* see locks.x */
 #endif
 #ifdef AFS_AIX32_ENV
@@ -696,7 +696,6 @@ struct vcache {
        struct dcache *dchint;
     } h1;
 #ifdef AFS_LINUX22_ENV
-    u_short flushcnt;          /* Number of flushes which haven't released yet. */
     u_short mapcnt;            /* Number of mappings of this file. */
 #endif
 #if defined(AFS_SGI_ENV)
@@ -894,7 +893,7 @@ struct afs_fheader {
  */
 #define afs_inode_t ino64_t
 #else
-#if defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_S390X_LINUX24_ENV)
 #define afs_inode_t long
 #else
 #if defined(AFS_AIX51_ENV) || defined(AFS_HPUX1123_ENV)
@@ -926,6 +925,7 @@ struct fcache {
 /* kept in memory */
 struct dcache {
     struct afs_q lruq;         /* Free queue for in-memory images */
+    struct afs_q dirty;                /* Queue of dirty entries that need written */
     afs_rwlock_t lock;         /* Protects validPos, some f */
     afs_rwlock_t tlock;                /* Atomizes updates to refCount */
     afs_rwlock_t mflock;       /* Atomizes accesses/updates to mflags */
@@ -1188,7 +1188,8 @@ struct afs_fakestat_state {
 extern int afs_fakestat_enable;
 
 struct buffer {
-    ino_t fid[1];              /* Unique cache key + i/o addressing */
+    afs_int32 fid;             /* is adc->index, the cache file number */
+    afs_inode_t inode;         /* is adc->f.inode, the inode number of the cache file */
     afs_int32 page;
     afs_int32 accesstime;
     struct buffer *hashNext;