summaryrefslogtreecommitdiffstats
path: root/mm/hmm.c
diff options
context:
space:
mode:
authorChristoph Hellwig2019-06-26 14:27:09 +0200
committerJason Gunthorpe2019-07-02 19:32:44 +0200
commitd8668bb0451c3c45b59dbcde2654e0539aad1d2a (patch)
treef3a7eddbdcab1fbb8fb531eee1ae2c218700e711 /mm/hmm.c
parentmemremap: move dev_pagemap callbacks into a separate structure (diff)
downloadkernel-qcow2-linux-d8668bb0451c3c45b59dbcde2654e0539aad1d2a.tar.gz
kernel-qcow2-linux-d8668bb0451c3c45b59dbcde2654e0539aad1d2a.tar.xz
kernel-qcow2-linux-d8668bb0451c3c45b59dbcde2654e0539aad1d2a.zip
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 <logang@deltatee.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Tested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'mm/hmm.c')
-rw-r--r--mm/hmm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/hmm.c b/mm/hmm.c
index 583a02a16872..987793fba923 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -1352,18 +1352,18 @@ static void hmm_devmem_ref_release(struct percpu_ref *ref)
complete(&devmem->completion);
}
-static void hmm_devmem_ref_exit(struct percpu_ref *ref)
+static void hmm_devmem_ref_exit(struct dev_pagemap *pgmap)
{
struct hmm_devmem *devmem;
- devmem = container_of(ref, struct hmm_devmem, ref);
+ devmem = container_of(pgmap, struct hmm_devmem, pagemap);
wait_for_completion(&devmem->completion);
- percpu_ref_exit(ref);
+ percpu_ref_exit(pgmap->ref);
}
-static void hmm_devmem_ref_kill(struct percpu_ref *ref)
+static void hmm_devmem_ref_kill(struct dev_pagemap *pgmap)
{
- percpu_ref_kill(ref);
+ percpu_ref_kill(pgmap->ref);
}
static vm_fault_t hmm_devmem_fault(struct vm_area_struct *vma,