From ba94313f4030184890194c84f8d5c2f3f69f52d1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 2 Mar 2008 21:53:42 +0000 Subject: [PATCH] windows-cm_buf-20080302 LICENSE MIT remove unused constants, data structures and fields --- src/WINNT/afsd/cm_buf.c | 6 ------ src/WINNT/afsd/cm_buf.h | 27 +++++++-------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 37f4064..a56e55a 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -727,12 +727,6 @@ void buf_Recycle(cm_buf_t *bp) bp->flags &= ~CM_BUF_INHASH; } - /* bump the soft reference counter now, to invalidate softRefs; no - * wakeup is required since people don't sleep waiting for this - * counter to change. - */ - bp->idCounter++; - /* make the fid unrecognizable */ memset(&bp->fid, 0, sizeof(cm_fid_t)); } diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index c12a25e..1188d98 100644 --- a/src/WINNT/afsd/cm_buf.h +++ b/src/WINNT/afsd/cm_buf.h @@ -23,9 +23,6 @@ /* default buffer size */ #define CM_BUF_BLOCKSIZE CM_CONFIGDEFAULT_BLOCKSIZE -/* default hash size */ -#define CM_BUF_HASHSIZE 1024 - /* cache type */ #define CM_BUF_CACHETYPE_FILE 1 #define CM_BUF_CACHETYPE_VIRTUAL 2 @@ -39,9 +36,6 @@ extern int buf_cacheType; /* another hash fn */ #define BUF_FILEHASH(fidp) ((fidp)->hash % cm_data.buf_hashSize) -/* backup over pointer to the buffer */ -#define BUF_OVERTOBUF(op) ((cm_buf_t *)(((char *)op) - ((long)(&((cm_buf_t *)0)->over)))) - #define CM_BUF_MAGIC ('B' | 'U' <<8 | 'F'<<16 | 'F'<<24) #define CM_BUF_VERSION_BAD 0xFFFFFFFFFFFFFFFF @@ -65,13 +59,12 @@ typedef struct cm_buf { struct cm_buf *dirtyp; /* next in the dirty list */ osi_mutex_t mx; /* mutex protecting structure except refcount */ afs_int32 refCount; /* reference count (buf_globalLock) */ - long idCounter; /* counter for softrefs; bumped at each recycle */ - long dirtyCounter; /* bumped at each dirty->clean transition */ + afs_uint32 dirtyCounter; /* bumped at each dirty->clean transition */ osi_hyper_t offset; /* offset */ cm_fid_t fid; /* file ID */ afs_uint32 flags; /* flags we're using */ char *datap; /* data in this buffer */ - unsigned long error; /* last error code, if CM_BUF_ERROR is set */ + afs_uint32 error; /* last error code, if CM_BUF_ERROR is set */ cm_user_t *userp; /* user who wrote to the buffer last */ /* fields added for the CM; locked by scp->mx */ @@ -104,21 +97,15 @@ typedef struct cm_buf { /* waiting is done based on scp->flags. Removing bits from cmFlags should be followed by waking the scp. */ -/* represents soft reference which is OK to lose on a recycle */ -typedef struct cm_softRef { - cm_buf_t *bufp; /* buffer (may get reused) */ - long counter; /* counter of changes to identity */ -} cm_softRef_t; - #define CM_BUF_READING 1 /* now reading buffer from the disk */ #define CM_BUF_WRITING 2 /* now writing buffer to the disk */ #define CM_BUF_INHASH 4 /* in the hash table */ -#define CM_BUF_DIRTY 8 /* buffer is dirty */ -#define CM_BUF_INLRU 0x10 /* in lru queue */ -#define CM_BUF_ERROR 0x20 /* something went wrong on delayed write */ +#define CM_BUF_DIRTY 8 /* buffer is dirty */ +#define CM_BUF_INLRU 0x10 /* in lru queue */ +#define CM_BUF_ERROR 0x20 /* something went wrong on delayed write */ #define CM_BUF_WAITING 0x40 /* someone's waiting for a flag to change */ -#define CM_BUF_EVWAIT 0x80 /* someone's waiting for the buffer event */ -#define CM_BUF_EOF 0x100 /* read 0 bytes; used for detecting EOF */ + +#define CM_BUF_EOF 0x100 /* read 0 bytes; used for detecting EOF */ typedef struct cm_buf_ops { long (*Writep)(void *, osi_hyper_t *, long, long, struct cm_user *, -- 1.9.4