0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LINUX_VIRTIO_PMEM_H
0011 #define _LINUX_VIRTIO_PMEM_H
0012
0013 #include <linux/module.h>
0014 #include <uapi/linux/virtio_pmem.h>
0015 #include <linux/libnvdimm.h>
0016 #include <linux/spinlock.h>
0017
0018 struct virtio_pmem_request {
0019 struct virtio_pmem_req req;
0020 struct virtio_pmem_resp resp;
0021
0022
0023 wait_queue_head_t host_acked;
0024 bool done;
0025
0026
0027 wait_queue_head_t wq_buf;
0028 bool wq_buf_avail;
0029 struct list_head list;
0030 };
0031
0032 struct virtio_pmem {
0033 struct virtio_device *vdev;
0034
0035
0036 struct virtqueue *req_vq;
0037
0038
0039 struct nvdimm_bus *nvdimm_bus;
0040 struct nvdimm_bus_descriptor nd_desc;
0041
0042
0043 struct list_head req_list;
0044
0045
0046 spinlock_t pmem_lock;
0047
0048
0049 __u64 start;
0050 __u64 size;
0051 };
0052
0053 void virtio_pmem_host_ack(struct virtqueue *vq);
0054 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
0055 #endif