]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-buf-redirector-20080528
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 28 May 2008 18:44:24 +0000 (18:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 28 May 2008 18:44:24 +0000 (18:44 +0000)
LICENSE MIT

Define new flag CM_BUF_REDIR for use with the redirector.
When set, the flag indicates that the buffer is being held by the redirector
and it should be left untouched by the cache manager.

(cherry picked from commit dc835c2d5397cc2b310dea374b043032b779ee3a)

src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_buf.h

index 584ede068dbcca789f80794400151672411f179e..2df898e19269bb656764a699784fa65fdbb7971b 100644 (file)
@@ -910,6 +910,10 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bu
              * we hold the global lock.
              */
 
+            /* Don't recycle a buffer held by the redirector. */
+            if (bp->flags & CM_BUF_REDIR)
+                continue;
+
             /* don't recycle someone in our own chunk */
             if (!cm_FidCmp(&bp->fid, &scp->fid)
                  && (bp->offset.LowPart & (-cm_chunkSize))
index 119ec25b3e2654a12e759c4ec11be6c220a89226..cc9b0440bddfe71c2e6117bbfdff0dae5aabd6ec 100644 (file)
@@ -106,6 +106,7 @@ typedef struct cm_buf {
 #define CM_BUF_WAITING 0x40    /* someone's waiting for a flag to change */
 #define CM_BUF_INDL     0x80    /* in the dirty list */
 #define CM_BUF_EOF     0x100   /* read 0 bytes; used for detecting EOF */
+#define CM_BUF_REDIR    0x200   /* buffer held by the redirector */
 
 typedef struct cm_buf_ops {
     long (*Writep)(void *, osi_hyper_t *, long, long, struct cm_user *,