vfio/spapr_tce: use mmgrab
authorJulia Lawall <Julia.Lawall@inria.fr>
Sun, 29 Dec 2019 15:42:57 +0000 (16:42 +0100)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 7 Jan 2020 20:03:12 +0000 (13:03 -0700)
Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
helper") and most of the kernel was updated to use it. Update a
remaining file.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

<smpl>
@@ expression e; @@
- atomic_inc(&e->mm_count);
+ mmgrab(e);
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_spapr_tce.c

index 26cef65..16b3adc 100644 (file)
@@ -79,7 +79,7 @@ static long tce_iommu_mm_set(struct tce_container *container)
        }
        BUG_ON(!current->mm);
        container->mm = current->mm;
-       atomic_inc(&container->mm->mm_count);
+       mmgrab(container->mm);
 
        return 0;
 }