#include <UFSSwapDir.h>

Inheritance diagram for Fs::Ufs::UFSSwapDir:
Collaboration diagram for Fs::Ufs::UFSSwapDir:

Public Types

typedef RefCount< DiskPointer
 

Public Member Functions

 UFSSwapDir (char const *aType, const char *aModuleType)
 
 ~UFSSwapDir () override
 
void create () override
 create system resources needed for this store to operate in the future More...
 
void init () override
 
void dump (StoreEntry &) const override
 
bool doubleCheck (StoreEntry &) override
 
bool unlinkdUseful () const override
 whether SwapDir may benefit from unlinkd More...
 
void statfs (StoreEntry &) const override
 
void maintain () override
 perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More...
 
void evictCached (StoreEntry &) override
 
void evictIfFound (const cache_key *) override
 
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 More...
 
void reference (StoreEntry &) override
 somebody needs this entry (many cache replacement policies need to know) More...
 
bool dereference (StoreEntry &) override
 
StoreIOState::Pointer createStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override
 
StoreIOState::Pointer openStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override
 
void openLog () override
 
void closeLog () override
 
int writeCleanStart () override
 
void writeCleanDone () override
 
void logEntry (const StoreEntry &e, int op) const override
 
void parse (int index, char *path) override
 
void reconfigure () override
 
int callback () override
 called once every main loop iteration; TODO: Move to UFS code. More...
 
void sync () override
 prepare for shutdown More...
 
void finalizeSwapoutSuccess (const StoreEntry &) override
 finalize the successful swapout that has been already noticed by Store More...
 
void finalizeSwapoutFailure (StoreEntry &) override
 abort the failed swapout that has been already noticed by Store More...
 
uint64_t currentSize () const override
 current size More...
 
uint64_t currentCount () const override
 the total number of objects stored right now More...
 
ConfigOptiongetOptionTree () const override
 
bool smpAware () const override
 whether this disk storage is capable of serving multiple workers More...
 
bool hasReadableEntry (const StoreEntry &) const override
 
void unlinkFile (sfileno f)
 
char * fullPath (sfileno, char *) const
 
void closeTmpSwapLog ()
 
FILE * openTmpSwapLog (int *clean_flag, int *zero_flag)
 
char * swapSubDir (int subdirn) const
 
int mapBitTest (sfileno filn)
 
void mapBitReset (sfileno filn)
 
void mapBitSet (sfileno filn)
 
StoreEntryaddDiskRestore (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)
 
int validFileno (sfileno filn, int flag) const
 
int mapBitAllocate ()
 
bool validL2 (int) const
 
bool validL1 (int) const
 
void replacementAdd (StoreEntry *e)
 
void replacementRemove (StoreEntry *e)
 
char const * type () const
 
virtual bool needsDiskStrand () const
 needs a dedicated kid process More...
 
virtual bool active () const
 
virtual bool doReportStat () const
 whether stat should be reported by this SwapDir More...
 
virtual void diskFull ()
 
StoreEntryget (const cache_key *) override
 
uint64_t maxSize () const override
 
uint64_t minSize () const override
 the minimum size the store will shrink to via normal housekeeping More...
 
int64_t maxObjectSize () const override
 the maximum size of a storable object; -1 if unlimited More...
 
void maxObjectSize (int64_t newMax)
 
void getStats (StoreInfoStats &stats) const override
 collect statistics More...
 
void stat (StoreEntry &) const override
 
int64_t minObjectSize () const
 the size of the smallest entry this cache_dir can store More...
 
bool objectSizeIsAcceptable (int64_t objSize) const
 
virtual void disconnect (StoreEntry &)
 called when the entry is about to forget its association with cache_dir More...
 
bool canLog (StoreEntry const &e) const
 
virtual void updateHeaders (StoreEntry *)
 make stored metadata and HTTP headers the same as in the given entry More...
 
virtual bool anchorToCache (StoreEntry &)
 
virtual bool updateAnchored (StoreEntry &)
 

Static Public Member Functions

static bool IsUFSDir (SwapDir *sd)
 
static int DirClean (int swap_index)
 
