From c03c2bade2631aa8548db2b1aab1d9bd9667bdf5 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 1 Feb 2011 13:18:27 -0700 Subject: [PATCH] Use Blocking DiskIO module when runnining in a no-daemon mode. We cannot use IpcIo module in no-daemon mode because there are no diskers to communicate with. If our implementation is correct, IpcIo module should contain no shared map or other rock-specific manipulations and, hence, should not be required for Rock Store to work. --- configure.ac | 5 +++-- src/fs/rock/RockSwapDir.cc | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 79682c3c60..584ba3655c 100644 --- a/configure.ac +++ b/configure.ac @@ -728,8 +728,9 @@ for fs in $squid_storeio_module_candidates none; do STORE_TESTS="$STORE_TESTS tests/testCoss$EXEEXT" ;; rock) - if ! test "x$squid_disk_module_candidates_IpcIo" = "xyes"; then - AC_MSG_ERROR([Storage modeule Rock requires IpcIo DiskIO module]) + if ! test "x$squid_disk_module_candidates_IpcIo" = "xyes" -a \ + "x$squid_disk_module_candidates_Blocking" = "xyes"; then + AC_MSG_ERROR([Storage module Rock requires IpcIo and Blocking DiskIO modules]) fi STORE_TESTS="$STORE_TESTS tests/testRock$EXEEXT" ;; diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index ac6eac00ad..d9a1ccb575 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -173,10 +173,15 @@ Rock::SwapDir::init() map = new DirMap(path, eAllowed); } - DiskIOModule *m = DiskIOModule::Find("IpcIo"); // TODO: configurable? - assert(m); - io = m->createStrategy(); - io->init(); + const char *ioModule = UsingSmp() ? "IpcIo" : "Blocking"; + if (DiskIOModule *m = DiskIOModule::Find(ioModule)) { + debugs(47,2, HERE << "Using DiskIO module: " << ioModule); + io = m->createStrategy(); + io->init(); + } else { + debugs(47,1, "Rock store is missing DiskIO module: " << ioModule); + fatal("Rock Store missing a required DiskIO module"); + } theFile = io->newFile(filePath); theFile->open(O_RDWR, 0644, this); -- 2.47.2