drivers/IB,usnic: reduce scope of mmap_sem
authorDavidlohr Bueso <dave@stgolabs.net>
Wed, 6 Feb 2019 17:59:19 +0000 (09:59 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 7 Feb 2019 19:54:02 +0000 (12:54 -0700)
commit8ea1f989aa07a095cbf4aabbf9be7c3a18ce31bf
treebb084a30047577dd89ba2b91b96c6ec248f54759
parent0e15c253363e9a8824e6b9c9fc17468eb924cebd
drivers/IB,usnic: reduce scope of mmap_sem

usnic_uiom_get_pages() uses gup_longterm() so we cannot really get rid of
mmap_sem altogether in the driver, but we can get rid of some complexity
that mmap_sem brings with only pinned_vm.  We can get rid of the wq
altogether as we no longer need to defer work to unpin pages as the
counter is now atomic. We also share the lock.

Acked-by: Parvi Kaustubhi <pkaustub@cisco.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/usnic/usnic_ib_main.c
drivers/infiniband/hw/usnic/usnic_uiom.c
drivers/infiniband/hw/usnic/usnic_uiom.h