static bool FilenoBelongsHere (int fn, int cachedir, int level1dir, int level2dir)
 

Public Attributes

Fs::Ufs::UFSStrategyIO
 
void * fsdata
 
char * path
 
int index
 
int disker
 disker kid id dedicated to this SwapDir or -1 More...
 
RemovalPolicyrepl
 
int removals
 
int scanned
 
struct Store::Disk::Flags flags
 
CleanLogcleanLog
 
struct {
   int   blksize
 
fs
 

Protected Member Functions

void parseOptions (int reconfiguring)
 
void dumpOptions (StoreEntry *e) const
 
virtual bool allowOptionReconfigure (const char *const) const
 
int64_t sizeInBlocks (const int64_t size) const
 

Protected Attributes

FileMapmap
 
int suggest
 
int l1
 
int l2
 
uint64_t max_size
 maximum allocatable size of the storage area More...
 
int64_t min_objsize
 minimum size of any object stored here (-1 for no limit) More...
 
int64_t max_objsize
 maximum size of any object stored here (-1 for no limit) More...
 

Private Member Functions

void parseSizeL1L2 ()
 
bool pathIsDirectory (const char *path) const
 
bool verifyCacheDirs ()
 
void rebuild ()
 
int createDirectory (const char *path, int)
 
void createSwapSubDirs ()
 
void dumpEntry (StoreEntry &) const
 
SBuf logFile (char const *ext=nullptr) const
 
void changeIO (DiskIOModule *)
 
bool optionIOParse (char const *option, const char *value, int reconfiguring)
 
void optionIODump (StoreEntry *e) const
 
bool optionReadOnlyParse (char const *option, const char *value, int reconfiguring)
 
void optionReadOnlyDump (StoreEntry *e) const
 
bool optionObjectSizeParse (char const *option, const char *value, int reconfiguring)
 
void optionObjectSizeDump (StoreEntry *e) const
 

Static Private Member Functions

static int HandleCleanEvent ()
 safely cleans a few unused files if possible More...
 

Private Attributes

int swaplog_fd
 
ConfigOptionVectorcurrentIOOptions
 
char const * ioType
 
uint64_t cur_size
 currently used space in the storage area More...
 
uint64_t n_disk_objects
 total number of objects stored More...
 
bool rebuilding_
 whether RebuildState is writing the new swap.state More...
 
char const * theType
 

Static Private Attributes

static int NumberOfUFSDirs = 0
 
static intUFSDirToGlobalDirMapping = nullptr
 
static EVH CleanEvent
 

Detailed Description

Definition at line 30 of file UFSSwapDir.h.

Member Typedef Documentation

◆ Pointer

typedef RefCount<Disk> Store::Disk::Pointer
inherited

Definition at line 25 of file Disk.h.

Constructor & Destructor Documentation

◆ UFSSwapDir()

Fs::Ufs::UFSSwapDir::UFSSwapDir ( char const *  aType,
const char *  aModuleType 
)

Definition at line 306 of file UFSSwapDir.cc.

References DiskIOModule::Find(), and IO.

◆ ~UFSSwapDir()

Fs::Ufs::UFSSwapDir::~UFSSwapDir ( )
override

Definition at line 327 of file UFSSwapDir.cc.

References file_close(), and xfree.

Member Function Documentation

◆ active()

bool Store::Disk::active ( ) const
virtualinherited

may be used in this strand

Definition at line 236 of file Disk.cc.

References IamWorkerProcess(), and KidIdentifier.

Referenced by Store::Disks::anchorToCache(), and Store::Disk::doReportStat().

◆ addDiskRestore()

StoreEntry * Fs::Ufs::UFSSwapDir::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 
)

◆ allowOptionReconfigure()

virtual bool Store::Disk::allowOptionReconfigure ( const char * const  ) const
inlineprotectedvirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 85 of file Disk.h.

Referenced by Rock::SwapDir::allowOptionReconfigure().

◆ anchorToCache()

virtual bool Store::Controlled::anchorToCache ( StoreEntry )
inlinevirtualinherited

tie StoreEntry to this storage if this storage has a matching entry

