Squid Web Cache
master
Loading...
Searching...
No Matches
RockDbCell.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 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_SRC_FS_ROCK_ROCKDBCELL_H
10
#define SQUID_SRC_FS_ROCK_ROCKDBCELL_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_SRC_FS_ROCK_ROCKDBCELL_H */
52
Rock::DbCellHeader
Definition
RockDbCell.h:23
Rock::DbCellHeader::key
uint64_t key[2]
StoreEntry key.
Definition
RockDbCell.h:41
Rock::DbCellHeader::entrySize
uint64_t entrySize
total entry content size or zero if still unknown
Definition
RockDbCell.h:42
Rock::DbCellHeader::DbCellHeader
DbCellHeader()
Definition
RockDbCell.cc:14
Rock::DbCellHeader::version
uint32_t version
detects conflicts among same-key entries
Definition
RockDbCell.h:44
Rock::DbCellHeader::sane
bool sane(const size_t slotSize, int slotLimit) const
whether this slot is not corrupted
Definition
RockDbCell.h:33
Rock::DbCellHeader::empty
bool empty() const
true iff no entry occupies this slot
Definition
RockDbCell.h:28
Rock::DbCellHeader::payloadSize
uint32_t payloadSize
slot contents size, always positive
Definition
RockDbCell.h:43
Rock::DbCellHeader::firstSlot
sfileno firstSlot
slot ID of the first slot occupied by the entry
Definition
RockDbCell.h:45
Rock::DbCellHeader::nextSlot
sfileno nextSlot
slot ID of the next slot occupied by the entry
Definition
RockDbCell.h:46
Rock
Definition
forward.h:28
forward.h
sfileno
signed_int32_t sfileno
Definition
forward.h:22
squid
src
fs
rock
RockDbCell.h
Generated by
1.9.8