extern StoreIoStats store_io_stats;
+/// maximum number of entries per cache_dir
+enum { SwapFilenMax = 0xFFFFFF }; // keep in sync with StoreEntry::swap_filen
+
/**
\ingroup StoreAPI
*/
uint16_t flags;
/* END OF ON-DISK STORE_META_STD */
- sfileno swap_filen:25;
+ /// unique ID inside a cache_dir for swapped out entries; -1 for others
+ sfileno swap_filen:25; // keep in sync with SwapFilenMax
sdirno swap_dirn:7;
fatalf("COSS max-size option must be less than COSS_MEMBUF_SZ (%d)\n",
COSS_MEMBUF_SZ);
- /*
- * check that we won't overflow sfileno later. 0xFFFFFF is the
- * largest possible sfileno, assuming sfileno is a 25-bit
- * signed integer, as defined in structs.h.
- */
- const uint64_t max_offset = (uint64_t) 0xFFFFFF << blksz_bits;
+ // check that we won't overflow sfileno later.
+ const uint64_t max_offset = (uint64_t)SwapFilenMax << blksz_bits;
if (maxSize() > max_offset) {
debugs(47, 0, "COSS block-size = " << (1<<blksz_bits) << " bytes");
virtual bool doReportStat() const;
virtual void swappedOut(const StoreEntry &e);
- int64_t entryLimitHigh() const { return 0xFFFFFF; } /// Core sfileno maximum
+ int64_t entryLimitHigh() const { return SwapFilenMax; } ///< Core limit
int64_t entryLimitAllowed() const;
typedef Ipc::StoreMapWithExtras<DbCellHeader> DirMap;