add flushpart; avoid O_DIRECT on linux

This commit is contained in:
rsc 2007-04-27 18:14:45 +00:00
parent 7e4524011b
commit e46cacb0ea
10 changed files with 39 additions and 21 deletions

View file

@ -175,13 +175,12 @@ icachewritesect(Index *ix, ISect *is, u8int *buf)
diskaccess(1);
trace(TraceProc, "icachewritesect writepart", addr, nbuf);
if(writepart(is->part, addr, buf, nbuf) < 0){
if(writepart(is->part, addr, buf, nbuf) < 0 || flushpart(is->part) < 0){
/* XXX more details here */
fprint(2, "icachewriteproc writepart: %r\n");
err = -1;
continue;
}
flushpart(is->part);
addstat(StatIsectWriteBytes, nbuf);
addstat(StatIsectWrite, 1);
icacheclean(chunk);