9#ifndef SQUID_SRC_FS_UFS_UFSSWAPDIR_H
10#define SQUID_SRC_FS_UFS_UFSSWAPDIR_H
41 static bool FilenoBelongsHere(
int fn,
int cachedir,
int level1dir,
int level2dir);
43 UFSSwapDir(
char const *aType,
const char *aModuleType);
75 bool smpAware()
const override {
return false; }
98 uint64_t swap_file_sz,
bool pathIsDirectory(const char *path) const
void sync() override
prepare for shutdown
ConfigOptionVector * currentIOOptions
void finalizeSwapoutFailure(StoreEntry &) override
abort the failed swapout that has been already noticed by Store
uint64_t currentCount() const override
the total number of objects stored right now
bool unlinkdUseful() const override
whether SwapDir may benefit from unlinkd
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
void replacementAdd(StoreEntry *e)
void evictIfFound(const cache_key *) override
uint64_t currentSize() const override
current size
StoreEntry * addDiskRestore(const cache_key *key, sfileno file_number, uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, time_t lastmod, uint32_t refcount, uint16_t flags, int clean)
void mapBitReset(sfileno filn)
void optionIODump(StoreEntry *e) const
int createDirectory(const char *path, int)
void changeIO(DiskIOModule *)
void reconfigure() override
void finalizeSwapoutSuccess(const StoreEntry &) override
finalize the successful swapout that has been already noticed by Store
void parse(int index, char *path) override
void statfs(StoreEntry &) const override
static int DirClean(int swap_index)
SBuf logFile(char const *ext=nullptr) const
FILE * openTmpSwapLog(int *clean_flag, int *zero_flag)
void create() override
create system resources needed for this store to operate in the future
bool hasReadableEntry(const StoreEntry &) const override
void mapBitSet(sfileno filn)
void evictCached(StoreEntry &) override
void reference(StoreEntry &) override
somebody needs this entry (many cache replacement policies need to know)
char * swapSubDir(int subdirn) const
uint64_t n_disk_objects
total number of objects stored
static int * UFSDirToGlobalDirMapping
static size_t NumberOfUFSDirs
int validFileno(sfileno filn, int flag) const
void replacementRemove(StoreEntry *e)
int mapBitTest(sfileno filn)
Fs::Ufs::UFSStrategy * IO
void dumpEntry(StoreEntry &) const
bool dereference(StoreEntry &) override
bool rebuilding_
whether RebuildState is writing the new swap.state
bool doubleCheck(StoreEntry &) override
void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
static bool IsUFSDir(SwapDir *sd)
ConfigOption * getOptionTree() const override
StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
void logEntry(const StoreEntry &e, int op) const override
void dump(StoreEntry &) const override
static bool FilenoBelongsHere(int fn, int cachedir, int level1dir, int level2dir)
char * fullPath(sfileno, char *) const
int writeCleanStart() override
static int HandleCleanEvent()
safely cleans a few unused files if possible
void unlinkFile(sfileno f)
uint64_t cur_size
currently used space in the storage area
bool smpAware() const override
whether this disk storage is capable of serving multiple workers
bool optionIOParse(char const *option, const char *value, int reconfiguring)
bool canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const override
check whether we can store the entry; if we can, report current load
void writeCleanDone() override
void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)
manages a single cache_dir
struct Store::Disk::Flags flags
unsigned char cache_key
Store key.