From dc835c2d5397cc2b310dea374b043032b779ee3a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 28 May 2008 18:40:06 +0000 Subject: [PATCH] windows-buf-redirector-20080528 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 | 4 ++++ src/WINNT/afsd/cm_buf.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index d53a5c1e7..d97739f57 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -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)) diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index 3223adce1..683b1528b 100644 --- a/src/WINNT/afsd/cm_buf.h +++ b/src/WINNT/afsd/cm_buf.h @@ -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 *, -- 2.39.5