MemObject::~MemObject()
{
debugs(20, 3, HERE << "del MemObject " << this);
- const Ctx ctx = ctx_enter(storeId_.termedBuf()); /* XXX: need URI? */
+ const Ctx ctx = ctx_enter(urlXXX());
#if URL_CHECKSUM_DEBUG
checkUrlChecksum();
return updateCollapsedWith(collapsed, index, anchor);
}
+/// updates collapsed entry after its anchor has been located
bool
MemStore::updateCollapsedWith(StoreEntry &collapsed, const sfileno index, const Ipc::StoreMapAnchor &anchor)
{
- collapsed.swap_file_sz = anchor.basics.swap_file_sz; // XXX: make atomic
-
+ collapsed.swap_file_sz = anchor.basics.swap_file_sz;
const bool copied = copyFromShm(collapsed, index, anchor);
-
- return copied; // XXX: when do we unlock the map slot?
+ return copied;
}
/// anchors StoreEntry to an already locked map entry
*/
#include "squid.h"
-#include "CollapsedForwarding.h" /* XXX: who should broadcast and when? */
+#include "CollapsedForwarding.h"
#include "base/RunnersRegistry.h"
#include "HttpReply.h"
#include "ipc/mem/Page.h"
if (!UsingSmp() || !Config.onoff.collapsed_forwarding)
return 0; // no SMP collapsed forwarding possible or needed
- return 16*1024; // XXX: make configurable
+ return 16*1024; // TODO: make configurable?
}
/// initializes shared memory segment used by Transients
#include "MemObject.h"
#include "Mem.h"
#include "Parsing.h"
+#include "Transients.h"
Rock::IoState::IoState(Rock::SwapDir::Pointer &aDir,
StoreEntry *anEntry,
while (coreOff >= objOffset + currentReadableSlice().size) {
objOffset += currentReadableSlice().size;
sidCurrent = currentReadableSlice().next;
- assert(sidCurrent >= 0); // XXX: handle "read offset too big" error
+ assert(sidCurrent >= 0); // TODO: handle "read offset too big" error
}
offset_ = coreOff;
const SlotId sidNext = reserveSlotForWriting(); // throws
assert(sidNext >= 0);
writeToDisk(sidNext);
- } else if (Config.onoff.collapsed_forwarding) {
- // write partial buffer for all collapsed hit readers to see
- // XXX: can we check that this is needed w/o stalling readers
- // that appear right after our check?
+ } else if (Store::Root().transientReaders(*e)) {
+ // write partial buffer for all remote hit readers to see
writeBufToDisk(-1);
}
}
sidCurrent = sidNext;
}
-/// Write header-less (XXX) or complete buffer to disk.
+/// Write header-less (ugh) or complete buffer to disk.
void
Rock::IoState::writeBufToDisk(const SlotId sidNext)
{
return false;
const uint64_t knownSize = header.entrySize > 0 ?
- header.entrySize : anchor.basics.swap_file_sz;
+ header.entrySize : anchor.basics.swap_file_sz.get();
if (!loadedE.swap_file_sz && knownSize)
loadedE.swap_file_sz = knownSize;
// the entry size may still be unknown at this time
bool
Rock::SwapDir::updateCollapsedWith(StoreEntry &collapsed, const Ipc::StoreMapAnchor &anchor)
{
- collapsed.swap_file_sz = anchor.basics.swap_file_sz; // XXX: make atomic
+ collapsed.swap_file_sz = anchor.basics.swap_file_sz;
return true;
}
SwapDir::DirMap::Init(sd->inodeMapPath(), capacity);
mapOwners.push_back(mapOwner);
- // XXX: remove pool id and counters from PageStack
+ // TODO: somehow remove pool id and counters from PageStack?
Ipc::Mem::Owner<Ipc::Mem::PageStack> *const freeSlotsOwner =
shm_new(Ipc::Mem::PageStack)(sd->freeSlotsPath(),
i+1, capacity,
sizeof(DbCellHeader));
freeSlotsOwners.push_back(freeSlotsOwner);
- // XXX: add method to initialize PageStack with no free pages
+ // TODO: add method to initialize PageStack with no free pages
while (true) {
Ipc::Mem::PageId pageId;
if (!freeSlotsOwner->object()->pop(pageId))
return shared->count;
}
-bool
-Ipc::StoreMap::full() const
-{
- return entryCount() >= entryLimit();
-}
-
void
Ipc::StoreMap::updateStats(ReadWriteLockStats &stats) const
{
time_t lastref;
time_t expires;
time_t lastmod;
- uint64_t swap_file_sz; // [app]; XXX: make atomic
+ Atomic::WordT<uint64_t> swap_file_sz; // [app]
uint16_t refcount;
uint16_t flags;
} basics;
- /// where the chain of StoreEntry slices begins [app]; XXX: make atomic
- StoreMapSliceId start;
+ /// where the chain of StoreEntry slices begins [app]
+ Atomic::WordT<StoreMapSliceId> start;
#if 0
/// possible persistent states
/// copies slice to its designated position
void importSlice(const SliceId sliceId, const Slice &slice);
- bool full() const; ///< there are no empty slices left; XXX: remove as unused?
bool valid(const int n) const; ///< whether n is a valid slice coordinate
int entryCount() const; ///< number of writeable and readable entries
int entryLimit() const; ///< maximum entryCount() possible