UFSSwapDir.cc
Go to the documentation of this file.
259 currentIOOptions->options.push_back(new ConfigOptionAdapter<UFSSwapDir>(*const_cast<UFSSwapDir *>(this), &UFSSwapDir::optionIOParse, &UFSSwapDir::optionIODump));
462 debugs(47, warnLevel, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path);
546 Fs::Ufs::UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STIOCB * const aCallback, void * const callback_data)
552 Fs::Ufs::UFSSwapDir::openStoreIO(StoreEntry &e, StoreIOState::STIOCB * const aCallback, void * const callback_data)
827 eventAdd("storeRebuild", Fs::Ufs::RebuildState::RebuildStep, new Fs::Ufs::RebuildState(this), 0.0, 1);
842 fatalf("Failed to rename log file " SQUIDSBUFPH " to " SQUIDSBUFPH, SQUIDSBUFPRINT(tmp_path), SQUIDSBUFPRINT(swaplog_path));
885 debugs(50, DBG_IMPORTANT, "ERROR: while opening swap log" << new_path << ": " << xstrerr(xerrno));
virtual const char * type() const =0
struct StatCounters::@120 swap
Definition: UFSStrategy.h:24
void optionIODump(StoreEntry *e) const
Definition: UFSSwapDir.cc:244
void replacementRemove(StoreEntry *e)
Definition: UFSSwapDir.cc:1214
Definition: DiskIOModule.h:20
size_t gapSize() const
number of bytes after the log header before the first log entry
Definition: StoreSwapLogData.cc:96
virtual bool canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const =0
check whether we can store the entry; if we can, report current load
Definition: Disk.cc:164
StoreEntry *(* Next)(RemovalPurgeWalker *walker)
Definition: RemovalPolicy.h:74
void evictCached(StoreEntry &) override
Definition: UFSSwapDir.cc:1178
bool pathIsDirectory(const char *path) const
Definition: UFSSwapDir.cc:629
SBuf logFile(char const *ext=nullptr) const
Definition: UFSSwapDir.cc:689
const StoreEntry *(* Next)(RemovalPolicyWalker *walker)
Definition: RemovalPolicy.h:62
void logEntry(const StoreEntry &e, int op) const override
Definition: UFSSwapDir.cc:1283
static bool FilenoBelongsHere(int fn, int cachedir, int level1dir, int level2dir)
Definition: UFSSwapDir.cc:1115
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
static int * UFSDirToGlobalDirMapping
Definition: UFSSwapDir.h:127
struct SquidConfig::@82 Swap
Definition: RebuildState.h:24
void write(StoreEntry const &) override
"write" an entry to the clean log file.
Definition: UFSSwapDir.cc:77
Definition: RemovalPolicy.h:55
Definition: RemovalPolicy.h:66
Definition: ConfigOption.h:57
void create() override
create system resources needed for this store to operate in the future
Definition: UFSSwapDir.cc:300
int fsStats(const char *path, int *totl_kb, int *free_kb, int *totl_in, int *free_in)
Definition: fs_io.cc:491
time_t getCurrentTime() STUB_RETVAL(0) int tvSubUsec(struct timeval
FILE * openTmpSwapLog(int *clean_flag, int *zero_flag)
Definition: UFSSwapDir.cc:858
int validFileno(sfileno filn, int flag) const
Definition: UFSSwapDir.cc:1145
bool hasDisk(const sdirno dirn=-1, const sfileno filen=-1) const
Definition: store.cc:1929
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: UFSSwapDir.cc:1256
Definition: MemBuf.h:23
bool optionIOParse(char const *option, const char *value, int reconfiguring)
Definition: UFSSwapDir.cc:217
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
Definition: UFSSwapDir.cc:115
AsHex< Integer > asHex(const Integer n)
a helper to ease AsHex object creation
Definition: IoManip.h:169
void finalizeSwapoutSuccess(const StoreEntry &) override
finalize the successful swapout that has been already noticed by Store
Definition: UFSSwapDir.cc:1268
ConfigOption * getOptionTree() const override
Definition: UFSSwapDir.cc:250
Definition: Disk.h:130
int reconfiguring
StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
Definition: UFSSwapDir.cc:552
void evictIfFound(const cache_key *) override
Definition: UFSSwapDir.cc:1200
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings)
Definition: store.cc:1671
void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: UFSSwapDir.cc:414
const StoreEntry * nextEntry() override
Get the next entry that is a candidate for clean log writing.
Definition: UFSSwapDir.cc:66
bool unlinkdUseful() const override
whether SwapDir may benefit from unlinkd
Definition: UFSSwapDir.cc:1171
int createDirectory(const char *path, int)
Definition: UFSSwapDir.cc:604
Definition: StoreSwapLogData.h:82
void reference(StoreEntry &) override
somebody needs this entry (many cache replacement policies need to know)
Definition: UFSSwapDir.cc:524
bool doubleCheck(StoreEntry &) override
Definition: UFSSwapDir.cc:349
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:133
Definition: UFSSwapDir.cc:43
virtual DiskIOStrategy * createStrategy()=0
Definition: ConfigOption.h:78
Definition: StoreSwapLogData.h:176
void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)
Definition: StoreIOState.h:39
Definition: Store.h:37
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition: SBuf.h:279
struct SquidConfig::@89 Log
UFSSwapDir(char const *aType, const char *aModuleType)
Definition: UFSSwapDir.cc:307
void file_write(int fd, off_t file_offset, void const *ptr_to_buf, int len, DWCB *handle, void *handle_data, FREE *free_func)
Definition: fs_io.cc:314
Definition: FileMap.h:23
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)
Definition: UFSSwapDir.cc:788
void attachToDisk(const sdirno, const sfileno, const swap_status_t)
Definition: store.cc:1940
int n_disk_objects
Definition: DiskIOStrategy.h:19
Definition: ConfigOption.h:67
bool swappedOut() const
whether the entire entry is now on disk (possibly marked for deletion)
Definition: Store.h:135
Definition: UFSSwapDir.h:30
StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
Definition: UFSSwapDir.cc:546
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
bool dereference(StoreEntry &) override
Definition: UFSSwapDir.cc:534
void finalizeSwapoutFailure(StoreEntry &) override
abort the failed swapout that has been already noticed by Store
Definition: UFSSwapDir.cc:1275
static int HandleCleanEvent()
safely cleans a few unused files if possible
Definition: UFSSwapDir.cc:1039
sfileno swap_filen
unique ID inside a cache_dir for swapped out entries; -1 for others
Definition: Store.h:235
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products