Return values
trueif this storage has a matching entry

Reimplemented in Rock::SwapDir, MemStore, and Store::Disks.

Definition at line 39 of file Controlled.h.

Referenced by Store::Disks::anchorToCache().

◆ callback()

int Fs::Ufs::UFSSwapDir::callback ( )
overridevirtual

Reimplemented from Store::Storage.

Definition at line 1257 of file UFSSwapDir.cc.

◆ canLog()

bool Store::Disk::canLog ( StoreEntry const &  e) const
inherited

◆ canStore()

bool Fs::Ufs::UFSSwapDir::canStore ( const StoreEntry e,
int64_t  diskSpaceNeeded,
int load 
) const
overridevirtual

◆ changeIO()

void Fs::Ufs::UFSSwapDir::changeIO ( DiskIOModule module)
private

◆ closeLog()

void Fs::Ufs::UFSSwapDir::closeLog ( )
overridevirtual

Reimplemented from Store::Disk.

Definition at line 754 of file UFSSwapDir.cc.

References assert, debugs, file_close(), and safe_free.

◆ closeTmpSwapLog()

void Fs::Ufs::UFSSwapDir::closeTmpSwapLog ( )

◆ create()

void Fs::Ufs::UFSSwapDir::create ( )
overridevirtual

Implements Store::Storage.

Definition at line 299 of file UFSSwapDir.cc.

References debugs.

Referenced by TestUfs::testUfsSearch().

◆ createDirectory()

int Fs::Ufs::UFSSwapDir::createDirectory ( const char *  path,
int  should_exist 
)
private

Definition at line 603 of file UFSSwapDir.cc.

References DBG_IMPORTANT, debugs, fatalf(), getCurrentTime(), and xstrerr().

◆ createStoreIO()

StoreIOState::Pointer Fs::Ufs::UFSSwapDir::createStoreIO ( StoreEntry e,
StoreIOState::STIOCB aCallback,
void *  callback_data 
)
overridevirtual

Implements Store::Disk.

Definition at line 545 of file UFSSwapDir.cc.

◆ createSwapSubDirs()

void Fs::Ufs::UFSSwapDir::createSwapSubDirs ( )
private

Definition at line 664 of file UFSSwapDir.cc.

References DBG_IMPORTANT, debugs, LOCAL_ARRAY, and MAXPATHLEN.

◆ currentCount()

uint64_t Fs::Ufs::UFSSwapDir::currentCount ( ) const
inlineoverridevirtual

Implements Store::Storage.

Definition at line 73 of file UFSSwapDir.h.

References n_disk_objects.

◆ currentSize()

uint64_t Fs::Ufs::UFSSwapDir::currentSize ( ) const
inlineoverridevirtual

Implements Store::Storage.

Definition at line 72 of file UFSSwapDir.h.

References cur_size.

◆ dereference()

bool Fs::Ufs::UFSSwapDir::dereference ( StoreEntry e)
overridevirtual

somebody no longer needs this entry (usually after calling reference()) return false iff the idle entry should be destroyed

Implements Store::Controlled.

Definition at line 533 of file UFSSwapDir.cc.

References debugs, StoreEntry::repl, StoreEntry::swap_dirn, and StoreEntry::swap_filen.

◆ DirClean()

◆ disconnect()

virtual void Store::Disk::disconnect ( StoreEntry )
inlinevirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 71 of file Disk.h.

Referenced by destroyStoreEntry().

◆ diskFull()

void Store::Disk::diskFull ( )
virtualinherited

Notify this disk that it is full. XXX move into a protected api call between store files and their stores, rather than a top level api call

Reimplemented in Rock::SwapDir.

Definition at line 145 of file Disk.cc.

References DBG_IMPORTANT, and debugs.

Referenced by storeSwapOutFileClosed().

◆ doReportStat()

virtual bool Store::Disk::doReportStat ( ) const
inlinevirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 35 of file Disk.h.

References Store::Disk::active().

◆ doubleCheck()

bool Fs::Ufs::UFSSwapDir::doubleCheck ( StoreEntry e)
overridevirtual

Reimplemented from Store::Disk.

