+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#ifndef SQUID_FS_ROCK_SWAP_DIR_H
#define SQUID_FS_ROCK_SWAP_DIR_H
virtual void parse(int index, char *path);
// temporary path to the shared memory map of first slots of cached entries
- const char *inodeMapPath() const;
+ SBuf inodeMapPath() const;
// temporary path to the shared memory stack of free slots
const char *freeSlotsPath() const;
- int64_t entryLimitHigh() const { return SwapFilenMax; } ///< Core limit
- int64_t entryLimitAllowed() const;
+ int64_t entryLimitAbsolute() const { return SwapFilenMax+1; } ///< Core limit
+ int64_t entryLimitActual() const; ///< max number of possible entries in db
+ int64_t slotLimitAbsolute() const; ///< Rock store implementation limit
+ int64_t slotLimitActual() const; ///< total number of slots in this db
/// removes a slot from a list of free slots or returns false
bool useFreeSlot(Ipc::Mem::PageId &pageId);
void writeError(StoreEntry &e);
/* StoreMapCleaner API */
- virtual void noteFreeMapSlice(const sfileno fileno);
+ virtual void noteFreeMapSlice(const Ipc::StoreMapSliceId fileno);
uint64_t slotSize; ///< all db slots are of this size
void ignoreReferences(StoreEntry &e); ///< delete from repl policy scope
int64_t diskOffsetLimit() const;
- int entryLimit() const { return map->entryLimit(); }
- int entryMaxPayloadSize() const;
- int entriesNeeded(const int64_t objSize) const;
void anchorEntry(StoreEntry &e, const sfileno filen, const Ipc::StoreMapAnchor &anchor);
bool updateCollapsedWith(StoreEntry &collapsed, const Ipc::StoreMapAnchor &anchor);
protected:
/* Ipc::Mem::RegisteredRunner API */
- virtual void create(const RunnerRegistry &);
+ virtual void create();
private:
- Vector<SwapDir::DirMap::Owner *> mapOwners;
- Vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
+ std::vector<SwapDir::DirMap::Owner *> mapOwners;
+ std::vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
};
} // namespace Rock
#endif /* SQUID_FS_ROCK_SWAP_DIR_H */
+