hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/infiniband/hw/mlx4/doorbell.c
....@@ -31,6 +31,7 @@
3131 */
3232
3333 #include <linux/slab.h>
34
+#include <rdma/uverbs_ioctl.h>
3435
3536 #include "mlx4_ib.h"
3637
....@@ -41,11 +42,13 @@
4142 int refcnt;
4243 };
4344
44
-int mlx4_ib_db_map_user(struct mlx4_ib_ucontext *context, unsigned long virt,
45
+int mlx4_ib_db_map_user(struct ib_udata *udata, unsigned long virt,
4546 struct mlx4_db *db)
4647 {
4748 struct mlx4_ib_user_db_page *page;
4849 int err = 0;
50
+ struct mlx4_ib_ucontext *context = rdma_udata_to_drv_context(
51
+ udata, struct mlx4_ib_ucontext, ibucontext);
4952
5053 mutex_lock(&context->db_page_mutex);
5154
....@@ -61,8 +64,8 @@
6164
6265 page->user_virt = (virt & PAGE_MASK);
6366 page->refcnt = 0;
64
- page->umem = ib_umem_get(&context->ibucontext, virt & PAGE_MASK,
65
- PAGE_SIZE, 0, 0);
67
+ page->umem = ib_umem_get(context->ibucontext.device, virt & PAGE_MASK,
68
+ PAGE_SIZE, 0);
6669 if (IS_ERR(page->umem)) {
6770 err = PTR_ERR(page->umem);
6871 kfree(page);