libnvdimm: nd_region flush callback support
This patch adds functionality to perform flush from guest to host over VIRTIO. We are registering a callback based on 'nd_region' type. virtio_pmem driver requires this special flush function. For rest of the region types we are registering existing flush function. Report error returned by host fsync failure to userspace. Signed-off-by: Pankaj Gupta <pagupta@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
此提交包含在:
@@ -255,7 +255,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
|
||||
struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
|
||||
unsigned int sz_align = ALIGN(size + (offset & (512 - 1)), 512);
|
||||
sector_t sector = offset >> 9;
|
||||
int rc = 0;
|
||||
int rc = 0, ret = 0;
|
||||
|
||||
if (unlikely(!size))
|
||||
return 0;
|
||||
@@ -293,7 +293,9 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
|
||||
}
|
||||
|
||||
memcpy_flushcache(nsio->addr + offset, buf, size);
|
||||
nvdimm_flush(to_nd_region(ndns->dev.parent));
|
||||
ret = nvdimm_flush(to_nd_region(ndns->dev.parent), NULL);
|
||||
if (ret)
|
||||
rc = ret;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者