summaryrefslogtreecommitdiff
path: root/drivers/dax
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-26 15:27:09 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-07-02 20:32:44 +0300
commitd8668bb0451c3c45b59dbcde2654e0539aad1d2a (patch)
treef3a7eddbdcab1fbb8fb531eee1ae2c218700e711 /drivers/dax
parent1e240e8d4a7d92232b6214e02a0a4197a53afd6c (diff)
downloadlinux-d8668bb0451c3c45b59dbcde2654e0539aad1d2a.tar.xz
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 'drivers/dax')
-rw-r--r--drivers/dax/device.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index f390083a64d7..b5257038c188 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -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,