forked from raphaelsc/ghostfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblock_info.h
More file actions
46 lines (30 loc) · 774 Bytes
/
block_info.h
File metadata and controls
46 lines (30 loc) · 774 Bytes
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
39
40
41
42
43
44
/*
Ghost File System, or simply GhostFS
Copyright (C) 2016 Raphael S. Carvalho
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
#ifndef BLOCK_INFO_H
#define BLOCK_INFO_H
#include <boost/intrusive/unordered_set.hpp>
#include <boost/intrusive/list.hpp>
#include <mutex>
struct block_info;
namespace bi = boost::intrusive;
struct block {
block_info* _info;
char* _data;
bi::list_member_hook<> _lru_link;
block(block_info* info, char* data);
block() = delete;
};
struct block_info {
bool _present = false;
block* _blk = nullptr;
std::mutex _mtx;
block_info() = default;
block_info(block_info&&) {}
void reset();
void set_block(block *blk);
};
#endif // BLOCK_INFO_H