summaryrefslogtreecommitdiff
path: root/src/cache/backings/file.h
blob: 08237bdcb7fafd3213fce1bab334d803c65d354b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <al/str.h>
#include <nnwt/thread.h>
#include <nnwt/file.h>

#include "../backing.h"

struct cch_backing_file {
    struct cch_backing backing;
    struct nn_file file;
    union {
        off_t pointer; // CACHE_BACKING_READ
        void *map;     // CACHE_BACKING_MAPPED
    } u;
    struct nn_mutex mutex;
};

struct cch_backing *cch_backing_file_create(str *path, size_t filesize);