summaryrefslogtreecommitdiff
path: root/sys/src/9/port/swap.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-07-27 06:42:41 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-07-27 06:42:41 +0200
commit652a6417046de7d102a1520fee11a30d91ad7f2f (patch)
treecbece5a3011896a7bbdaff4618c56d1966cc0bbf /sys/src/9/port/swap.c
parentff494b954f950a3b060b9770212321e7576dca49 (diff)
kernel: clunk the cache when removing cache flag on a channel, only call cread() chen CCACHE flag is set
to avoid double caching, attachimage() and setswapchan() clear the CCACHE flag on the channel but this keeps the read ahread state of the cache arround (until the chan gets closed), so also call cclunk() to detach the mcp and free the read ahead state. avoid the call to cread() when CCACHE flag is clear.
Diffstat (limited to 'sys/src/9/port/swap.c')
-rw-r--r--sys/src/9/port/swap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/9/port/swap.c b/sys/src/9/port/swap.c
index c5e249732..9d492257e 100644
--- a/sys/src/9/port/swap.c
+++ b/sys/src/9/port/swap.c
@@ -424,6 +424,7 @@ setswapchan(Chan *c)
}
}
c->flag &= ~CCACHE;
+ cclunk(c);
swapimage.c = c;
poperror();
}