The write combining code in revision 1.30 needs a few additional
touch ups. The cache needs to be flushed against block reads, and a final flush at process termination to force the backup superblocks to disk. I believe this will allow 'make release' to complete. Submitted by: Tor.Egge@fast.no
This commit is contained in:
parent
dd3e4087e8
commit
dc1ac7c889
@ -153,6 +153,7 @@ int makedir __P((struct direct *, int));
|
|||||||
void rdfs __P((daddr_t, int, char *));
|
void rdfs __P((daddr_t, int, char *));
|
||||||
void setblock __P((struct fs *, unsigned char *, int));
|
void setblock __P((struct fs *, unsigned char *, int));
|
||||||
void wtfs __P((daddr_t, int, char *));
|
void wtfs __P((daddr_t, int, char *));
|
||||||
|
void wtfsflush __P((void));
|
||||||
|
|
||||||
#ifndef STANDALONE
|
#ifndef STANDALONE
|
||||||
void get_memleft __P((void));
|
void get_memleft __P((void));
|
||||||
@ -719,6 +720,7 @@ next:
|
|||||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||||
wtfs(fsbtodb(&sblock, cgsblock(&sblock, cylno)),
|
wtfs(fsbtodb(&sblock, cgsblock(&sblock, cylno)),
|
||||||
sbsize, (char *)&sblock);
|
sbsize, (char *)&sblock);
|
||||||
|
wtfsflush();
|
||||||
/*
|
/*
|
||||||
* Update information about this partion in pack
|
* Update information about this partion in pack
|
||||||
* label, to that it may be updated on disk.
|
* label, to that it may be updated on disk.
|
||||||
@ -1309,6 +1311,7 @@ rdfs(bno, size, bf)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
wtfsflush();
|
||||||
if (mfs) {
|
if (mfs) {
|
||||||
memmove(bf, membase + bno * sectorsize, size);
|
memmove(bf, membase + bno * sectorsize, size);
|
||||||
return;
|
return;
|
||||||
@ -1329,6 +1332,27 @@ daddr_t wc_sect; /* units of sectorsize */
|
|||||||
int wc_end; /* bytes */
|
int wc_end; /* bytes */
|
||||||
static char wc[WCSIZE]; /* bytes */
|
static char wc[WCSIZE]; /* bytes */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Flush dirty write behind buffer.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
wtfsflush()
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
if (wc_end) {
|
||||||
|
if (lseek(fso, (off_t)wc_sect * sectorsize, SEEK_SET) < 0) {
|
||||||
|
printf("seek error: %ld\n", (long)wc_sect);
|
||||||
|
err(35, "wtfs - writecombine");
|
||||||
|
}
|
||||||
|
n = write(fso, wc, wc_end);
|
||||||
|
if (n != wc_end) {
|
||||||
|
printf("write error: %ld\n", (long)wc_sect);
|
||||||
|
err(36, "wtfs - writecombine");
|
||||||
|
}
|
||||||
|
wc_end = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* write a block to the file system
|
* write a block to the file system
|
||||||
*/
|
*/
|
||||||
@ -1364,18 +1388,7 @@ wtfs(bno, size, bf)
|
|||||||
return;
|
return;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
if (wc_end) {
|
wtfsflush();
|
||||||
if (lseek(fso, (off_t)wc_sect * sectorsize, SEEK_SET) < 0) {
|
|
||||||
printf("seek error: %ld\n", (long)wc_sect);
|
|
||||||
err(35, "wtfs - writecombine");
|
|
||||||
}
|
|
||||||
n = write(fso, wc, wc_end);
|
|
||||||
if (n != wc_end) {
|
|
||||||
printf("write error: %ld\n", (long)wc_sect);
|
|
||||||
err(36, "wtfs - writecombine");
|
|
||||||
}
|
|
||||||
wc_end = 0;
|
|
||||||
}
|
|
||||||
if (done)
|
if (done)
|
||||||
return;
|
return;
|
||||||
if (lseek(fso, (off_t)bno * sectorsize, SEEK_SET) < 0) {
|
if (lseek(fso, (off_t)bno * sectorsize, SEEK_SET) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user