mmap locking API: convert mmap_sem call sites missed by coccinelle
Convert the last few remaining mmap_sem rwsem calls to use the new mmap locking API. These were missed by coccinelle for some reason (I think coccinelle does not support some of the preprocessor constructs in these files ?) [akpm@linux-foundation.org: convert linux-next leftovers] [akpm@linux-foundation.org: more linux-next leftovers] [akpm@linux-foundation.org: more linux-next leftovers] Signed-off-by: Michel Lespinasse <walken@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com> Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Jerome Glisse <jglisse@redhat.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Liam Howlett <Liam.Howlett@oracle.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ying Han <yinghan@google.com> Link: http://lkml.kernel.org/r/20200520052908.204642-6-walken@google.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
d8ed45c5dc
commit
89154dd531
@@ -245,9 +245,9 @@ static int dmirror_range_fault(struct dmirror *dmirror,
|
||||
}
|
||||
|
||||
range->notifier_seq = mmu_interval_read_begin(range->notifier);
|
||||
down_read(&mm->mmap_sem);
|
||||
mmap_read_lock(mm);
|
||||
ret = hmm_range_fault(range);
|
||||
up_read(&mm->mmap_sem);
|
||||
mmap_read_unlock(mm);
|
||||
if (ret) {
|
||||
if (ret == -EBUSY)
|
||||
continue;
|
||||
@@ -686,7 +686,7 @@ static int dmirror_migrate(struct dmirror *dmirror,
|
||||
if (!mmget_not_zero(mm))
|
||||
return -EINVAL;
|
||||
|
||||
down_read(&mm->mmap_sem);
|
||||
mmap_read_lock(mm);
|
||||
for (addr = start; addr < end; addr = next) {
|
||||
vma = find_vma(mm, addr);
|
||||
if (!vma || addr < vma->vm_start ||
|
||||
@@ -713,7 +713,7 @@ static int dmirror_migrate(struct dmirror *dmirror,
|
||||
dmirror_migrate_finalize_and_map(&args, dmirror);
|
||||
migrate_vma_finalize(&args);
|
||||
}
|
||||
up_read(&mm->mmap_sem);
|
||||
mmap_read_unlock(mm);
|
||||
mmput(mm);
|
||||
|
||||
/* Return the migrated data for verification. */
|
||||
@@ -733,7 +733,7 @@ static int dmirror_migrate(struct dmirror *dmirror,
|
||||
return ret;
|
||||
|
||||
out:
|
||||
up_read(&mm->mmap_sem);
|
||||
mmap_read_unlock(mm);
|
||||
mmput(mm);
|
||||
return ret;
|
||||
}
|
||||
@@ -825,9 +825,9 @@ static int dmirror_range_snapshot(struct dmirror *dmirror,
|
||||
|
||||
range->notifier_seq = mmu_interval_read_begin(range->notifier);
|
||||
|
||||
down_read(&mm->mmap_sem);
|
||||
mmap_read_lock(mm);
|
||||
ret = hmm_range_fault(range);
|
||||
up_read(&mm->mmap_sem);
|
||||
mmap_read_unlock(mm);
|
||||
if (ret) {
|
||||
if (ret == -EBUSY)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user