]>
Commit | Line | Data |
---|---|---|
e6ccf245 | 1 | /* |
1f7b830e | 2 | * Copyright (C) 1996-2025 The Squid Software Foundation and contributors |
e6ccf245 | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
e6ccf245 | 7 | */ |
bbc27441 | 8 | |
ff9d9458 FC |
9 | #ifndef SQUID_SRC_STORE_H |
10 | #define SQUID_SRC_STORE_H | |
e6ccf245 | 11 | |
a928fdfd | 12 | #include "base/DelayedAsyncCalls.h" |
0f33a01d | 13 | #include "base/Packable.h" |
21dfc374 | 14 | #include "base/Range.h" |
8bf217bd | 15 | #include "base/RefCount.h" |
3e4bebf8 | 16 | #include "comm/forward.h" |
c6983ec7 | 17 | #include "hash.h" |
f35c0145 | 18 | #include "http/forward.h" |
c24f7fb6 | 19 | #include "http/RequestMethod.h" |
43ca19e0 | 20 | #include "HttpReply.h" |
04ebce55 | 21 | #include "MemObject.h" |
aa839030 | 22 | #include "RemovalPolicy.h" |
2745fea5 AR |
23 | #include "store/Controller.h" |
24 | #include "store/forward.h" | |
e1ba42a4 | 25 | #include "store_key_md5.h" |
582c2af2 | 26 | #include "StoreIOBuffer.h" |
93bc1434 | 27 | #include "StoreStats.h" |
528b2c61 | 28 | |
27e059d4 | 29 | #include <ostream> |
27e059d4 | 30 | |
65517dc8 | 31 | class AsyncCall; |
582c2af2 | 32 | class HttpRequest; |
71b673d4 | 33 | class RequestFlags; |
c8f4eac4 | 34 | |
8822ebee AR |
35 | extern StoreIoStats store_io_stats; |
36 | ||
0f33a01d | 37 | class StoreEntry : public hash_link, public Packable |
62e76326 | 38 | { |
39 | ||
332dafa2 | 40 | public: |
a46d2c0e | 41 | bool checkDeferRead(int fd) const; |
62e76326 | 42 | |
69565793 | 43 | const char *getMD5Text() const; |
c8f4eac4 | 44 | StoreEntry(); |
337b9aa4 | 45 | ~StoreEntry() override; |
43ae1d95 | 46 | |
66d51f4f AR |
47 | MemObject &mem() { assert(mem_obj); return *mem_obj; } |
48 | const MemObject &mem() const { assert(mem_obj); return *mem_obj; } | |
49 | ||
50 | /// \retval * the address of freshest reply (if mem_obj exists) | |
51 | /// \retval nullptr when mem_obj does not exist | |
52 | /// \see MemObject::freshestReply() | |
53 | const HttpReply *hasFreshestReply() const { return mem_obj ? &mem_obj->freshestReply() : nullptr; } | |
54 | ||
39b5a589 AR |
55 | /// whether this entry has access to [deserialized] [HTTP] response headers |
56 | bool hasParsedReplyHeader() const; | |
57 | ||
69565793 | 58 | void write(StoreIOBuffer); |
04ebce55 | 59 | |
69565793 | 60 | /** Check if the Store entry is empty |
04ebce55 FC |
61 | * \retval true Store contains 0 bytes of data. |
62 | * \retval false Store contains 1 or more bytes of data. | |
63 | * \retval false Store contains negative content !!!!!! | |
64 | */ | |
66d51f4f | 65 | bool isEmpty() const { return mem().endOffset() == 0; } |
69565793 EB |
66 | bool isAccepting() const; |
67 | size_t bytesWanted(Range<size_t> const aRange, bool ignoreDelayPool = false) const; | |
ba3fe8d9 EB |
68 | |
69 | /// Signals that the entire response has been stored and no more append() | |
70 | /// calls should be expected; cf. completeTruncated(). | |
71 | void completeSuccessfully(const char *whyWeAreSureWeStoredTheWholeReply); | |
72 | ||
73 | /// Signals that a partial response (if any) has been stored but no more | |
74 | /// append() calls should be expected; cf. completeSuccessfully(). | |
75 | void completeTruncated(const char *whyWeConsiderTheReplyTruncated); | |
76 | ||
77 | /// \deprecated use either completeSuccessfully() or completeTruncated() instead | |
69565793 | 78 | void complete(); |
ba3fe8d9 | 79 | |
69565793 | 80 | store_client_t storeClientType() const; |
66d51f4f AR |
81 | /// \returns a malloc()ed buffer containing a length-long packed swap header |
82 | const char *getSerialisedMetaData(size_t &length) const; | |
eacfca83 AR |
83 | /// Store a prepared error response. MemObject locks the reply object. |
84 | void storeErrorResponse(HttpReply *reply); | |
66d51f4f | 85 | void replaceHttpReply(const HttpReplyPointer &, const bool andStartWriting = true); |
3756e5c0 | 86 | void startWriting(); ///< pack and write reply headers and, maybe, body |
5b55f1f1 | 87 | /// whether we may start writing to disk (now or in the future) |
69565793 EB |
88 | bool mayStartSwapOut(); |
89 | void trimMemory(const bool preserveSwappable); | |
0cdcf3d7 | 90 | |
2da4bfe6 | 91 | // called when a decision to cache in memory has been made |
0cdcf3d7 AR |
92 | void memOutDecision(const bool willCacheInRam); |
93 | // called when a decision to cache on disk has been made | |
94 | void swapOutDecision(const MemObject::SwapOut::Decision &decision); | |
24c93780 AR |
95 | /// called when a store writer ends its work (successfully or not) |
96 | void storeWriterDone(); | |
0cdcf3d7 | 97 | |
bfb55b6f | 98 | void abort(); |
4310f8b0 | 99 | bool makePublic(const KeyScope keyScope = ksDefault); |
39fe14b2 EB |
100 | void makePrivate(const bool shareable); |
101 | /// A low-level method just resetting "private key" flags. | |
102 | /// To avoid key inconsistency please use forcePublicKey() | |
103 | /// or similar instead. | |
104 | void clearPrivate(); | |
4310f8b0 | 105 | bool setPublicKey(const KeyScope keyScope = ksDefault); |
1a210de4 EB |
106 | /// Resets existing public key to a public key with default scope, |
107 | /// releasing the old default-scope entry (if any). | |
108 | /// Does nothing if the existing public key already has default scope. | |
109 | void clearPublicKeyScope(); | |
4310f8b0 EB |
110 | |
111 | /// \returns public key (if the entry has it) or nil (otherwise) | |
112 | const cache_key *publicKey() const { | |
113 | return (!EBIT_TEST(flags, KEY_PRIVATE)) ? | |
114 | reinterpret_cast<const cache_key*>(key): // may be nil | |
115 | nullptr; | |
116 | } | |
117 | ||
118 | /// Either fills this entry with private key or changes the existing key | |
119 | /// from public to private. | |
120 | /// \param permanent whether this entry should be private forever. | |
121 | void setPrivateKey(const bool shareable, const bool permanent); | |
122 | ||
d88e3c49 | 123 | void expireNow(); |
4310f8b0 EB |
124 | /// Makes the StoreEntry private and marks the corresponding entry |
125 | /// for eventual removal from the Store. | |
39fe14b2 | 126 | void releaseRequest(const bool shareable = false); |
d88e3c49 | 127 | void negativeCache(); |
9837567d | 128 | bool cacheNegatively(); // TODO: why both negativeCache() and cacheNegatively() ? |
d88e3c49 | 129 | void invokeHandlers(); |
9487bae9 | 130 | void cacheInMemory(); ///< start or continue storing in memory cache |
c07cbbf4 | 131 | void swapOut(); |
5b55f1f1 CT |
132 | /// whether we are in the process of writing this entry to disk |
133 | bool swappingOut() const { return swap_status == SWAPOUT_WRITING; } | |
4310f8b0 EB |
134 | /// whether the entire entry is now on disk (possibly marked for deletion) |
135 | bool swappedOut() const { return swap_status == SWAPOUT_DONE; } | |
02ba667b EB |
136 | /// whether we failed to write this entry to disk |
137 | bool swapoutFailed() const { return swap_status == SWAPOUT_FAILED; } | |
aa1a691e | 138 | void swapOutFileClose(int how); |
3900307b | 139 | const char *url() const; |
7015a149 AR |
140 | /// Satisfies cachability requirements shared among disk and RAM caches. |
141 | /// Encapsulates common checks of mayStartSwapOut() and memoryCachable(). | |
142 | /// TODO: Rename and make private so only those two methods can call this. | |
143 | bool checkCachable(); | |
3900307b | 144 | int checkNegativeHit() const; |
508590d9 | 145 | int locked() const { return lock_count; } |
3900307b | 146 | int validToSend() const; |
97754f5a | 147 | bool memoryCachable(); ///< checkCachable() and can be cached in memory |
4475555f | 148 | |
76d61119 EB |
149 | /// initialize mem_obj; assert if mem_obj already exists |
150 | /// avoid this method in favor of createMemObject(trio)! | |
151 | void createMemObject(); | |
c877c0bc | 152 | |
76d61119 | 153 | /// initialize mem_obj with URIs/method; assert if mem_obj already exists |
c877c0bc | 154 | void createMemObject(const char *storeId, const char *logUri, const HttpRequestMethod &aMethod); |
4475555f | 155 | |
76d61119 EB |
156 | /// initialize mem_obj (if needed) and set URIs/method (if missing) |
157 | void ensureMemObject(const char *storeId, const char *logUri, const HttpRequestMethod &aMethod); | |
158 | ||
3900307b | 159 | void dump(int debug_lvl) const; |
160 | void hashDelete(); | |
161 | void hashInsert(const cache_key *); | |
7e9f330d EB |
162 | /// notify the StoreEntry writer of a 3rd-party initiated StoreEntry abort |
163 | void registerAbortCallback(const AsyncCall::Pointer &); | |
3900307b | 164 | void reset(); |
165 | void setMemStatus(mem_status_t); | |
1a210de4 | 166 | bool timestampsSet(); |
7e9f330d EB |
167 | /// Avoid notifying anybody about a 3rd-party initiated StoreEntry abort. |
168 | /// Calling this method does not cancel the already queued notification. | |
169 | /// TODO: Refactor to represent the end of (shared) ownership by our writer. | |
170 | void unregisterAbortCallback(const char *reason); | |
3900307b | 171 | void destroyMemObject(); |
172 | int checkTooSmall(); | |
528b2c61 | 173 | |
a46d2c0e | 174 | void setNoDelay (bool const); |
438b41ba EB |
175 | void lastModified(const time_t when) { lastModified_ = when; } |
176 | /// \returns entry's 'effective' modification time | |
177 | time_t lastModified() const { | |
178 | // may still return -1 if timestamp is not set | |
179 | return lastModified_ < 0 ? timestamp : lastModified_; | |
180 | } | |
181 | /// \returns a formatted string with entry's timestamps | |
182 | const char *describeTimestamps() const; | |
183 | // TODO: consider removing currently unsupported imslen parameter | |
184 | bool modifiedSince(const time_t ims, const int imslen = -1) const; | |
79c8035e AR |
185 | /// has ETag matching at least one of the If-Match etags |
186 | bool hasIfMatchEtag(const HttpRequest &request) const; | |
187 | /// has ETag matching at least one of the If-None-Match etags | |
188 | bool hasIfNoneMatchEtag(const HttpRequest &request) const; | |
46017fdd CT |
189 | /// whether this entry has an ETag; if yes, puts ETag value into parameter |
190 | bool hasEtag(ETag &etag) const; | |
63be0a78 | 191 | |
66d51f4f AR |
192 | /// Updates easily-accessible non-Store-specific parts of the entry. |
193 | /// Use Controller::updateOnNotModified() instead of this helper. | |
194 | /// \returns whether anything was actually updated | |
195 | bool updateOnNotModified(const StoreEntry &e304); | |
196 | ||
2745fea5 AR |
197 | /// the disk this entry is [being] cached on; asserts for entries w/o a disk |
198 | Store::Disk &disk() const; | |
4310f8b0 EB |
199 | /// whether one of this StoreEntry owners has locked the corresponding |
200 | /// disk entry (at the specified disk entry coordinates, if any) | |
201 | bool hasDisk(const sdirno dirn = -1, const sfileno filen = -1) const; | |
202 | /// Makes hasDisk(dirn, filn) true. The caller should have locked | |
203 | /// the corresponding disk store entry for reading or writing. | |
204 | void attachToDisk(const sdirno, const sfileno, const swap_status_t); | |
205 | /// Makes hasDisk() false. The caller should have unlocked | |
206 | /// the corresponding disk store entry. | |
207 | void detachFromDisk(); | |
208 | ||
209 | /// whether there is a corresponding locked transients table entry | |
210 | bool hasTransients() const { return mem_obj && mem_obj->xitTable.index >= 0; } | |
211 | /// whether there is a corresponding locked shared memory table entry | |
212 | bool hasMemStore() const { return mem_obj && mem_obj->memCache.index >= 0; } | |
a46d2c0e | 213 | |
d2a6dcba EB |
214 | /// whether this entry can feed collapsed requests and only them |
215 | bool hittingRequiresCollapsing() const { return EBIT_TEST(flags, ENTRY_REQUIRES_COLLAPSING); } | |
216 | ||
217 | /// allow or forbid collapsed requests feeding | |
218 | void setCollapsingRequirement(const bool required); | |
819be284 | 219 | |
e6ccf245 | 220 | MemObject *mem_obj; |
221 | RemovalPolicyNode repl; | |
222 | /* START OF ON-DISK STORE_META_STD TLV field */ | |
223 | time_t timestamp; | |
224 | time_t lastref; | |
225 | time_t expires; | |
438b41ba EB |
226 | private: |
227 | time_t lastModified_; ///< received Last-Modified value or -1; use lastModified() | |
228 | public: | |
47f6e231 | 229 | uint64_t swap_file_sz; |
f45dd259 AJ |
230 | uint16_t refcount; |
231 | uint16_t flags; | |
e6ccf245 | 232 | /* END OF ON-DISK STORE_META_STD */ |
62e76326 | 233 | |
051dedf9 AR |
234 | /// unique ID inside a cache_dir for swapped out entries; -1 for others |
235 | sfileno swap_filen:25; // keep in sync with SwapFilenMax | |
d1398b75 HN |
236 | |
237 | sdirno swap_dirn:7; | |
62e76326 | 238 | |
d1398b75 | 239 | mem_status_t mem_status:3; |
62e76326 | 240 | |
d1398b75 | 241 | ping_status_t ping_status:3; |
62e76326 | 242 | |
d1398b75 | 243 | store_status_t store_status:3; |
62e76326 | 244 | |
d1398b75 | 245 | swap_status_t swap_status:3; |
62e76326 | 246 | |
e6ccf245 | 247 | public: |
248 | static size_t inUseCount(); | |
528b2c61 | 249 | |
0b934349 AJ |
250 | void *operator new(size_t byteCount); |
251 | void operator delete(void *address); | |
43ae1d95 | 252 | |
66d51f4f AR |
253 | int64_t objectLen() const { return mem().object_sz; } |
254 | int64_t contentLen() const { return objectLen() - mem().baseReply().hdr_sz; } | |
c21ad0f5 | 255 | |
18994992 | 256 | /// claim shared ownership of this entry (for use in a given context) |
acc5dc4c | 257 | /// matching lock() and unlock() contexts eases leak triage but is optional |
18994992 | 258 | void lock(const char *context); |
1bfe9ade | 259 | |
18994992 | 260 | /// disclaim shared ownership; may remove entry from store and delete it |
2f8abb64 | 261 | /// returns remaining lock level (zero for unlocked and possibly gone entry) |
acc5dc4c | 262 | int unlock(const char *context); |
1bfe9ade AR |
263 | |
264 | /// returns a local concurrent use counter, for debugging | |
265 | int locks() const { return static_cast<int>(lock_count); } | |
266 | ||
18994992 AR |
267 | /// update last reference timestamp and related Store metadata |
268 | void touch(); | |
269 | ||
4310f8b0 EB |
270 | /// One of the three methods to get rid of an unlocked StoreEntry object. |
271 | /// Removes all unlocked (and marks for eventual removal all locked) Store | |
272 | /// entries, including attached and unattached entries that have our key. | |
273 | /// Also destroys us if we are unlocked or makes us private otherwise. | |
69565793 | 274 | void release(const bool shareable = false); |
39fe14b2 | 275 | |
4310f8b0 EB |
276 | /// One of the three methods to get rid of an unlocked StoreEntry object. |
277 | /// May destroy this object if it is unlocked; does nothing otherwise. | |
278 | /// Unlike release(), may not trigger eviction of underlying store entries, | |
279 | /// but, unlike destroyStoreEntry(), does honor an earlier release request. | |
280 | void abandon(const char *context) { if (!locked()) doAbandon(context); } | |
281 | ||
39fe14b2 EB |
282 | /// May the caller commit to treating this [previously locked] |
283 | /// entry as a cache hit? | |
284 | bool mayStartHitting() const { | |
285 | return !EBIT_TEST(flags, KEY_PRIVATE) || shareableWhenPrivate; | |
286 | } | |
62e76326 | 287 | |
0ad2b63b CT |
288 | #if USE_ADAPTATION |
289 | /// call back producer when more buffer space is available | |
290 | void deferProducer(const AsyncCall::Pointer &producer); | |
291 | /// calls back producer registered with deferProducer | |
292 | void kickProducer(); | |
293 | #endif | |
294 | ||
0f33a01d | 295 | /* Packable API */ |
337b9aa4 AR |
296 | void append(char const *, int) override; |
297 | void vappendf(const char *, va_list) override; | |
298 | void buffer() override; | |
299 | void flush() override; | |
0f33a01d | 300 | |
0cdcf3d7 | 301 | protected: |
4310f8b0 EB |
302 | typedef Store::EntryGuard EntryGuard; |
303 | ||
24c93780 | 304 | void storeWritingCheckpoint(); |
4310f8b0 EB |
305 | /// does nothing except throwing if disk-associated data members are inconsistent |
306 | void checkDisk() const; | |
0cdcf3d7 | 307 | |
e6ccf245 | 308 | private: |
4310f8b0 | 309 | void doAbandon(const char *context); |
2be042f6 | 310 | bool checkTooBig() const; |
1a210de4 | 311 | void forcePublicKey(const cache_key *newkey); |
4310f8b0 | 312 | StoreEntry *adjustVary(); |
1a210de4 | 313 | const cache_key *calcPublicKey(const KeyScope keyScope); |
2be042f6 | 314 | |
ba3fe8d9 EB |
315 | /// flags [truncated or too big] entry with ENTRY_BAD_LENGTH and releases it |
316 | void lengthWentBad(const char *reason); | |
317 | ||
341876ec | 318 | static Mem::Allocator *pool; |
528b2c61 | 319 | |
f53969cc | 320 | unsigned short lock_count; /* Assume < 65536! */ |
1bfe9ade | 321 | |
39fe14b2 EB |
322 | /// Nobody can find/lock KEY_PRIVATE entries, but some transactions |
323 | /// (e.g., collapsed requests) find/lock a public entry before it becomes | |
324 | /// private. May such transactions start using the now-private entry | |
325 | /// they previously locked? This member should not affect transactions | |
326 | /// that already started reading from the entry. | |
327 | bool shareableWhenPrivate; | |
328 | ||
0ad2b63b CT |
329 | #if USE_ADAPTATION |
330 | /// producer callback registered with deferProducer | |
331 | AsyncCall::Pointer deferredProducer; | |
332 | #endif | |
333 | ||
528b2c61 | 334 | bool validLength() const; |
79c8035e | 335 | bool hasOneOfEtags(const String &reqETags, const bool allowWeakMatch) const; |
39fe14b2 EB |
336 | |
337 | friend std::ostream &operator <<(std::ostream &os, const StoreEntry &e); | |
e6ccf245 | 338 | }; |
339 | ||
2c4cd1ad AR |
340 | std::ostream &operator <<(std::ostream &os, const StoreEntry &e); |
341 | ||
63be0a78 | 342 | /// \ingroup StoreAPI |
c8f4eac4 | 343 | typedef void (*STOREGETCLIENT) (StoreEntry *, void *cbdata); |
344 | ||
2745fea5 | 345 | namespace Store { |
4310f8b0 EB |
346 | |
347 | /// a smart pointer similar to std::unique_ptr<> that automatically | |
348 | /// release()s and unlock()s the guarded Entry on stack-unwinding failures | |
349 | class EntryGuard { | |
350 | public: | |
351 | /// \param entry either nil or a locked Entry to manage | |
352 | /// \param context default unlock() message | |
353 | EntryGuard(Entry *entry, const char *context): | |
354 | entry_(entry), context_(context) { | |
355 | assert(!entry_ || entry_->locked()); | |
356 | } | |
357 | ||
358 | ~EntryGuard() { | |
359 | if (entry_) { | |
360 | // something went wrong -- the caller did not unlockAndReset() us | |
361 | onException(); | |
362 | } | |
363 | } | |
364 | ||
365 | EntryGuard(EntryGuard &&) = delete; // no copying or moving (for now) | |
366 | ||
367 | /// like std::unique_ptr::get() | |
368 | /// \returns nil or the guarded (locked) entry | |
369 | Entry *get() { | |
370 | return entry_; | |
371 | } | |
372 | ||
373 | /// like std::unique_ptr::reset() | |
374 | /// stops guarding the entry | |
375 | /// unlocks the entry (which may destroy it) | |
376 | void unlockAndReset(const char *resetContext = nullptr) { | |
377 | if (entry_) { | |
378 | entry_->unlock(resetContext ? resetContext : context_); | |
379 | entry_ = nullptr; | |
380 | } | |
381 | } | |
382 | ||
383 | private: | |
384 | void onException() noexcept; | |
385 | ||
386 | Entry *entry_; ///< the guarded Entry or nil | |
387 | const char *context_; ///< default unlock() message | |
388 | }; | |
389 | ||
7d84d4ca SM |
390 | void Stats(StoreEntry *output); |
391 | void Maintain(void *unused); | |
4310f8b0 | 392 | }; // namespace Store |
c8f4eac4 | 393 | |
63be0a78 | 394 | /// \ingroup StoreAPI |
71b673d4 | 395 | size_t storeEntryInUse(); |
63be0a78 | 396 | |
397 | /// \ingroup StoreAPI | |
71b673d4 | 398 | const char *storeEntryFlags(const StoreEntry *); |
63be0a78 | 399 | |
400 | /// \ingroup StoreAPI | |
71b673d4 | 401 | void storeEntryReplaceObject(StoreEntry *, HttpReply *); |
e6ccf245 | 402 | |
63be0a78 | 403 | /// \ingroup StoreAPI |
71b673d4 | 404 | StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method); |
63be0a78 | 405 | |
406 | /// \ingroup StoreAPI | |
1a210de4 | 407 | StoreEntry *storeGetPublicByRequest(HttpRequest * request, const KeyScope keyScope = ksDefault); |
63be0a78 | 408 | |
409 | /// \ingroup StoreAPI | |
1a210de4 | 410 | StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method, const KeyScope keyScope = ksDefault); |
63be0a78 | 411 | |
412 | /// \ingroup StoreAPI | |
1bfe9ade | 413 | /// Like storeCreatePureEntry(), but also locks the entry and sets entry key. |
71b673d4 | 414 | StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&); |
63be0a78 | 415 | |
1bfe9ade AR |
416 | /// \ingroup StoreAPI |
417 | /// Creates a new StoreEntry with mem_obj and sets initial flags/states. | |
4310f8b0 | 418 | StoreEntry *storeCreatePureEntry(const char *storeId, const char *logUrl, const HttpRequestMethod&); |
1bfe9ade | 419 | |
63be0a78 | 420 | /// \ingroup StoreAPI |
71b673d4 | 421 | void storeInit(void); |
63be0a78 | 422 | |
63be0a78 | 423 | /// \ingroup StoreAPI |
71b673d4 | 424 | void storeConfigure(void); |
63be0a78 | 425 | |
426 | /// \ingroup StoreAPI | |
71b673d4 | 427 | int expiresMoreThan(time_t, time_t); |
63be0a78 | 428 | |
63be0a78 | 429 | /// \ingroup StoreAPI |
71b673d4 | 430 | void storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG2; |
63be0a78 | 431 | |
432 | /// \ingroup StoreAPI | |
71b673d4 | 433 | void storeAppendVPrintf(StoreEntry *, const char *, va_list ap); |
63be0a78 | 434 | |
435 | /// \ingroup StoreAPI | |
71b673d4 | 436 | int storeTooManyDiskFilesOpen(void); |
63be0a78 | 437 | |
438 | /// \ingroup StoreAPI | |
71b673d4 | 439 | void storeHeapPositionUpdate(StoreEntry *, SwapDir *); |
63be0a78 | 440 | |
441 | /// \ingroup StoreAPI | |
71b673d4 | 442 | void storeSwapFileNumberSet(StoreEntry * e, sfileno filn); |
63be0a78 | 443 | |
444 | /// \ingroup StoreAPI | |
71b673d4 | 445 | void storeFsInit(void); |
63be0a78 | 446 | |
447 | /// \ingroup StoreAPI | |
71b673d4 | 448 | void storeFsDone(void); |
63be0a78 | 449 | |
450 | /// \ingroup StoreAPI | |
71b673d4 | 451 | void storeReplAdd(const char *, REMOVALPOLICYCREATE *); |
63be0a78 | 452 | |
4310f8b0 EB |
453 | /// One of the three methods to get rid of an unlocked StoreEntry object. |
454 | /// This low-level method ignores lock()ing and release() promises. It never | |
455 | /// leaves the entry in the local store_table. | |
456 | /// TODO: Hide by moving its functionality into the StoreEntry destructor. | |
c8f4eac4 | 457 | extern FREE destroyStoreEntry; |
e6ccf245 | 458 | |
6d3c2758 | 459 | /// \ingroup StoreAPI |
71b673d4 | 460 | void storeGetMemSpace(int size); |
6d3c2758 | 461 | |
ff9d9458 | 462 | #endif /* SQUID_SRC_STORE_H */ |
f53969cc | 463 |