Definition at line 348 of file UFSSwapDir.cc.

References DBG_CRITICAL, debugs, sb, StoreEntry::swap_file_sz, and StoreEntry::swap_filen.

◆ dump()

void Fs::Ufs::UFSSwapDir::dump ( StoreEntry entry) const
overridevirtual

Reimplemented from Store::Disk.

Definition at line 1229 of file UFSSwapDir.cc.

References PRIu64, and storeAppendPrintf().

◆ dumpEntry()

void Fs::Ufs::UFSSwapDir::dumpEntry ( StoreEntry e) const
private

Definition at line 340 of file UFSSwapDir.cc.

References DBG_CRITICAL, debugs, StoreEntry::dump(), and StoreEntry::swap_filen.

◆ dumpOptions()

void Store::Disk::dumpOptions ( StoreEntry e) const
protectedinherited

Definition at line 307 of file Disk.cc.

References ConfigOption::dump().

◆ evictCached()

void Fs::Ufs::UFSSwapDir::evictCached ( StoreEntry e)
overridevirtual

Prevent new get() calls from returning the matching entry. If the matching entry is unused, it may be removed from the store now. The store entry is matched using either e attachment info or e.key.

Implements Store::Storage.

Definition at line 1179 of file UFSSwapDir.cc.

References debugs, StoreEntry::detachFromDisk(), StoreEntry::hasDisk(), StoreEntry::locked(), n_disk_objects, StoreEntry::swap_file_sz, StoreEntry::swap_filen, StoreEntry::swappedOut(), and unlinkFile().

◆ evictIfFound()

void Fs::Ufs::UFSSwapDir::evictIfFound ( const cache_key )
overridevirtual

An evictCached() equivalent for callers that did not get() a StoreEntry. Callers with StoreEntry objects must use evictCached() instead.

Implements Store::Storage.

Definition at line 1201 of file UFSSwapDir.cc.

◆ FilenoBelongsHere()

bool Fs::Ufs::UFSSwapDir::FilenoBelongsHere ( int  fn,
int  cachedir,
int  level1dir,
int  level2dir 
)
static

check whether swapfile belongs to the specified cachedir/l1dir/l2dir

Parameters
cachedirthe number of the cachedir which is being tested
level1dirlevel-1 dir in the cachedir
level2dirlevel-2 dir

Definition at line 1115 of file UFSSwapDir.cc.

References assert, SquidConfig::cacheSwap, Config, F1, F2, INDEXSD, IsUFSDir(), l1, l2, and Store::DiskConfig::n_configured.

Referenced by DirClean(), and Fs::Ufs::RebuildState::getNextFile().

◆ finalizeSwapoutFailure()

void Fs::Ufs::UFSSwapDir::finalizeSwapoutFailure ( StoreEntry )
overridevirtual

Implements Store::Disk.

Definition at line 1276 of file UFSSwapDir.cc.

References debugs.

◆ finalizeSwapoutSuccess()

void Fs::Ufs::UFSSwapDir::finalizeSwapoutSuccess ( const StoreEntry )
overridevirtual

Implements Store::Disk.

Definition at line 1269 of file UFSSwapDir.cc.

References n_disk_objects, and StoreEntry::swap_file_sz.

◆ fullPath()

char * Fs::Ufs::UFSSwapDir::fullPath ( sfileno  filn,
char *  fullpath 
) const

Definition at line 1236 of file UFSSwapDir.cc.

References LOCAL_ARRAY, and MAXPATHLEN.

◆ get()

StoreEntry * Store::Disk::get ( const cache_key )
overridevirtualinherited
Returns
a possibly unlocked/unregistered stored entry with key (or nil) The returned entry might not match the caller's Store ID or method. The caller must abandon()/release() the entry or register it with Root(). This method must not trigger slow I/O operations (e.g., disk swap in).

Implements Store::Controlled.

Definition at line 393 of file Disk.cc.

◆ getOptionTree()

ConfigOption * Fs::Ufs::UFSSwapDir::getOptionTree ( ) const
overridevirtual

Reimplemented from Store::Disk.

Definition at line 249 of file UFSSwapDir.cc.

