[PATCH] Bug 3150: do not start useless unlinkd.

From: Dmitry Kurochkin <dmitry.kurochkin_at_measurement-factory.com>
Date: Sat, 8 Oct 2011 01:20:22 +0400

Unlinkd may be used only by UFS storage. But before the change, Squid
always started unlinkd if it is built, even if it is not needed.

Whether a SwapDir may use unlinkd depends on the SwapDir
implementation and DiskIO strategy it uses. The patch adds
unlinkdUseful() method to SwapDir and DiskIOStrategy to decide if
unlinkd should be started.

After the change, unlinkdClose() may be called when unlinkd was never
started. The patch removes a warning which was printed in this case
on Windows.

---
 src/DiskIO/AIO/AIODiskIOStrategy.cc             |    6 ++++++
 src/DiskIO/AIO/AIODiskIOStrategy.h              |    2 ++
 src/DiskIO/Blocking/BlockingIOStrategy.cc       |    6 ++++++
 src/DiskIO/Blocking/BlockingIOStrategy.h        |    1 +
 src/DiskIO/DiskDaemon/DiskdIOStrategy.cc        |    6 ++++++
 src/DiskIO/DiskDaemon/DiskdIOStrategy.h         |    1 +
 src/DiskIO/DiskIOStrategy.h                     |    5 +++++
 src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc |    6 ++++++
 src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h  |    1 +
 src/DiskIO/IpcIo/IpcIoIOStrategy.cc             |    6 ++++++
 src/DiskIO/IpcIo/IpcIoIOStrategy.h              |    1 +
 src/DiskIO/Mmapped/MmappedIOStrategy.cc         |    6 ++++++
 src/DiskIO/Mmapped/MmappedIOStrategy.h          |    1 +
 src/SwapDir.h                                   |    2 ++
 src/fs/coss/CossSwapDir.h                       |    1 +
 src/fs/coss/store_io_coss.cc                    |    7 +++++++
 src/fs/rock/RockSwapDir.cc                      |    7 +++++++
 src/fs/rock/RockSwapDir.h                       |    1 +
 src/fs/ufs/store_dir_ufs.cc                     |    7 +++++++
 src/fs/ufs/ufscommon.h                          |    1 +
 src/main.cc                                     |    3 ++-
 src/protos.h                                    |    1 +
 src/tests/TestSwapDir.cc                        |    6 ++++++
 src/tests/TestSwapDir.h                         |    1 +
 src/unlinkd.cc                                  |   17 +++++++++++++++--
 25 files changed, 99 insertions(+), 3 deletions(-)

Received on Fri Oct 07 2011 - 21:20:38 MDT

This archive was generated by hypermail 2.2.0 : Sat Oct 08 2011 - 12:00:03 MDT