summaryrefslogtreecommitdiff
path: root/libbcache.h
blob: 6ec3f42dd1c091f77e93a963123fbab73e58ecaf (plain)
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
45
46
47
48
49
50
51
#ifndef _LIBBCACHE_H
#define _LIBBCACHE_H

#include <linux/uuid.h>
#include "tools-util.h"
#include "vstructs.h"
#include "stdbool.h"

#include "tools-util.h"

struct cache_sb;

enum fsck_err_opts {
	FSCK_ERR_ASK,
	FSCK_ERR_YES,
	FSCK_ERR_NO,
};

extern enum fsck_err_opts fsck_err_opt;

struct dev_opts {
	int		fd;
	const char	*path;
	u64		size; /* 512 byte sectors */
	unsigned	bucket_size;
	unsigned	tier;
	bool		discard;

	u64		first_bucket;
	u64		nbuckets;
};

void bcache_format(struct dev_opts *devs, size_t nr_devs,
		   unsigned block_size,
		   unsigned btree_node_size,
		   unsigned meta_csum_type,
		   unsigned data_csum_type,
		   unsigned compression_type,
		   const char *passphrase,
		   unsigned meta_replicas,
		   unsigned data_replicas,
		   unsigned on_error_action,
		   unsigned max_journal_entry_size,
		   char *label,
		   uuid_le uuid);

struct bch_sb *bcache_super_read(const char *);

void bcache_super_print(struct bch_sb *, int);

#endif /* _LIBBCACHE_H */