Skip to content

Commit

Permalink
IB/core: Expose ib_ucontext from a given ib_uverbs_file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yishai Hadas authored and Jason Gunthorpe committed Jun 19, 2018
1 parent e502a86 commit 7dc08dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4120,4 +4120,6 @@ ib_get_vector_affinity(struct ib_device *device, int comp_vector)
*/
void rdma_roce_rescan_device(struct ib_device *ibdev);

struct ib_ucontext *ib_uverbs_get_ucontext(struct ib_uverbs_file *ufile);

#endif /* IB_VERBS_H */

0 comments on commit 7dc08dc

Please sign in to comment.