From: Dmitry Kurochkin Date: Tue, 1 Feb 2011 07:14:17 +0000 (+0300) Subject: Shared Rock::DirMap version 9. X-Git-Tag: take01~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8abe11734b8d1f369a59c222fd1b07c6bcee79b7;p=thirdparty%2Fsquid.git Shared Rock::DirMap version 9. --- diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index e1779c917c..0267721142 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -41,6 +41,9 @@ Rock::SwapDir::search(String const url, HttpRequest *) StoreEntry * Rock::SwapDir::get(const cache_key *key) { + if (!map) + return NULL; + sfileno fileno; const StoreEntryBasics *const basics = map->openForReading(key, fileno); if (!basics) @@ -319,6 +322,12 @@ Rock::SwapDir::canStore(const StoreEntry &e) const if (EBIT_TEST(e.flags, ENTRY_SPECIAL)) return -1; + if (!theFile || !theFile->canRead() || !theFile->canWrite()) + return -1; + + if (!map) + return -1; + if (io->shedLoad()) return -1; @@ -509,6 +518,9 @@ Rock::SwapDir::diskFull() { void Rock::SwapDir::maintain() { + if (!map) + return; + debugs(47,3, HERE << "cache_dir[" << index << "] guards: " << StoreController::store_dirs_rebuilding << !repl << !full());