1
2
3
4
5
6
7
8
9
10 #ifndef _LINUX_VIRTIO_PMEM_H
11 #define _LINUX_VIRTIO_PMEM_H
12
13 #include <linux/module.h>
14 #include <uapi/linux/virtio_pmem.h>
15 #include <linux/libnvdimm.h>
16 #include <linux/spinlock.h>
17
18 struct virtio_pmem_request {
19 struct virtio_pmem_req req;
20 struct virtio_pmem_resp resp;
21
22
23 wait_queue_head_t host_acked;
24 bool done;
25
26
27 wait_queue_head_t wq_buf;
28 bool wq_buf_avail;
29 struct list_head list;
30 };
31
32 struct virtio_pmem {
33 struct virtio_device *vdev;
34
35
36 struct virtqueue *req_vq;
37
38
39 struct nvdimm_bus *nvdimm_bus;
40 struct nvdimm_bus_descriptor nd_desc;
41
42
43 struct list_head req_list;
44
45
46 spinlock_t pmem_lock;
47
48
49 __u64 start;
50 __u64 size;
51 };
52
53 void virtio_pmem_host_ack(struct virtqueue *vq);
54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
55 #endif