Tor 0.4.9.0-alpha-dev
Public Member Functions | Data Fields
consensus_cache_entry_t Struct Reference

Public Member Functions

 HANDLE_ENTRY (consensus_cache_entry, consensus_cache_entry_t)
 

Data Fields

uint32_t magic
 
int32_t refcnt
 
unsigned can_remove: 1
 
unsigned release_aggressively: 1
 
char * fname
 
config_line_tlabels
 
consensus_cache_tin_cache
 
time_t unused_since
 
tor_mmap_tmap
 
size_t bodylen
 
const uint8_t * body
 

Detailed Description

A consensus_cache_entry_t is a reference-counted handle to an item in a consensus_cache_t. It can be mmapped into RAM, or not, depending whether it's currently in use.

Definition at line 32 of file conscache.c.

Field Documentation

◆ body

const uint8_t* body

Pointer to the body within map.

Definition at line 56 of file conscache.c.

Referenced by consensus_cache_entry_map(), and directory_handle_command().

◆ bodylen

size_t bodylen

Length of the body within map.

Definition at line 54 of file conscache.c.

Referenced by consensus_cache_entry_map().

◆ can_remove

unsigned can_remove

If true, we want to delete this file.

Definition at line 36 of file conscache.c.

Referenced by consensus_cache_entry_mark_for_removal().

◆ fname

char* fname

Filename for this object within the storage_dir_t

Definition at line 41 of file conscache.c.

Referenced by consensus_cache_entry_map().

◆ in_cache

consensus_cache_t* in_cache

Pointer to the cache that includes this entry (if any).

Definition at line 46 of file conscache.c.

◆ labels

config_line_t* labels

Labels associated with this object. Immutable once the object is created.

Definition at line 44 of file conscache.c.

Referenced by consensus_cache_entry_get_labels(), and consensus_cache_entry_get_value().

◆ magic

uint32_t magic

Must be set to CCE_MAGIC

Definition at line 33 of file conscache.c.

◆ map

tor_mmap_t* map

mmaped contents of the underlying file. May be NULL

Definition at line 52 of file conscache.c.

Referenced by consensus_cache_entry_map().

◆ refcnt

int32_t refcnt

Reference count.

Definition at line 35 of file conscache.c.

◆ release_aggressively

unsigned release_aggressively

If true, we intend to unmap this file as soon as we're done with it.

Definition at line 38 of file conscache.c.

Referenced by consensus_cache_entry_mark_for_aggressive_release().

◆ unused_since

time_t unused_since

Since what time has this object been mapped into RAM, but with the cache being the only having a reference to it?

Definition at line 50 of file conscache.c.

Referenced by consensus_cache_entry_map(), and consensus_cache_entry_unmap().


The documentation for this struct was generated from the following file: