Skip to content

Block Cache

struct bcache_entry {
uint8_t *buffer;
uint64_t size;
uint64_t lba;
uint64_t access_time;
struct mutex lock;
bool dirty;
bool no_evict;
struct bio_request *request;
refcount_t refcount;
};

struct bcache_entry referenced types:

struct bcache_wrapper {
uint64_t key;
struct bcache_entry *value;
bool occupied;
struct bcache_wrapper *next;
};

struct bcache_wrapper referenced types:

struct bcache {
struct bcache_wrapper **entries;
uint64_t ticks;
uint64_t capacity;
uint64_t count;
uint64_t spb;
struct spinlock lock;
};

struct bcache referenced types:

uint64_t bcache_hash(uint64_t x, uint64_t capacity);
void bcache_increment_ticks(struct bcache *cache);

bcache_increment_ticks referenced types:

uint64_t bcache_get_ticks(struct bcache *cache);

bcache_get_ticks referenced types:

void bcache_ent_lock(struct bcache_entry *ent);

bcache_ent_lock referenced types:

void bcache_ent_unlock(struct bcache_entry *ent);

bcache_ent_unlock referenced types:

void bcache_ent_pin(struct bcache_entry *ent);

bcache_ent_pin referenced types:

void bcache_ent_unpin(struct bcache_entry *ent);

bcache_ent_unpin referenced types:

void bcache_ent_acquire(struct bcache_entry *ent);

bcache_ent_acquire referenced types:

void bcache_ent_release(struct bcache_entry *ent);

bcache_ent_release referenced types:

#define DEFAULT_BLOCK_CACHE_SIZE 2048
#define DEFAULT_MAX_DIRTY_ENTS 64