windows-64bit-data-version-20071114
[openafs.git] / src / WINNT / afsd / cm_scache.h
index d045143..01aef07 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __CM_SCACHE_H_ENV__
 #define __CM_SCACHE_H_ENV__ 1
 
-#define MOUNTPOINTLEN   1024
+#define MOUNTPOINTLEN   1024    /* max path length for symlink; same as AFSPATHMAX */
 
 typedef struct cm_fid {
        unsigned long cell;
@@ -116,7 +116,7 @@ typedef struct cm_scache {
     cm_prefetch_t prefetch;            /* prefetch info structure */
     afs_uint32 unixModeBits;           /* unix protection mode bits */
     afs_uint32 linkCount;              /* link count */
-    afs_uint32 dataVersion;            /* data version */
+    afs_uint64 dataVersion;            /* data version */
     afs_uint32 owner;                  /* file owner */
     afs_uint32 group;                  /* file owning group */
     cm_user_t *creator;                        /* user, if new file */
@@ -161,7 +161,7 @@ typedef struct cm_scache {
                                  */
     unsigned long lastRefreshCycle; /* protected with cm_scacheLock
                                      * for all scaches. */
-    afs_uint32 lockDataVersion; /* dataVersion of the scp at the time
+    afs_uint64  lockDataVersion; /* dataVersion of the scp at the time
                                    the server lock for the scp was
                                    asserted for this lock the last
                                    time. */
@@ -189,6 +189,13 @@ typedef struct cm_scache {
     /* bulk stat progress */
     osi_hyper_t bulkStatProgress;      /* track bulk stats of large dirs */
 
+#ifdef USE_BPLUS
+    /* directory B+ tree */             /* only allocated if is directory */
+    osi_rwlock_t dirlock;               /* controls access to dirBplus */
+    afs_uint64   dirDataVersion;        /* data version represented by dirBplus */
+    struct tree *dirBplus;              /* dirBplus */
+#endif
+
     /* open state */
     afs_uint16 openReads;              /* open for reading */
     afs_uint16 openWrites;             /* open for writing */
@@ -198,6 +205,12 @@ typedef struct cm_scache {
     /* syncop state */
     afs_uint32 waitCount;           /* number of threads waiting */
     afs_uint32 waitRequests;        /* num of thread wait requests */
+    osi_queue_t * waitQueueH;       /* Queue of waiting threads.
+                                       Holds queue of
+                                       cm_scache_waiter_t
+                                       objects. Protected by
+                                       cm_cacheLock. */
+    osi_queue_t * waitQueueT;       /* locked by cm_scacheLock */
 } cm_scache_t;
 
 /* mask field - tell what has been modified */
@@ -301,6 +314,15 @@ typedef struct cm_scache {
                                    (fidp)->unique))    \
                                        % cm_data.scacheHashTableSize)
 
+typedef struct cm_scache_waiter {
+    osi_queue_t q;
+    afs_int32   threadId;
+
+    cm_scache_t *scp;
+    afs_int32   flags;
+    void        *bufp;
+} cm_scache_waiter_t;
+
 #include "cm_conn.h"
 #include "cm_buf.h"
 
@@ -375,6 +397,8 @@ extern long cm_ValidateSCache(void);
 
 extern long cm_ShutdownSCache(void);
 
+extern void cm_SuspendSCache(void);
+
 extern long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags);
 
 extern void cm_RemoveSCacheFromHashTable(cm_scache_t *scp);