]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mmu_notifiers: hoist do_mmu_notifier_register down_write to the caller
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 6 Aug 2019 23:15:38 +0000 (20:15 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 16 Aug 2019 14:44:48 +0000 (11:44 -0300)
commit2385af3c55b5f5cdfafad464a6f3a12228b53dcc
tree7615cdd6e0936d1739b42983f3ec19b81fac1ca0
parent68358ff242bf9e5ea616a958cad6006a2549a164
mm/mmu_notifiers: hoist do_mmu_notifier_register down_write to the caller

This simplifies the code to not have so many one line functions and extra
logic. __mmu_notifier_register() simply becomes the entry point to
register the notifier, and the other one calls it under lock.

Also add a lockdep_assert to check that the callers are holding the lock
as expected.

Link: https://lore.kernel.org/r/20190806231548.25242-2-jgg@ziepe.ca
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
mm/mmu_notifier.c