-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfs3_cache.h
38 lines (28 loc) · 1022 Bytes
/
fs3_cache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef FS3_CACHE_INCLUDED
#define FS3_CACHE_INCLUDED
////////////////////////////////////////////////////////////////////////////////
//
// File : fs3_cache.h
// Description : This is the interface for the sector cache in the FS3
// filesystem.
//
// Author : Patrick McDaniel
// Last Modified : Sun 17 Oct 2021 09:36:52 AM EDT
//
// Include
#include <fs3_controller.h>
// Defines
#define FS3_DEFAULT_CACHE_SIZE 2048; // 256 cache entries, by default
//
// Cache Functions
int fs3_init_cache(uint16_t cachelines);
// Initialize the cache with a fixed number of cache lines
int fs3_close_cache(void);
// Close the cache, freeing any buffers held in it
int fs3_put_cache(FS3TrackIndex trk, FS3SectorIndex sct, void *buf);
// Put an element in the cache
void * fs3_get_cache(FS3TrackIndex trk, FS3SectorIndex sct);
// Get an element from the cache (returns NULL if not found)
int fs3_log_cache_metrics(void);
// Log the metrics for the cache
#endif