-
Notifications
You must be signed in to change notification settings - Fork 7
/
fscache.h
27 lines (24 loc) · 1.04 KB
/
fscache.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
#ifndef BACKFS_CACHE_WRF_H
#define BACKFS_CACHE_WRF_H
/*
* BackFS Filesystem Cache
* Copyright (c) 2010-2014 William R. Fraser
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
void cache_init(const char *cache_dir, uint64_t cache_size, uint64_t bucket_max_size);
int cache_fetch(const char *filename, uint32_t block, uint64_t offset,
char *buf, uint64_t len, uint64_t *bytes_read, time_t mtime);
int cache_add(const char *filename, uint32_t block, const char *buf,
uint64_t len, time_t mtime);
int cache_invalidate_block(const char *filename, uint32_t block);
int cache_try_invalidate_block(const char *filename, uint32_t block);
int cache_invalidate_file(const char *filename);
int cache_try_invalidate_file(const char *filename);
int cache_free_orphan_buckets(void);
int cache_has_file(const char *filename, uint64_t *cached_byte_count);
int cache_try_invalidate_blocks_above(const char *filename, uint32_t block);
int cache_rename(const char *path, const char *path_new);
#endif //BACKFS_CACHE_WRF_H