References Store::Disk::getOptionTree(), optionIODump(), and optionIOParse().

◆ getStats()

void Store::Disk::getStats ( StoreInfoStats stats) const
overridevirtualinherited

Implements Store::Storage.

Definition at line 52 of file Disk.cc.

References Ping::stats.

◆ HandleCleanEvent()

int Fs::Ufs::UFSSwapDir::HandleCleanEvent ( )
staticprivate

◆ hasReadableEntry()

bool Fs::Ufs::UFSSwapDir::hasReadableEntry ( const StoreEntry ) const
inlineoverridevirtual

as long as ufs relies on the global store_table to index entries, it is wrong to ask individual ufs cache_dirs whether they have an entry

Implements Store::Disk.

Definition at line 78 of file UFSSwapDir.h.

◆ init()

void Fs::Ufs::UFSSwapDir::init ( )
overridevirtual

Start preparing the store for use. To check readiness, callers should use readable() and writable() methods.

Implements Store::Storage.

Definition at line 271 of file UFSSwapDir.cc.

References debugs, eventAdd(), fatal(), and fsBlockSize().

◆ IsUFSDir()

bool Fs::Ufs::UFSSwapDir::IsUFSDir ( SwapDir sd)
static

Definition at line 1103 of file UFSSwapDir.cc.

Referenced by FilenoBelongsHere(), and HandleCleanEvent().

◆ logEntry()

◆ logFile()

SBuf Fs::Ufs::UFSSwapDir::logFile ( char const *  ext = nullptr) const
private

◆ maintain()

◆ mapBitAllocate()

int Fs::Ufs::UFSSwapDir::mapBitAllocate ( )

Definition at line 584 of file UFSSwapDir.cc.

◆ mapBitReset()

void Fs::Ufs::UFSSwapDir::mapBitReset ( sfileno  filn)

Definition at line 569 of file UFSSwapDir.cc.

◆ mapBitSet()

void Fs::Ufs::UFSSwapDir::mapBitSet ( sfileno  filn)

Definition at line 563 of file UFSSwapDir.cc.

◆ mapBitTest()

int Fs::Ufs::UFSSwapDir::mapBitTest ( sfileno  filn)

Definition at line 557 of file UFSSwapDir.cc.

Referenced by DirClean().

◆ maxObjectSize() [1/2]

int64_t Store::Disk::maxObjectSize ( ) const
overridevirtualinherited

Implements Store::Storage.

Definition at line 103 of file Disk.cc.

References Config, SquidConfig::maxObjectSize, min(), and SquidConfig::Store.

Referenced by Fs::Ufs::UFSStoreState::write().

◆ maxObjectSize() [2/2]

void Store::Disk::maxObjectSize ( int64_t  newMax)
inherited

configure the maximum object size for this storage area. May be any size up to the total storage area.

Definition at line 115 of file Disk.cc.

References DBG_PARSE_NOTE, and debugs.

◆ maxSize()

uint64_t Store::Disk::maxSize ( ) const
inlineoverridevirtualinherited

The maximum size the store will support in normal use. Inaccuracy is permitted, but may throw estimates for memory etc out of whack.

Implements Store::Storage.

Reimplemented in TestSwapDir.

Definition at line 48 of file Disk.h.

References Store::Disk::max_size.

◆ minObjectSize()

int64_t Store::Disk::minObjectSize ( ) const
inherited

Definition at line 96 of file Disk.cc.

References Config, SquidConfig::minObjectSize, and SquidConfig::Store.

◆ minSize()

uint64_t Store::Disk::minSize ( ) const
overridevirtualinherited

Implements Store::Storage.

Definition at line 89 of file Disk.cc.

References Config, SquidConfig::lowWaterMark, and SquidConfig::Swap.

◆ needsDiskStrand()

bool Store::Disk::needsDiskStrand ( ) const
virtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 249 of file Disk.cc.

◆ objectSizeIsAcceptable()

bool Store::Disk::objectSizeIsAcceptable ( int64_t  objSize) const
inherited

whether we can store an object of the given size negative objSize means the object size is currently unknown

