mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge branch 'for-4.18/mcsafe' into libnvdimm-for-next
This commit is contained in:
commit
930218affe
23 changed files with 485 additions and 79 deletions
|
|
@ -276,7 +276,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
|
|||
if (rw == READ) {
|
||||
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align)))
|
||||
return -EIO;
|
||||
return memcpy_mcsafe(buf, nsio->addr + offset, size);
|
||||
if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
|
||||
|
|
|
|||
|
|
@ -101,15 +101,15 @@ static blk_status_t read_pmem(struct page *page, unsigned int off,
|
|||
void *pmem_addr, unsigned int len)
|
||||
{
|
||||
unsigned int chunk;
|
||||
int rc;
|
||||
unsigned long rem;
|
||||
void *mem;
|
||||
|
||||
while (len) {
|
||||
mem = kmap_atomic(page);
|
||||
chunk = min_t(unsigned int, len, PAGE_SIZE);
|
||||
rc = memcpy_mcsafe(mem + off, pmem_addr, chunk);
|
||||
rem = memcpy_mcsafe(mem + off, pmem_addr, chunk);
|
||||
kunmap_atomic(mem);
|
||||
if (rc)
|
||||
if (rem)
|
||||
return BLK_STS_IOERR;
|
||||
len -= chunk;
|
||||
off = 0;
|
||||
|
|
@ -259,9 +259,16 @@ static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
|
|||
return copy_from_iter_flushcache(addr, bytes, i);
|
||||
}
|
||||
|
||||
static size_t pmem_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff,
|
||||
void *addr, size_t bytes, struct iov_iter *i)
|
||||
{
|
||||
return copy_to_iter_mcsafe(addr, bytes, i);
|
||||
}
|
||||
|
||||
static const struct dax_operations pmem_dax_ops = {
|
||||
.direct_access = pmem_dax_direct_access,
|
||||
.copy_from_iter = pmem_copy_from_iter,
|
||||
.copy_to_iter = pmem_copy_to_iter,
|
||||
};
|
||||
|
||||
static const struct attribute_group *pmem_attribute_groups[] = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue