squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
fs
rock
RockDbCell.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
#ifndef SQUID_FS_ROCK_DB_CELL_H
10
#define SQUID_FS_ROCK_DB_CELL_H
11
12
#include "
store/forward.h
"
13
14
namespace
Rock
15
{
16
22
class
DbCellHeader
23
{
24
public
:
25
DbCellHeader
();
26
28
bool
empty
()
const
{
return
!
firstSlot
&& !
nextSlot
&& !
payloadSize
; }
29
30
/* members below are not meaningful if empty() */
31
33
bool
sane
(
const
size_t
slotSize,
int
slotLimit)
const
{
34
return
35
0 <=
firstSlot
&&
firstSlot
< slotLimit &&
36
-1 <=
nextSlot
&&
nextSlot
< slotLimit &&
37
version
> 0 &&
38
0 <
payloadSize
&&
payloadSize
<= slotSize -
sizeof
(
DbCellHeader
);
39
}
40
41
uint64_t
key
[2];
42
uint64_t
entrySize
;
43
uint32_t
payloadSize
;
44
uint32_t
version
;
45
sfileno
firstSlot
;
46
sfileno
nextSlot
;
47
};
48
49
}
// namespace Rock
50
51
#endif
/* SQUID_FS_ROCK_DB_CELL_H */
52
Rock::DbCellHeader::entrySize
uint64_t entrySize
total entry content size or zero if still unknown
Definition:
RockDbCell.h:42
Rock::DbCellHeader::sane
bool sane(const size_t slotSize, int slotLimit) const
whether this slot is not corrupted
Definition:
RockDbCell.h:33
Rock
Definition:
forward.h:28
Rock::DbCellHeader::empty
bool empty() const
true iff no entry occupies this slot
Definition:
RockDbCell.h:28
forward.h
Rock::DbCellHeader::key
uint64_t key[2]
StoreEntry key.
Definition:
RockDbCell.h:41
Rock::DbCellHeader::version
uint32_t version
detects conflicts among same-key entries
Definition:
RockDbCell.h:44
sfileno
signed_int32_t sfileno
Definition:
forward.h:22
Rock::DbCellHeader::payloadSize
uint32_t payloadSize
slot contents size, always positive
Definition:
RockDbCell.h:43
Rock::DbCellHeader::DbCellHeader
DbCellHeader()
Definition:
RockDbCell.cc:14
Rock::DbCellHeader::nextSlot
sfileno nextSlot
slot ID of the next slot occupied by the entry
Definition:
RockDbCell.h:46
Rock::DbCellHeader::firstSlot
sfileno firstSlot
slot ID of the first slot occupied by the entry
Definition:
RockDbCell.h:45
Rock::DbCellHeader
Definition:
RockDbCell.h:23
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
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
jp
pl
...
full list
FTP Package Archive