Definition at line 156 of file Disk.cc.

References assert.

◆ openLog()

void Fs::Ufs::UFSSwapDir::openLog ( )
overridevirtual

◆ openStoreIO()

StoreIOState::Pointer Fs::Ufs::UFSSwapDir::openStoreIO ( StoreEntry e,
StoreIOState::STIOCB aCallback,
void *  callback_data 
)
overridevirtual

Implements Store::Disk.

Definition at line 551 of file UFSSwapDir.cc.

◆ openTmpSwapLog()

◆ optionIODump()

void Fs::Ufs::UFSSwapDir::optionIODump ( StoreEntry e) const
private

Definition at line 243 of file UFSSwapDir.cc.

References storeAppendPrintf().

Referenced by getOptionTree().

◆ optionIOParse()

bool Fs::Ufs::UFSSwapDir::optionIOParse ( char const *  option,
const char *  value,
int  reconfiguring 
)
private

Definition at line 216 of file UFSSwapDir.cc.

References DiskIOModule::Find(), and self_destruct().

Referenced by getOptionTree().

◆ optionObjectSizeDump()

void Store::Disk::optionObjectSizeDump ( StoreEntry e) const
privateinherited

Definition at line 382 of file Disk.cc.

References PRId64, and storeAppendPrintf().

Referenced by Store::Disk::getOptionTree().

◆ optionObjectSizeParse()

bool Store::Disk::optionObjectSizeParse ( char const *  option,
const char *  value,
int  reconfiguring 
)
privateinherited

Definition at line 347 of file Disk.cc.

References DBG_IMPORTANT, debugs, self_destruct(), size, and strtoll().

Referenced by Store::Disk::getOptionTree().

◆ optionReadOnlyDump()

void Store::Disk::optionReadOnlyDump ( StoreEntry e) const
privateinherited

Definition at line 340 of file Disk.cc.

References storeAppendPrintf().

Referenced by Store::Disk::getOptionTree().

◆ optionReadOnlyParse()

bool Store::Disk::optionReadOnlyParse ( char const *  option,
const char *  value,
int  reconfiguring 
)
privateinherited

Definition at line 318 of file Disk.cc.

References DBG_PARSE_NOTE, debugs, and xatoi().

Referenced by Store::Disk::getOptionTree().

◆ parse()

void Fs::Ufs::UFSSwapDir::parse ( int  index,
char *  path 
)
overridevirtual

◆ parseOptions()

void Store::Disk::parseOptions ( int  reconfiguring)
protectedinherited

◆ parseSizeL1L2()

void Fs::Ufs::UFSSwapDir::parseSizeL1L2 ( )
private

Definition at line 142 of file UFSSwapDir.cc.

References DBG_IMPORTANT, debugs, fatal(), GetInteger(), reconfiguring, and size.

◆ pathIsDirectory()

bool Fs::Ufs::UFSSwapDir::pathIsDirectory ( const char *  path) const
private

Definition at line 628 of file UFSSwapDir.cc.

References DBG_CRITICAL, debugs, sb, and xstrerr().

◆ rebuild()

void Fs::Ufs::UFSSwapDir::rebuild ( )
private

Definition at line 825 of file UFSSwapDir.cc.

References eventAdd(), and Fs::Ufs::RebuildState::RebuildStep.

◆ reconfigure()

void Fs::Ufs::UFSSwapDir::reconfigure ( )
overridevirtual

Implements Store::Disk.

Definition at line 172 of file UFSSwapDir.cc.

◆ reference()

void Fs::Ufs::UFSSwapDir::reference ( StoreEntry e)
overridevirtual

Implements Store::Controlled.

Definition at line 523 of file UFSSwapDir.cc.

References debugs, StoreEntry::repl, StoreEntry::swap_dirn, and StoreEntry::swap_filen.

◆ replacementAdd()

void Fs::Ufs::UFSSwapDir::replacementAdd ( StoreEntry e)

Add and remove the given StoreEntry from the replacement policy in use

Definition at line 1208 of file UFSSwapDir.cc.

References debugs, and StoreEntry::repl.

◆ replacementRemove()

