2013-06-27 05:42:39 +04:00
|
|
|
/*
|
|
|
|
* Author: Kent Overstreet <kmo@daterainc.com>
|
|
|
|
*
|
|
|
|
* GPLv2
|
|
|
|
*/
|
|
|
|
|
2010-10-08 18:04:49 +04:00
|
|
|
#ifndef _BCACHE_H
|
|
|
|
#define _BCACHE_H
|
|
|
|
|
2014-08-26 06:11:59 +04:00
|
|
|
#include <linux/bcache.h>
|
2011-08-01 06:29:22 +04:00
|
|
|
|
2014-09-12 02:55:39 +04:00
|
|
|
typedef __u8 u8;
|
|
|
|
typedef __u16 u16;
|
|
|
|
typedef __u32 u32;
|
|
|
|
typedef __u64 u64;
|
|
|
|
|
|
|
|
typedef __s8 s8;
|
|
|
|
typedef __s16 s16;
|
|
|
|
typedef __s32 s32;
|
|
|
|
typedef __s64 s64;
|
|
|
|
|
2013-03-09 17:58:57 +04:00
|
|
|
#define SB_START (SB_SECTOR * 512)
|
2011-05-20 07:25:14 +04:00
|
|
|
|
2014-08-26 06:11:59 +04:00
|
|
|
extern const char * const cache_state[];
|
|
|
|
extern const char * const replacement_policies[];
|
|
|
|
extern const char * const csum_types[];
|
|
|
|
extern const char * const bdev_cache_mode[];
|
|
|
|
extern const char * const bdev_state[];
|
|
|
|
|
|
|
|
ssize_t read_string_list(const char *, const char * const[]);
|
|
|
|
ssize_t read_string_list_or_die(const char *, const char * const[],
|
|
|
|
const char *);
|
|
|
|
void print_string_list(const char * const[], size_t);
|
|
|
|
|
|
|
|
uint64_t bch_checksum(unsigned, const void *, size_t);
|
|
|
|
|
|
|
|
#define csum_set(i, type) \
|
|
|
|
({ \
|
|
|
|
void *start = ((void *) (i)) + sizeof(uint64_t); \
|
|
|
|
void *end = bset_bkey_last(i); \
|
|
|
|
\
|
|
|
|
bch_checksum(type, start, end - start); \
|
|
|
|
})
|
2011-07-26 21:02:15 +04:00
|
|
|
|
2010-10-08 18:04:49 +04:00
|
|
|
#endif
|