summary refs log tree commit diff
path: root/include/rdma
diff options
context:
space:
mode:
authorChengchang Tang <tangchengchang@huawei.com>2021-10-28 18:56:40 +0800
committerJason Gunthorpe <jgg@nvidia.com>2021-10-29 14:07:31 -0300
commit6d202d9f70a33560ab62b81da2b062c936437e54 (patch)
tree80a83b856239960ac9dcbc09cb1cfb55d28bd64f /include/rdma
parent4892298c3a33d965cd0d34ffd66b79b45abdf9b7 (diff)
downloadlinux-6d202d9f70a33560ab62b81da2b062c936437e54.tar.gz
RDMA/hns: Use the core code to manage the fixed mmap entries
Add a new implementation for mmap by using the new mmap entry API. This
makes way for further use of the dynamic mmap allocator in this driver.

Link: https://lore.kernel.org/r/20211028105640.1056-1-liangwenpeng@huawei.com
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 61c73adccbbd..6e9ad656ecb7 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2914,6 +2914,15 @@ int rdma_user_mmap_entry_insert_range(struct ib_ucontext *ucontext,
 				      size_t length, u32 min_pgoff,
 				      u32 max_pgoff);
 
+static inline int
+rdma_user_mmap_entry_insert_exact(struct ib_ucontext *ucontext,
+				  struct rdma_user_mmap_entry *entry,
+				  size_t length, u32 pgoff)
+{
+	return rdma_user_mmap_entry_insert_range(ucontext, entry, length, pgoff,
+						 pgoff);
+}
+
 struct rdma_user_mmap_entry *
 rdma_user_mmap_entry_get_pgoff(struct ib_ucontext *ucontext,
 			       unsigned long pgoff);