From d3e54f7f405ae67a9e821defe01bb98134ac8a65 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 28 May 2008 18:44:24 +0000 Subject: [PATCH] DEVEL15-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. (cherry picked from commit dc835c2d5397cc2b310dea374b043032b779ee3a) --- 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 584ede068..2df898e19 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -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)) diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index 119ec25b3..cc9b0440b 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