Lines Matching refs:pgmap
101 struct dev_pagemap *pgmap = _pgmap; in nfit_test_kill() local
103 WARN_ON(!pgmap || !pgmap->ref); in nfit_test_kill()
105 if (pgmap->ops && pgmap->ops->kill) in nfit_test_kill()
106 pgmap->ops->kill(pgmap); in nfit_test_kill()
108 percpu_ref_kill(pgmap->ref); in nfit_test_kill()
110 if (pgmap->ops && pgmap->ops->cleanup) { in nfit_test_kill()
111 pgmap->ops->cleanup(pgmap); in nfit_test_kill()
113 wait_for_completion(&pgmap->done); in nfit_test_kill()
114 percpu_ref_exit(pgmap->ref); in nfit_test_kill()
120 struct dev_pagemap *pgmap = in dev_pagemap_percpu_release() local
123 complete(&pgmap->done); in dev_pagemap_percpu_release()
126 void *__wrap_devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap) in __wrap_devm_memremap_pages() argument
129 resource_size_t offset = pgmap->range.start; in __wrap_devm_memremap_pages()
133 return devm_memremap_pages(dev, pgmap); in __wrap_devm_memremap_pages()
135 if (!pgmap->ref) { in __wrap_devm_memremap_pages()
136 if (pgmap->ops && (pgmap->ops->kill || pgmap->ops->cleanup)) in __wrap_devm_memremap_pages()
139 init_completion(&pgmap->done); in __wrap_devm_memremap_pages()
140 error = percpu_ref_init(&pgmap->internal_ref, in __wrap_devm_memremap_pages()
144 pgmap->ref = &pgmap->internal_ref; in __wrap_devm_memremap_pages()
146 if (!pgmap->ops || !pgmap->ops->kill || !pgmap->ops->cleanup) { in __wrap_devm_memremap_pages()
152 error = devm_add_action_or_reset(dev, nfit_test_kill, pgmap); in __wrap_devm_memremap_pages()