]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-buf-redirector-20080528
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 28 May 2008 18:40:06 +0000 (18:40 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 28 May 2008 18:40:06 +0000 (18:40 +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.

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

index d53a5c1e76e8d5853237681a2141dd5c43fda75e..d97739f5759a850d441dafb0bcffda63cdc29350 100644 (file)
@@ -864,6 +864,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 3223adce1b95eabfdafcff539a954c22bf0e43f7..683b1528bae33c7fda925c6befecab19c1fd4acc 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 *,