From fa325e9b42b0bdfb48857d1958d9fb7ceac55151 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Fri, 10 Jan 2020 14:44:21 +0000 Subject: Trivial changes: whitespace and modes. Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross --- src/cmd/venti/srv/icache.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/cmd/venti/srv/icache.c') diff --git a/src/cmd/venti/srv/icache.c b/src/cmd/venti/srv/icache.c index 3055b981..3663345d 100644 --- a/src/cmd/venti/srv/icache.c +++ b/src/cmd/venti/srv/icache.c @@ -60,14 +60,14 @@ mkihash(int size1) u32int size; int bits; IHash *ih; - + bits = 0; size = 1; while(size < size1){ bits++; size <<= 1; } - + ih = vtmallocz(sizeof(IHash)+size*sizeof(ih->table[0])); ih->table = (IEntry**)(ih+1); ih->bits = bits; @@ -80,7 +80,7 @@ ihashlookup(IHash *ih, u8int score[VtScoreSize], int type) { u32int h; IEntry *ie; - + h = hashbits(score, ih->bits); for(ie=ih->table[h]; ie; ie=ie->nexthash) if((type == -1 || type == ie->ia.type) && scorecmp(score, ie->score) == 0) @@ -93,7 +93,7 @@ ihashdelete(IHash *ih, IEntry *ie, char *what) { u32int h; IEntry **l; - + h = hashbits(ie->score, ih->bits); for(l=&ih->table[h]; *l; l=&(*l)->nexthash) if(*l == ie){ @@ -107,7 +107,7 @@ static void ihashinsert(IHash *ih, IEntry *ie) { u32int h; - + h = hashbits(ie->score, ih->bits); ie->nexthash = ih->table[h]; ih->table[h] = ie; @@ -203,7 +203,7 @@ scacheevict(void) { ISum *s; int i; - + for(i=icache.nsum-1; i>=0; i--){ s = icache.sum[i]; if(canqlock(&s->lock)){ @@ -281,7 +281,7 @@ scachemiss(u64int addr) qunlock(&s->lock); return nil; } - + return s; /* locked */ } @@ -294,7 +294,7 @@ initicache(u32int mem0) { u32int mem; int i, entries, scache; - + icache.full.l = &icache.lock; mem = mem0; @@ -312,7 +312,7 @@ fprint(2, "icache %,d bytes = %,d entries; %d scache\n", mem0, entries, scache); icache.clean.prev = icache.clean.next = &icache.clean; icache.dirty.prev = icache.dirty.next = &icache.dirty; icache.free.prev = icache.free.next = (IEntry*)&icache.free; - + icache.hash = mkihash(entries); icache.nentries = entries; setstat(StatIcacheSize, entries); @@ -338,7 +338,7 @@ static IEntry* evictlru(void) { IEntry *ie; - + ie = poplast(&icache.clean); if(ie == nil) return nil; @@ -356,7 +356,7 @@ icacheinsert(u8int score[VtScoreSize], IAddr *ia, int state) while((ie = poplast(&icache.free)) == nil && (ie = evictlru()) == nil){ // Could safely return here if state == IEClean. // But if state == IEDirty, have to wait to make - // sure we don't lose an index write. + // sure we don't lose an index write. // Let's wait all the time. flushdcache(); kickicache(); @@ -444,7 +444,7 @@ insertscore(u8int score[VtScoreSize], IAddr *ia, int state, AState *as) scacheload(toload); qunlock(&toload->lock); } - + if(icache.ndirty >= icache.maxdirty) kickicache(); @@ -483,7 +483,7 @@ lookupscore(u8int score[VtScoreSize], int type, IAddr *ia) addstat2(StatIcacheRead, 1, StatIcacheReadTime, msec() - ms); return ret; } - + u32int hashbits(u8int *sc, int bits) { @@ -550,7 +550,7 @@ void icacheclean(IEntry *ie) { IEntry *next; - + trace(TraceProc, "icacheclean enter"); qlock(&icache.lock); for(; ie; ie=next){ @@ -574,7 +574,7 @@ emptyicache(void) int i; IEntry *ie; ISum *s; - + qlock(&icache.lock); while((ie = evictlru()) != nil) pushfirst(&icache.free, ie); @@ -586,4 +586,3 @@ emptyicache(void) } qunlock(&icache.lock); } - -- cgit v1.2.3