diff options
| author | Jiri Pirko <jiri@nvidia.com> | 2026-05-29 15:42:58 +0200 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-05-29 20:19:57 -0300 |
| commit | 28fb701c642b8ff73e08fabef9265b508509d820 (patch) | |
| tree | de11fe0bab69fa7c53a6fbddd5c2ff5d20272986 | |
| parent | af841056860d2dc2754a122fb79abbe92f3752f3 (diff) | |
| download | linux-stable-28fb701c642b8ff73e08fabef9265b508509d820.tar.gz linux-stable-28fb701c642b8ff73e08fabef9265b508509d820.zip | |
RDMA/umem: Split ib_umem_get_va() into a thin wrapper around __ib_umem_get_va()
The follow-up patch is going to introduce ib_umem_get_desc(),
the canonical desc-to-umem helper, which needs to pin a userspace VA
without going through the exported ib_umem_get_va() helper so later on
ib_umem_get_va() would use the ib_umem_get_desc() flow too.
Move the existing ib_umem_get_va() to a static __ib_umem_get_va()
and have ib_umem_get_va() as a thin wrapper that calls it.
Link: https://patch.msgid.link/r/20260529134312.2836341-3-jiri@resnulli.us
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
| -rw-r--r-- | drivers/infiniband/core/umem.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index b253090bb1ab..0056f23af57b 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -153,16 +153,9 @@ unsigned long ib_umem_find_best_pgsz(struct ib_umem *umem, } EXPORT_SYMBOL(ib_umem_find_best_pgsz); -/** - * ib_umem_get_va - Pin and DMA map userspace memory. - * - * @device: IB device to connect UMEM - * @addr: userspace virtual address to start at - * @size: length of region to pin - * @access: IB_ACCESS_xxx flags for memory being pinned - */ -struct ib_umem *ib_umem_get_va(struct ib_device *device, unsigned long addr, - size_t size, int access) +static struct ib_umem *__ib_umem_get_va(struct ib_device *device, + unsigned long addr, size_t size, + int access) { struct ib_umem *umem; struct page **page_list; @@ -275,6 +268,20 @@ umem_kfree: } return ret ? ERR_PTR(ret) : umem; } + +/** + * ib_umem_get_va - Pin and DMA map userspace memory. + * + * @device: IB device to connect UMEM + * @addr: userspace virtual address to start at + * @size: length of region to pin + * @access: IB_ACCESS_xxx flags for memory being pinned + */ +struct ib_umem *ib_umem_get_va(struct ib_device *device, unsigned long addr, + size_t size, int access) +{ + return __ib_umem_get_va(device, addr, size, access); +} EXPORT_SYMBOL(ib_umem_get_va); /** |