void Fs::Ufs::UFSSwapDir::replacementRemove ( StoreEntry e)

◆ sizeInBlocks()

int64_t Store::Disk::sizeInBlocks ( const int64_t  size) const
inlineprotectedinherited

Definition at line 87 of file Disk.h.

References Store::Disk::fs, and size.

◆ smpAware()

bool Fs::Ufs::UFSSwapDir::smpAware ( ) const
inlineoverridevirtual

Implements Store::Disk.

Definition at line 75 of file UFSSwapDir.h.

◆ stat()

void Store::Disk::stat ( StoreEntry e) const
overridevirtualinherited

Output stats to the provided store entry. TODO: make these calls asynchronous

Implements Store::Storage.

Reimplemented in TestSwapDir.

Definition at line 63 of file Disk.cc.

References storeAppendPrintf().

◆ statfs()

void Fs::Ufs::UFSSwapDir::statfs ( StoreEntry sentry) const
overridevirtual

Reimplemented from Store::Disk.

Definition at line 370 of file UFSSwapDir.cc.

References Math::doublePercent(), fsStats(), Math::intPercent(), PRIu64, and storeAppendPrintf().

◆ swapSubDir()

char * Fs::Ufs::UFSSwapDir::swapSubDir ( int  subdirn) const

Definition at line 594 of file UFSSwapDir.cc.

References assert, LOCAL_ARRAY, and MAXPATHLEN.

◆ sync()

void Fs::Ufs::UFSSwapDir::sync ( void  )
overridevirtual

Reimplemented from Store::Storage.

Definition at line 1263 of file UFSSwapDir.cc.

◆ type()

char const * Store::Disk::type ( ) const
inherited

Definition at line 230 of file Disk.cc.

◆ unlinkdUseful()

bool Fs::Ufs::UFSSwapDir::unlinkdUseful ( ) const
overridevirtual

Implements Store::Disk.

Definition at line 1172 of file UFSSwapDir.cc.

References IamWorkerProcess().

◆ unlinkFile()

void Fs::Ufs::UFSSwapDir::unlinkFile ( sfileno  f)

Definition at line 1162 of file UFSSwapDir.cc.

References debugs.

Referenced by evictCached().

◆ updateAnchored()

virtual bool Store::Controlled::updateAnchored ( StoreEntry )
inlinevirtualinherited

Update a local Transients entry with fresh info from this cache (if any). Return true iff the cache supports Transients entries and the given local Transients entry is now in sync with this storage.

Reimplemented in Rock::SwapDir, MemStore, and Store::Disks.

Definition at line 44 of file Controlled.h.

Referenced by Store::Disks::updateAnchored().

◆ updateHeaders()

virtual void Store::Controlled::updateHeaders ( StoreEntry )
inlinevirtualinherited

Reimplemented in Store::Disks, Rock::SwapDir, and MemStore.

Definition at line 35 of file Controlled.h.

Referenced by Store::Disks::updateHeaders().

◆ validFileno()

int Fs::Ufs::UFSSwapDir::validFileno ( sfileno  filn,
int  flag 
) const

Definition at line 1145 of file UFSSwapDir.cc.

Referenced by DirClean().

◆ validL1()

bool Fs::Ufs::UFSSwapDir::validL1 ( int  anInt) const

Definition at line 775 of file UFSSwapDir.cc.

◆ validL2()

bool Fs::Ufs::UFSSwapDir::validL2 ( int  anInt) const

Definition at line 781 of file UFSSwapDir.cc.

◆ verifyCacheDirs()

bool Fs::Ufs::UFSSwapDir::verifyCacheDirs ( )
private

Verify that the the CacheDir exists

If this returns < 0, then Squid exits, complains about swap directories not existing, and instructs the admin to run 'squid -z' Called by UFSSwapDir::init

Definition at line 648 of file UFSSwapDir.cc.

◆ writeCleanDone()

◆ writeCleanStart()

Member Data Documentation

◆ blksize

int Store::Disk::blksize
inherited

Definition at line 146 of file Disk.h.

◆ CleanEvent

void Fs::Ufs::UFSSwapDir::CleanEvent
staticprivate

