aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/smugfs/cache.c
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/smugfs/cache.c
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
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 <cross@gajendra.net>
Diffstat (limited to 'src/cmd/smugfs/cache.c')
-rw-r--r--src/cmd/smugfs/cache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/smugfs/cache.c b/src/cmd/smugfs/cache.c
index 2adf8b9b..afce6ba7 100644
--- a/src/cmd/smugfs/cache.c
+++ b/src/cmd/smugfs/cache.c
@@ -78,14 +78,14 @@ static void
movetofront(Cache *c, CEntry *e)
{
popout(c, e);
- insertfront(c, e);
+ insertfront(c, e);
}
static CEntry*
evict(Cache *c)
{
CEntry *e;
-
+
e = c->tail;
popout(c, e);
c->cefree(e);
@@ -101,7 +101,7 @@ cachelookup(Cache *c, char *name, int create)
{
int h;
CEntry *e;
-
+
h = hash(name) % c->nhash;
for(e=c->hash[h]; e; e=e->hash.next){
if(strcmp(name, e->name) == 0){
@@ -109,10 +109,10 @@ cachelookup(Cache *c, char *name, int create)
return e;
}
}
-
+
if(!create)
return nil;
-
+
if(c->nentry >= c->maxentry)
e = evict(c);
else{
@@ -124,7 +124,7 @@ cachelookup(Cache *c, char *name, int create)
h = hash(name) % c->nhash;
e->hash.next = c->hash[h];
c->hash[h] = e;
- return e;
+ return e;
}
void
@@ -132,7 +132,7 @@ cacheflush(Cache *c, char *substr)
{
CEntry **l, *e;
int i;
-
+
for(i=0; i<c->nhash; i++){
for(l=&c->hash[i]; (e=*l); ){
if(substr == nil || strstr(e->name, substr)){