revert-afs-indextimes-in-dcache-20050125
[openafs.git] / src / afs / afs.h
index c3464ef..16d29cb 100644 (file)
@@ -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))
 #define AFS_FLOCK       flock64
 #else
 #define AFS_FLOCK       flock
@@ -562,19 +562,13 @@ struct SimpleLocks {
 #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 */
@@ -633,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. */
@@ -900,7 +894,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)
@@ -932,6 +926,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 */
@@ -1194,7 +1189,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;