~kris/9p

9hist

72bcbfc0ae424fa9e61fcc6259e4ed64502b9f38 — David du Colombier 27 years ago 2da1851
Plan 9 from Bell Labs 1999-09-03
1 files changed, 7 insertions(+), 3 deletions(-)

M port/cache.c
M port/cache.c => port/cache.c +7 -3
@@ 58,6 58,7 @@ struct Ecache
static Image fscache;
static Cache cache;
static Ecache ecache;
static int maxcache = MAXCACHE;

static void
extentfree(Extent* e)


@@ 109,6 110,9 @@ cinit(void)
	cache.head = xalloc(sizeof(Mntcache)*NFILE);
	m = cache.head;

	if(conf.npage*BY2PG > 200*MB)
		maxcache = 10*MAXCACHE;

	for(i = 0; i < NFILE-1; i++) {
		m->next = m+1;
		m->prev = m-1;


@@ 290,7 294,7 @@ cread(Chan *c, uchar *buf, int len, vlong off)
	int o, l, total;
	ulong offset;

	if(off+len > MAXCACHE)
	if(off+len > maxcache)
		return 0;

	m = c->mcp;


@@ 453,7 457,7 @@ cupdate(Chan *c, uchar *buf, int len, vlong off)
	int o, ee, eblock;
	ulong offset;

	if(off > MAXCACHE || len == 0)
	if(off > maxcache || len == 0)
		return;

	m = c->mcp;


@@ 563,7 567,7 @@ cwrite(Chan* c, uchar *buf, int len, vlong off)
	Extent *p, *f, *e, *tail;
	ulong offset;

	if(off > MAXCACHE || len == 0)
	if(off > maxcache || len == 0)
		return;

	m = c->mcp;