-
Notifications
You must be signed in to change notification settings - Fork 2
/
dm-ovbd.h
45 lines (30 loc) · 977 Bytes
/
dm-ovbd.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
35
36
37
38
39
40
41
42
43
44
45
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __DM_OVBD_HEADER__
#define __DM_OVBD_HEADER__
#include <linux/device-mapper.h>
#include <linux/bio.h>
struct ovbd_context {
struct workqueue_struct *wq;
};
struct ovbd_context *get_ovbd_context(void);
int init_lsmt_target(void);
void cleanup_lsmt_target(void);
int init_zfile_target(void);
void cleanup_zfile_target(void);
struct vfile;
struct vfile_operations {
struct block_device *(*blkdev)(struct vfile *file);
size_t (*len)(struct vfile *file);
ssize_t (*pread)(struct vfile *file, void *buffer, size_t count,
loff_t offset);
int (*bio_remap)(struct vfile *file, struct bio *bio,
struct dm_dev **devs, unsigned int nr_dev);
void (*close)(struct vfile *file);
};
struct vfile {
struct vfile_operations *ops;
};
struct vfile *open_blkdev_as_vfile(struct block_device *blk, loff_t len);
struct vfile *zfile_open(struct vfile *file);
struct vfile *lsmt_open_files(struct vfile *zf[], int n);
#endif