remove special write path in deinit. (instead, attempt to avoid random I/O on shutdown)

This commit is contained in:
Sears Russell 2009-08-08 16:07:20 +00:00
parent a0f9a7bc81
commit 0f2b2ff200

View file

@ -396,6 +396,9 @@ static void bhBufDeinit() {
pthread_cond_signal(&needFree); // Wake up the writeback thread so it will exit.
pthread_join(worker, 0);
// XXX flush range should return an error number, which we would check. (Right now, it aborts...)
stasis_dirty_page_table_flush_range(stasis_runtime_dirty_page_table(), 0, 0);
struct LH_ENTRY(list) iter;
const struct LH_ENTRY(pair_t) * next;
LH_ENTRY(openlist)(cachedPages, &iter);
@ -403,7 +406,9 @@ static void bhBufDeinit() {
Page * p = next->value;
assertunlocked(p->rwlatch);
assert(0 == *pagePinCountPtr(p));
page_handle->write(page_handle, p);
readlock(p->rwlatch,0);
assert(!stasis_dirty_page_table_is_dirty(stasis_runtime_dirty_page_table(), p));
unlock(p->rwlatch);
stasis_page_cleanup(p); // normally called by writeBackOnePage()
}
LH_ENTRY(closelist)(&iter);