UFSSwapDir.cc
Go to the documentation of this file.
258 currentIOOptions->options.push_back(new ConfigOptionAdapter<UFSSwapDir>(*const_cast<UFSSwapDir *>(this), &UFSSwapDir::optionIOParse, &UFSSwapDir::optionIODump));
342 debugs(47, DBG_CRITICAL, "FILENO "<< std::setfill('0') << std::hex << std::uppercase << std::setw(8) << e.swap_filen);
461 debugs(47, warnLevel, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path);
545Fs::Ufs::UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STIOCB * const aCallback, void * const callback_data)
551Fs::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));
1378 debugs(36, 3, "Cleaning file "<< std::setfill('0') << std::hex << std::uppercase << std::setw(8) << files[n]);
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings)
Definition: store.cc:1657
Definition: ConfigOption.h:79
Definition: ConfigOption.h:68
Definition: ConfigOption.h:58
Definition: DiskIOModule.h:21
virtual char const * type() const =0
virtual DiskIOStrategy * createStrategy()=0
Definition: DiskIOStrategy.h:20
Definition: FileMap.h:24
Definition: RebuildState.h:25
Definition: UFSStrategy.h:25
Definition: UFSSwapDir.h:31
bool pathIsDirectory(const char *path) const
Definition: UFSSwapDir.cc:628
void finalizeSwapoutFailure(StoreEntry &) override
abort the failed swapout that has been already noticed by Store
Definition: UFSSwapDir.cc:1276
bool unlinkdUseful() const override
whether SwapDir may benefit from unlinkd
Definition: UFSSwapDir.cc:1172
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: UFSSwapDir.cc:1257
void evictIfFound(const cache_key *) override
Definition: UFSSwapDir.cc:1201
UFSSwapDir(char const *aType, const char *aModuleType)
Definition: UFSSwapDir.cc:306
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:787
void optionIODump(StoreEntry *e) const
Definition: UFSSwapDir.cc:243
int createDirectory(const char *path, int)
Definition: UFSSwapDir.cc:603
void finalizeSwapoutSuccess(const StoreEntry &) override
finalize the successful swapout that has been already noticed by Store
Definition: UFSSwapDir.cc:1269
SBuf logFile(char const *ext=nullptr) const
Definition: UFSSwapDir.cc:688
FILE * openTmpSwapLog(int *clean_flag, int *zero_flag)
Definition: UFSSwapDir.cc:858
void create() override
create system resources needed for this store to operate in the future
Definition: UFSSwapDir.cc:299
void evictCached(StoreEntry &) override
Definition: UFSSwapDir.cc:1179
void reference(StoreEntry &) override
somebody needs this entry (many cache replacement policies need to know)
Definition: UFSSwapDir.cc:523
static int * UFSDirToGlobalDirMapping
Definition: UFSSwapDir.h:127
int validFileno(sfileno filn, int flag) const
Definition: UFSSwapDir.cc:1145
void replacementRemove(StoreEntry *e)
Definition: UFSSwapDir.cc:1215
bool dereference(StoreEntry &) override
Definition: UFSSwapDir.cc:533
bool doubleCheck(StoreEntry &) override
Definition: UFSSwapDir.cc:348
void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: UFSSwapDir.cc:413
ConfigOption * getOptionTree() const override
Definition: UFSSwapDir.cc:249
StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
Definition: UFSSwapDir.cc:545
StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
Definition: UFSSwapDir.cc:551
void logEntry(const StoreEntry &e, int op) const override
Definition: UFSSwapDir.cc:1284
static bool FilenoBelongsHere(int fn, int cachedir, int level1dir, int level2dir)
Definition: UFSSwapDir.cc:1115
static int HandleCleanEvent()
safely cleans a few unused files if possible
Definition: UFSSwapDir.cc:1039
bool optionIOParse(char const *option, const char *value, int reconfiguring)
Definition: UFSSwapDir.cc:216
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:114
Definition: MemBuf.h:24
Definition: RemovalPolicy.h:56
const StoreEntry *(* Next)(RemovalPolicyWalker *walker)
Definition: RemovalPolicy.h:62
Definition: RemovalPolicy.h:67
StoreEntry *(* Next)(RemovalPurgeWalker *walker)
Definition: RemovalPolicy.h:74
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition: SBuf.h:275
struct SquidConfig::@98 Log
struct SquidConfig::@91 Swap
struct StatCounters::@131 swap
Definition: Store.h:42
bool swappedOut() const
whether the entire entry is now on disk (possibly marked for deletion)
Definition: Store.h:136
bool hasDisk(const sdirno dirn=-1, const sfileno filen=-1) const
Definition: store.cc:1915
sfileno swap_filen
unique ID inside a cache_dir for swapped out entries; -1 for others
Definition: Store.h:236
void attachToDisk(const sdirno, const sfileno, const swap_status_t)
Definition: store.cc:1926
void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)
Definition: StoreIOState.h:39
Definition: StoreSwapLogData.h:83
Definition: StoreSwapLogData.h:177
size_t gapSize() const
number of bytes after the log header before the first log entry
Definition: StoreSwapLogData.cc:96
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:134
Definition: Disk.h:131
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
Definition: UFSSwapDir.cc:43
void write(StoreEntry const &) override
"write" an entry to the clean log file.
Definition: UFSSwapDir.cc:76
const StoreEntry * nextEntry() override
Get the next entry that is a candidate for clean log writing.
Definition: UFSSwapDir.cc:65
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
int fsStats(const char *path, int *totl_kb, int *free_kb, int *totl_in, int *free_in)
Definition: fs_io.cc:527
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:326
int n_disk_objects
int reconfiguring
time_t getCurrentTime() STUB_RETVAL(0) int tvSubUsec(struct timeval
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47