From 35ed0439e32b6aeffc4aee2601a08e0406302cbc Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 11 Jan 2010 13:51:42 -0500 Subject: [PATCH 1/1] Windows: buf_Recycle should clean up flags and reset version The CM_BUF_EOF and CM_BUF_ERROR buffer flags and the buffer dataVersion should be reset within buf_Recycle() instead of by the caller of buf_Recycle(). LICENSE MIT Change-Id: I643da102553200b20f5ecc23ec43974581663a8e Reviewed-on: http://gerrit.openafs.org/1085 Tested-by: Jeffrey Altman Reviewed-by: Derrick Brashear Reviewed-by: Asanka Herath Tested-by: Asanka Herath Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_buf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index acfde34..10c0ea7 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -896,6 +896,10 @@ void buf_Recycle(cm_buf_t *bp) /* make the fid unrecognizable */ memset(&bp->fid, 0, sizeof(cm_fid_t)); + + /* clean up junk flags */ + bp->flags &= ~(CM_BUF_EOF | CM_BUF_ERROR); + bp->dataVersion = CM_BUF_VERSION_BAD; /* unknown so far */ } /* recycle a buffer, removing it from the free list, hashing in its new identity @@ -1030,10 +1034,6 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *req */ buf_Recycle(bp); - /* clean up junk flags */ - bp->flags &= ~(CM_BUF_EOF | CM_BUF_ERROR); - bp->dataVersion = CM_BUF_VERSION_BAD; /* unknown so far */ - /* now hash in as our new buffer, and give it the * appropriate label, if requested. */ -- 1.9.4