]> git.ipfire.org Git - thirdparty/squid.git/commit
Revised Core/Store cooperation w.r.t. SwapDir map slot locks.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 4 Feb 2011 22:18:41 +0000 (15:18 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 4 Feb 2011 22:18:41 +0000 (15:18 -0700)
commitf58bb2f4789906320d4e3bdba8bf4e32dfc1b0ff
tree877acf76a039916899eb47d9a00d3781f675a7e5
parentdb4548675106f820673bc41350fda66558f51a17
Revised Core/Store cooperation w.r.t. SwapDir map slot locks.

When StoreEntry is deleted, we need to release the SwapDir map slot locks it
holds, if any. This is difficult because SwapDir maintains the locks while
Squid Core maintains the entry swap_status. The Core gets swap_status-related
notifications using async calls so it is easy for swap_status to get out of
sync if SwapDir updates the map slot proactively.

The new code no longer releases the slot lock until the associated StoreEntry
is unlinked or gone, even if the slot is known to be unusable and waiting to
be deleted. We also do not rely on swap_status to guess which lock to release;
we use slot state to determine that instead.

Removed rock-specific code from StoreEntry destructor by introducing a general
SwapDir::disconnect(StoreEntry&) API.

Polished StoreEntry initialization.

Polished and fixed Rock::SwapDir debugging.
src/SwapDir.h
src/fs/rock/RockDirMap.cc
src/fs/rock/RockDirMap.h
src/fs/rock/RockSwapDir.cc
src/fs/rock/RockSwapDir.h
src/store.cc
src/store_swapin.cc
src/store_swapout.cc