Skip to content

Commit 7dc08dc

Browse files
yishaihjgunthorpe
authored andcommitted
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>
1 parent e502a86 commit 7dc08dc

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/infiniband/core/uverbs_main.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
138138
static void ib_uverbs_add_one(struct ib_device *device);
139139
static void ib_uverbs_remove_one(struct ib_device *device, void *client_data);
140140

141+
struct ib_ucontext *ib_uverbs_get_ucontext(struct ib_uverbs_file *ufile)
142+
{
143+
return ufile->ucontext;
144+
}
145+
EXPORT_SYMBOL(ib_uverbs_get_ucontext);
146+
141147
int uverbs_dealloc_mw(struct ib_mw *mw)
142148
{
143149
struct ib_pd *pd = mw->pd;

‎include/rdma/ib_verbs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4120,4 +4120,6 @@ ib_get_vector_affinity(struct ib_device *device, int comp_vector)
41204120
*/
41214121
void rdma_roce_rescan_device(struct ib_device *ibdev);
41224122

4123+
struct ib_ucontext *ib_uverbs_get_ucontext(struct ib_uverbs_file *ufile);
4124+
41234125
#endif /* IB_VERBS_H */

0 commit comments

Comments
 (0)