forked from acozzette/BUSE
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuse.h
34 lines (27 loc) · 828 Bytes
/
buse.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
28
29
30
31
32
33
34
#ifndef BUSE_H_INCLUDED
#define BUSE_H_INCLUDED
#ifdef __cplusplus
extern "C"
{
#endif
/* Most of this file was copied from nbd.h in the nbd distribution. */
#include <stdint.h>
#include <sys/types.h>
#include <linux/nbd.h>
struct buse_operations
{
int (*read)(void *buf, uint32_t len, uint64_t offset, void *userdata);
int (*write)(const void *buf, uint32_t len, uint64_t offset, void *userdata);
void (*disc)(void *userdata);
int (*flush)(void *userdata);
int (*trim)(uint64_t from, uint32_t len, void *userdata);
// either set size, OR set both blksize and size_blocks
uint64_t size;
uint32_t blksize;
uint64_t size_blocks;
};
int buse_main(const char *dev_file, const struct buse_operations *bop, void *userdata);
#ifdef __cplusplus
}
#endif
#endif /* BUSE_H_INCLUDED */