Definition at line 130 of file UFSSwapDir.h.

◆ cleanLog

CleanLog* Store::Disk::cleanLog
inherited

Definition at line 140 of file Disk.h.

Referenced by UFSCleanLog::write().

◆ cur_size

uint64_t Fs::Ufs::UFSSwapDir::cur_size
private

Definition at line 149 of file UFSSwapDir.h.

Referenced by currentSize().

◆ currentIOOptions

ConfigOptionVector* Fs::Ufs::UFSSwapDir::currentIOOptions
mutableprivate

Definition at line 147 of file UFSSwapDir.h.

◆ disker

int Store::Disk::disker
inherited

Definition at line 104 of file Disk.h.

◆ flags

struct Store::Disk::Flags Store::Disk::flags
inherited

◆ 

struct { ... } Store::Disk::fs

◆ fsdata

void* Fs::Ufs::UFSSwapDir::fsdata

Definition at line 109 of file UFSSwapDir.h.

◆ index

int Store::Disk::index
inherited

Definition at line 103 of file Disk.h.

Referenced by Fs::Ufs::UFSStoreState::UFSStoreState(), and Rock::Rebuild::Start().

◆ IO

Fs::Ufs::UFSStrategy* Fs::Ufs::UFSSwapDir::IO

◆ ioType

char const* Fs::Ufs::UFSSwapDir::ioType
private

Definition at line 148 of file UFSSwapDir.h.

◆ l1

int Fs::Ufs::UFSSwapDir::l1
protected

Definition at line 121 of file UFSSwapDir.h.

Referenced by DirClean(), FilenoBelongsHere(), and HandleCleanEvent().

◆ l2

int Fs::Ufs::UFSSwapDir::l2
protected

Definition at line 122 of file UFSSwapDir.h.

Referenced by DirClean(), FilenoBelongsHere(), and HandleCleanEvent().

◆ map

FileMap* Fs::Ufs::UFSSwapDir::map
protected

Definition at line 119 of file UFSSwapDir.h.

◆ max_objsize

int64_t Store::Disk::max_objsize
protectedinherited

Definition at line 99 of file Disk.h.

◆ max_size

uint64_t Store::Disk::max_size
protectedinherited

Definition at line 97 of file Disk.h.

Referenced by Store::Disk::maxSize().

◆ min_objsize

int64_t Store::Disk::min_objsize
protectedinherited

Definition at line 98 of file Disk.h.

◆ n_disk_objects

uint64_t Fs::Ufs::UFSSwapDir::n_disk_objects
private

Definition at line 150 of file UFSSwapDir.h.

Referenced by currentCount().

◆ NumberOfUFSDirs

int Fs::Ufs::UFSSwapDir::NumberOfUFSDirs = 0
staticprivate

Definition at line 126 of file UFSSwapDir.h.

◆ path

char* Store::Disk::path
inherited

Definition at line 102 of file Disk.h.

Referenced by DirClean(), Rock::Rebuild::Stats::Init(), and Rock::Rebuild::Start().

◆ rebuilding_

bool Fs::Ufs::UFSSwapDir::rebuilding_
private

Definition at line 151 of file UFSSwapDir.h.

◆ removals

int Store::Disk::removals
inherited

Definition at line 106 of file Disk.h.

◆ repl

RemovalPolicy* Store::Disk::repl
inherited

Definition at line 105 of file Disk.h.

◆ scanned

int Store::Disk::scanned
inherited

Definition at line 107 of file Disk.h.

◆ suggest

int Fs::Ufs::UFSSwapDir::suggest
protected

Definition at line 120 of file UFSSwapDir.h.

◆ swaplog_fd

int Fs::Ufs::UFSSwapDir::swaplog_fd
private

Definition at line 129 of file UFSSwapDir.h.

◆ theType

char const* Store::Disk::theType
privateinherited

Definition at line 94 of file Disk.h.

◆ UFSDirToGlobalDirMapping

int * Fs::Ufs::UFSSwapDir::UFSDirToGlobalDirMapping = nullptr
staticprivate

Definition at line 127 of file UFSSwapDir.h.


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors