Lines Matching refs:nsio
228 struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); in nsio_rw_bytes() local
230 if (unlikely(offset + size > nsio->size)) { in nsio_rw_bytes()
238 if (unlikely(is_bad_pmem(&nsio->bb, offset / 512, sz_align))) in nsio_rw_bytes()
240 return memcpy_from_pmem(buf, nsio->addr + offset, size); in nsio_rw_bytes()
242 memcpy_to_pmem(nsio->addr + offset, buf, size); in nsio_rw_bytes()
249 int devm_nsio_enable(struct device *dev, struct nd_namespace_io *nsio) in devm_nsio_enable() argument
251 struct resource *res = &nsio->res; in devm_nsio_enable()
252 struct nd_namespace_common *ndns = &nsio->common; in devm_nsio_enable()
254 nsio->size = resource_size(res); in devm_nsio_enable()
262 if (devm_init_badblocks(dev, &nsio->bb)) in devm_nsio_enable()
264 nvdimm_badblocks_populate(to_nd_region(ndns->dev.parent), &nsio->bb, in devm_nsio_enable()
265 &nsio->res); in devm_nsio_enable()
267 nsio->addr = devm_memremap(dev, res->start, resource_size(res), in devm_nsio_enable()
270 return PTR_ERR_OR_ZERO(nsio->addr); in devm_nsio_enable()
274 void devm_nsio_disable(struct device *dev, struct nd_namespace_io *nsio) in devm_nsio_disable() argument
276 struct resource *res = &nsio->res; in devm_nsio_disable()
278 devm_memunmap(dev, nsio->addr); in devm_nsio_disable()
279 devm_exit_badblocks(dev, &nsio->bb); in devm_nsio_disable()