diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-14 22:23:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-14 22:23:16 +0200 |
commit | 2e85e328864c215c2efa228f129ce3fa6aa1db1f (patch) | |
tree | 0cff25891d80c72978e16c5784b07923b0b1017e /sys/src/cmd/9660srv/9660srv.c | |
parent | f5688dd6c9bfb6cee00f2c5e5f190d7a2ffaa6c6 (diff) |
9660srv: keep data and metadata separate in the cache with a tag
data on the disk is layed out sequentially and directory information
is at the end of the disk. we want to keep data and metadata separated
so that reading large sequential files will not evict the directory
information from the cache causing long seeks.
for that, we tag the clusters (an 8th for metadata, and the rest
for data) and getbuf() will only evict clusters of the same tag.
Diffstat (limited to 'sys/src/cmd/9660srv/9660srv.c')
-rw-r--r-- | sys/src/cmd/9660srv/9660srv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/cmd/9660srv/9660srv.c b/sys/src/cmd/9660srv/9660srv.c index 37dbd444b..8fe773d1b 100644 --- a/sys/src/cmd/9660srv/9660srv.c +++ b/sys/src/cmd/9660srv/9660srv.c @@ -69,7 +69,7 @@ iattach(Xfile *root) dp = nil; haveplan9 = 0; for(i=VOLDESC;i<VOLDESC+100; i++){ /* +100 for sanity */ - p = getbuf(cd->d, i); + p = getbuf(cd->d, i, 1); v = (Voldesc*)(p->iobuf); if(memcmp(v->byte, "\01CD001\01", 7) == 0){ /* iso */ if(dirp) @@ -372,7 +372,7 @@ iread(Xfile *f, char *buf, vlong offset, long count) while(count > 0){ if(n > count) n = count; - p = getbuf(f->xf->d, addr); + p = getbuf(f->xf->d, addr, 0); memmove(&buf[rcnt], &p->iobuf[o], n); putbuf(p); count -= n; @@ -499,7 +499,7 @@ getdrec(Xfile *f, void *buf) ip->offset += Sectorsize-boff; continue; } - p = getbuf(f->xf->d, addr/Sectorsize); + p = getbuf(f->xf->d, addr/Sectorsize, 1); len = p->iobuf[boff]; if(len >= 34) break; @@ -754,7 +754,7 @@ getcontin(Xdata *dev, uchar *p, uchar **s) off = l32(p+12); len = l32(p+20); chat("getcontin %d...", bn); - b = getbuf(dev, bn); + b = getbuf(dev, bn, 1); if(b == 0){ *s = 0; return 0; |