| 21 |
|
#ifndef PCTFREE |
| 22 |
|
#define PCTFREE 15 /* maximum fraction to free (%) */ |
| 23 |
|
#endif |
| 24 |
< |
#ifndef MAXFRAG |
| 25 |
< |
#define MAXFRAG 32767 /* maximum fragments/file to track (0==inf) */ |
| 24 |
> |
#ifndef MAXFRAGB |
| 25 |
> |
#define MAXFRAGB 16 /* fragment blocks/file to track (0==inf) */ |
| 26 |
|
#endif |
| 27 |
|
#ifndef MINDIRSEL |
| 28 |
|
/* minimum directory seek length */ |
| 34 |
|
#define read readbuf |
| 35 |
|
#endif |
| 36 |
|
|
| 37 |
< |
#define FRAGBLK 256 /* number of fragments to allocate at a time */ |
| 37 |
> |
#define FRAGBLK 512 /* number of fragments to allocate at a time */ |
| 38 |
|
|
| 39 |
|
unsigned hdcachesize = CACHESIZE*1024*1024; /* target cache size */ |
| 40 |
|
unsigned long hdclock; /* clock value */ |
| 501 |
|
f->nfrags = j; |
| 502 |
|
} |
| 503 |
|
j = f->nfrags++; /* allocate a slot in free list */ |
| 504 |
< |
#if MAXFRAG |
| 505 |
< |
if (j >= MAXFRAG-1) |
| 506 |
< |
f->nfrags--; |
| 504 |
> |
#if MAXFRAGB |
| 505 |
> |
if (j >= MAXFRAGB*FRAGBLK) { |
| 506 |
> |
f->nfrags = j--; /* stop list growth */ |
| 507 |
> |
if (bi->nrd <= f->fi[j].nrd) |
| 508 |
> |
return; /* new one no better than discard */ |
| 509 |
> |
} |
| 510 |
|
#endif |
| 511 |
|
if (j % FRAGBLK == 0) { /* more free list space */ |
| 512 |
|
register BEAMI *newp; |