aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2018-06-17 12:59:59 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-06-19 10:53:02 -0600
commit7dc08dcfc8c86cb4457e383734ff6844ddaff876 (patch)
treed7ca5c177c38c05e4ff48801f1a1d461f5b498d7 /drivers/infiniband/core/uverbs_main.c
parentIB/core: Introduce DECLARE_UVERBS_GLOBAL_METHODS (diff)
downloadlinux-dev-7dc08dcfc8c86cb4457e383734ff6844ddaff876.tar.xz
linux-dev-7dc08dcfc8c86cb4457e383734ff6844ddaff876.zip
IB/core: Expose ib_ucontext from a given ib_uverbs_file
Drivers that use the IOCTL API may have the ib_uverbs_file and need a way to get the related ib_ucontext from it, this is enabled by this patch. Downstream patches from this series will use it. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r--drivers/infiniband/core/uverbs_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 3ae2339dd27a..f5f4bfb59705 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -138,6 +138,12 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
static void ib_uverbs_add_one(struct ib_device *device);
static void ib_uverbs_remove_one(struct ib_device *device, void *client_data);
+struct ib_ucontext *ib_uverbs_get_ucontext(struct ib_uverbs_file *ufile)
+{
+ return ufile->ucontext;
+}
+EXPORT_SYMBOL(ib_uverbs_get_ucontext);
+
int uverbs_dealloc_mw(struct ib_mw *mw)
{
struct ib_pd *pd = mw->pd;