diff options
author | Shamir Rabinovitch <shamir.rabinovitch@oracle.com> | 2019-02-07 18:44:47 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-02-15 11:16:21 -0700 |
commit | 3d9dfd060391928bd615db62ecddea5e1255edfd (patch) | |
tree | 0784bbace18b2640ac0da56097b90e8a3f7eedf6 /drivers/infiniband/core/uverbs_main.c | |
parent | 0dd9ce18b9f315878894351595a53dd81fdd8598 (diff) |
IB/uverbs: Add ib_ucontext to uverbs_attr_bundle sent from ioctl and cmd flows
Add ib_ucontext to the uverbs_attr_bundle sent down the iocl and cmd flows
as soon as the flow has ib_uobject.
In addition, remove rdma_get_ucontext helper function that is only used by
ib_umem_get.
Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.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.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index accc61cc93ac..70b7d80431a9 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -101,30 +101,6 @@ struct ib_ucontext *ib_uverbs_get_ucontext_file(struct ib_uverbs_file *ufile) } EXPORT_SYMBOL(ib_uverbs_get_ucontext_file); -/* rdma_get_ucontext - Return the ucontext from a udata - * @udata: The udata to get the context from - * - * This can only be called from within a uapi method that was passed ib_udata - * as a parameter. It returns the ucontext associated with the udata, or ERR_PTR - * if the udata is NULL or the ucontext has been disassociated. - */ -struct ib_ucontext *rdma_get_ucontext(struct ib_udata *udata) -{ - if (!udata) - return ERR_PTR(-EIO); - - /* - * FIXME: Really all cases that get here with a udata will have - * already called ib_uverbs_get_ucontext_file, or located a uobject - * that points to a ucontext. We could store that result in the udata - * so this function can't fail. - */ - return ib_uverbs_get_ucontext_file( - container_of(udata, struct uverbs_attr_bundle, driver_udata) - ->ufile); -} -EXPORT_SYMBOL(rdma_get_ucontext); - int uverbs_dealloc_mw(struct ib_mw *mw) { struct ib_pd *pd = mw->pd; @@ -719,6 +695,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, memset(bundle.attr_present, 0, sizeof(bundle.attr_present)); bundle.ufile = file; + bundle.context = NULL; /* only valid if bundle has uobject */ if (!method_elm->is_ex) { size_t in_len = hdr.in_words * 4 - sizeof(hdr); size_t out_len = hdr.out_words * 4; |