memremap: pass a struct dev_pagemap to ->kill and ->cleanup

Passing the actual typed structure leads to more understandable code
vs just passing the ref member.

Reported-by: Logan Gunthorpe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Dan Williams <[email protected]>
Tested-by: Dan Williams <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
Christoph Hellwig 2019-06-26 14:27:09 +02:00 • committed by Jason Gunthorpe
commit d8668bb045
7 changed files with 33 additions and 32 deletions

View file

@ -27,21 +27,21 @@ static void dev_dax_percpu_release(struct percpu_ref *ref)
complete(&dev_dax->cmp);
}
static void dev_dax_percpu_exit(struct percpu_ref *ref)
static void dev_dax_percpu_exit(struct dev_pagemap *pgmap)
{
struct dev_dax *dev_dax = ref_to_dev_dax(ref);
struct dev_dax *dev_dax = container_of(pgmap, struct dev_dax, pgmap);
dev_dbg(&dev_dax->dev, "%s\n", __func__);
wait_for_completion(&dev_dax->cmp);
percpu_ref_exit(ref);
percpu_ref_exit(pgmap->ref);
}
static void dev_dax_percpu_kill(struct percpu_ref *ref)
static void dev_dax_percpu_kill(struct dev_pagemap *pgmap)
{
struct dev_dax *dev_dax = ref_to_dev_dax(ref);
struct dev_dax *dev_dax = container_of(pgmap, struct dev_dax, pgmap);
dev_dbg(&dev_dax->dev, "%s\n", __func__);
percpu_ref_kill(ref);
percpu_ref_kill(pgmap->ref);
}
static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,