[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: resolve name conflicts with ib_core

Konstantin Khorenko khorenko at virtuozzo.com
Tue Mar 31 18:13:30 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1062.12.1.vz7.145.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.12.1.vz7.145.5
------>
commit dfffac0a700ee27706eca7dee6af834700448627
Author: Ildar Ismagilov <ildar.ismagilov at virtuozzo.com>
Date:   Tue Mar 31 18:13:29 2020 +0300

    fs/fuse kio: resolve name conflicts with ib_core
    
    Rename ib_mr_pool_{init,destroy,get,set} to avoid conflicts
    with names from include/rdma/mr_pool.h
    
    Fixes: 867c0e15fddf (fs/fuse kio: implement support RDMA transport)
    
    Signed-off-by: Ildar Ismagilov <ildar.ismagilov at virtuozzo.com>
    
    Signed-off-by: Ildar Ismagilov <ildar.ismagilov at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_rdma_io.c | 10 +++++-----
 fs/fuse/kio/pcs/pcs_rdma_rw.c | 28 ++++++++++++++--------------
 fs/fuse/kio/pcs/pcs_rdma_rw.h | 24 ++++++++++++------------
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_rdma_io.c b/fs/fuse/kio/pcs/pcs_rdma_io.c
index 032c26eaf7f66..7b42cdcd629a2 100644
--- a/fs/fuse/kio/pcs/pcs_rdma_io.c
+++ b/fs/fuse/kio/pcs/pcs_rdma_io.c
@@ -105,7 +105,7 @@ struct pcs_rdma_device {
 	struct list_head free_txs; /* list head of free TX frames */
 	int free_txs_cnt;
 
-	struct ib_mr_pool ib_mr_pool;
+	struct pcs_ib_mr_pool ib_mr_pool;
 	struct pcs_rdma_mr_pool sd_mr_pool;
 	struct pcs_rdma_mr_pool rd_mr_pool;
 };
@@ -1123,10 +1123,10 @@ static struct pcs_rdma_device *pcs_rdma_device_create(struct rdma_cm_id *cmid,
 		goto free_bufs;
 	}
 
-	if (ib_mr_pool_init(&dev->ib_mr_pool, dev->pd, IB_MR_TYPE_MEM_REG,
+	if (pcs_ib_mr_pool_init(&dev->ib_mr_pool, dev->pd, IB_MR_TYPE_MEM_REG,
 			    max_num_sg,
 			    queue_depth * 2)) {
-		TRACE("ib_mr_pool_init failed: dev: 0x%p\n", dev);
+		TRACE("pcs_ib_mr_pool_init failed: dev: 0x%p\n", dev);
 		goto free_pd;
 	}
 
@@ -1149,7 +1149,7 @@ static struct pcs_rdma_device *pcs_rdma_device_create(struct rdma_cm_id *cmid,
 free_sd_mr:
 	pcs_rdma_mr_pool_destroy(&dev->sd_mr_pool);
 free_ib_mr:
-	ib_mr_pool_destroy(&dev->ib_mr_pool);
+	pcs_ib_mr_pool_destroy(&dev->ib_mr_pool);
 free_pd:
 	ib_dealloc_pd(dev->pd);
 free_bufs:
@@ -1165,7 +1165,7 @@ static void pcs_rdma_device_destroy(struct pcs_rdma_device *dev)
 
 	pcs_rdma_mr_pool_destroy(&dev->rd_mr_pool);
 	pcs_rdma_mr_pool_destroy(&dev->sd_mr_pool);
-	ib_mr_pool_destroy(&dev->ib_mr_pool);
+	pcs_ib_mr_pool_destroy(&dev->ib_mr_pool);
 
 	ib_dealloc_pd(dev->pd);
 
diff --git a/fs/fuse/kio/pcs/pcs_rdma_rw.c b/fs/fuse/kio/pcs/pcs_rdma_rw.c
index 425498af2f16a..e2a437c025b1f 100644
--- a/fs/fuse/kio/pcs/pcs_rdma_rw.c
+++ b/fs/fuse/kio/pcs/pcs_rdma_rw.c
@@ -177,8 +177,8 @@ void pcs_sgl_buf_destroy(struct pcs_sgl_buf *sbuf)
 	kfree(sbuf->pages);
 }
 
-int ib_mr_pool_init(struct ib_mr_pool *pool, struct ib_pd *pd,
-		    enum ib_mr_type mr_type, u32 max_num_sg, size_t mr_cnt)
+int pcs_ib_mr_pool_init(struct pcs_ib_mr_pool *pool, struct ib_pd *pd,
+			enum ib_mr_type mr_type, u32 max_num_sg, size_t mr_cnt)
 {
 	struct ib_mr *mr;
 	int ret, i;
@@ -205,11 +205,11 @@ int ib_mr_pool_init(struct ib_mr_pool *pool, struct ib_pd *pd,
 	return 0;
 
 fail:
-	ib_mr_pool_destroy(pool);
+	pcs_ib_mr_pool_destroy(pool);
 	return ret;
 }
 
-void ib_mr_pool_destroy(struct ib_mr_pool *pool)
+void pcs_ib_mr_pool_destroy(struct pcs_ib_mr_pool *pool)
 {
 	struct ib_mr *mr, *tmp;
 
@@ -221,7 +221,7 @@ void ib_mr_pool_destroy(struct ib_mr_pool *pool)
 		ib_dereg_mr(mr);
 }
 
-struct ib_mr* ib_mr_pool_get(struct ib_mr_pool *pool)
+struct ib_mr* pcs_ib_mr_pool_get(struct pcs_ib_mr_pool *pool)
 {
 	struct ib_mr *mr;
 	unsigned long flags;
@@ -251,7 +251,7 @@ struct ib_mr* ib_mr_pool_get(struct ib_mr_pool *pool)
 	return mr;
 }
 
-void ib_mr_pool_put(struct ib_mr_pool *pool, struct ib_mr *mr)
+void pcs_ib_mr_pool_put(struct pcs_ib_mr_pool *pool, struct ib_mr *mr)
 {
 	unsigned long flags;
 
@@ -355,7 +355,7 @@ void pcs_rdma_rw_destroy(struct pcs_rdma_rw *rw)
 
 static int pcs_rdma_mr_init_common(struct pcs_rdma_mr *mr, struct ib_device *dev,
 				   struct ib_pd *pd, enum dma_data_direction dir, size_t size,
-				   struct ib_mr_pool *ib_mr_pool)
+				   struct pcs_ib_mr_pool *ib_mr_pool)
 {
 	unsigned long dma_align = dma_get_cache_alignment();
 	struct scatterlist *sg;
@@ -386,7 +386,7 @@ static int pcs_rdma_mr_init_common(struct pcs_rdma_mr *mr, struct ib_device *dev
 	mr->sbuf.sg_cnt = ret;
 
 	if (mr->ib_mr_pool) {
-		mr->mr = RE_NULL(ib_mr_pool_get(mr->ib_mr_pool));
+		mr->mr = RE_NULL(pcs_ib_mr_pool_get(mr->ib_mr_pool));
 		if (!mr->mr) {
 			ret = -ENOMEM;
 			goto fail_dma;
@@ -428,7 +428,7 @@ static int pcs_rdma_mr_init_common(struct pcs_rdma_mr *mr, struct ib_device *dev
 
 fail_mr:
 	if (mr->ib_mr_pool)
-		ib_mr_pool_put(mr->ib_mr_pool, mr->mr);
+		pcs_ib_mr_pool_put(mr->ib_mr_pool, mr->mr);
 	else /* fallback */
 		ib_dereg_mr(mr->mr);
 fail_dma:
@@ -440,7 +440,7 @@ static int pcs_rdma_mr_init_common(struct pcs_rdma_mr *mr, struct ib_device *dev
 int pcs_rdma_mr_init_from_msg(struct pcs_rdma_mr *mr, struct ib_device *dev,
 			      struct ib_pd *pd, enum dma_data_direction dir, struct pcs_msg *msg,
 			      size_t offset, size_t end_offset, gfp_t gfp,
-			      struct ib_mr_pool *ib_mr_pool)
+			      struct pcs_ib_mr_pool *ib_mr_pool)
 {
 	int ret;
 
@@ -459,7 +459,7 @@ int pcs_rdma_mr_init_from_msg(struct pcs_rdma_mr *mr, struct ib_device *dev,
 
 int pcs_rdma_mr_init(struct pcs_rdma_mr *mr, struct ib_device *dev, struct ib_pd *pd,
 		     enum dma_data_direction dir, size_t size, gfp_t gfp,
-		     struct ib_mr_pool *ib_mr_pool)
+		     struct pcs_ib_mr_pool *ib_mr_pool)
 {
 	int ret;
 
@@ -477,7 +477,7 @@ int pcs_rdma_mr_init(struct pcs_rdma_mr *mr, struct ib_device *dev, struct ib_pd
 void pcs_rdma_mr_destroy(struct pcs_rdma_mr *mr)
 {
 	if (mr->ib_mr_pool)
-		ib_mr_pool_put(mr->ib_mr_pool, mr->mr);
+		pcs_ib_mr_pool_put(mr->ib_mr_pool, mr->mr);
 	else /* fallback */
 		ib_dereg_mr(mr->mr);
 	ib_dma_unmap_sg(mr->dev, mr->sbuf.sgl, mr->sbuf.sg_cnt, mr->dir);
@@ -486,7 +486,7 @@ void pcs_rdma_mr_destroy(struct pcs_rdma_mr *mr)
 
 struct pcs_rdma_mr* pcs_rdma_mr_alloc(struct ib_device *dev, struct ib_pd *pd,
 				      enum dma_data_direction dir, size_t size, gfp_t gfp,
-				      struct ib_mr_pool *ib_mr_pool)
+				      struct pcs_ib_mr_pool *ib_mr_pool)
 {
 	struct pcs_rdma_mr *mr;
 	int ret;
@@ -601,7 +601,7 @@ int pcs_rdma_mr_sync_for_msg(struct pcs_rdma_mr *mr, struct pcs_msg *msg,
 
 int pcs_rdma_mr_pool_init(struct pcs_rdma_mr_pool *pool, size_t mr_size,
 			  size_t mr_cnt, struct ib_device *dev, struct ib_pd *pd,
-			  enum dma_data_direction dir, gfp_t gfp, struct ib_mr_pool *ib_mr_pool)
+			  enum dma_data_direction dir, gfp_t gfp, struct pcs_ib_mr_pool *ib_mr_pool)
 {
 	struct pcs_rdma_mr *mr;
 	int ret, i;
diff --git a/fs/fuse/kio/pcs/pcs_rdma_rw.h b/fs/fuse/kio/pcs/pcs_rdma_rw.h
index 0156a7458f152..1b1114239f39f 100644
--- a/fs/fuse/kio/pcs/pcs_rdma_rw.h
+++ b/fs/fuse/kio/pcs/pcs_rdma_rw.h
@@ -53,7 +53,7 @@ int pcs_sgl_buf_init_from_msg(struct pcs_sgl_buf *sbuf, struct pcs_msg *msg,
 int pcs_sgl_buf_init(struct pcs_sgl_buf *sbuf, size_t size, gfp_t gfp);
 void pcs_sgl_buf_destroy(struct pcs_sgl_buf *sbuf);
 
-struct ib_mr_pool
+struct pcs_ib_mr_pool
 {
 	struct ib_pd *pd;
 	enum ib_mr_type mr_type;
@@ -66,12 +66,12 @@ struct ib_mr_pool
 	size_t used_mrs;
 };
 
-int ib_mr_pool_init(struct ib_mr_pool *pool, struct ib_pd *pd,
-		    enum ib_mr_type mr_type, u32 max_num_sg, size_t mr_cnt);
-void ib_mr_pool_destroy(struct ib_mr_pool *pool);
+int pcs_ib_mr_pool_init(struct pcs_ib_mr_pool *pool, struct ib_pd *pd,
+			enum ib_mr_type mr_type, u32 max_num_sg, size_t mr_cnt);
+void pcs_ib_mr_pool_destroy(struct pcs_ib_mr_pool *pool);
 
-struct ib_mr* ib_mr_pool_get(struct ib_mr_pool *pool);
-void ib_mr_pool_put(struct ib_mr_pool *pool, struct ib_mr *mr);
+struct ib_mr* pcs_ib_mr_pool_get(struct pcs_ib_mr_pool *pool);
+void pcs_ib_mr_pool_put(struct pcs_ib_mr_pool *pool, struct ib_mr *mr);
 
 struct pcs_rdma_rw
 {
@@ -99,7 +99,7 @@ struct pcs_rdma_mr
 	struct ib_pd *pd;
 	enum dma_data_direction dir;
 	size_t size;
-	struct ib_mr_pool *ib_mr_pool;
+	struct pcs_ib_mr_pool *ib_mr_pool;
 
 	struct pcs_sgl_buf sbuf;
 	struct ib_mr *mr;
@@ -114,15 +114,15 @@ struct pcs_rdma_mr
 int pcs_rdma_mr_init_from_msg(struct pcs_rdma_mr *mr, struct ib_device *dev,
 			      struct ib_pd *pd, enum dma_data_direction dir, struct pcs_msg *msg,
 			      size_t offset, size_t end_offset, gfp_t gfp,
-			      struct ib_mr_pool *ib_mr_pool);
+			      struct pcs_ib_mr_pool *ib_mr_pool);
 int pcs_rdma_mr_init(struct pcs_rdma_mr *mr, struct ib_device *dev,
 		     struct ib_pd *pd, enum dma_data_direction dir, size_t size,
-		     gfp_t gfp, struct ib_mr_pool *ib_mr_pool);
+		     gfp_t gfp, struct pcs_ib_mr_pool *ib_mr_pool);
 void pcs_rdma_mr_destroy(struct pcs_rdma_mr *mr);
 
 struct pcs_rdma_mr* pcs_rdma_mr_alloc(struct ib_device *dev, struct ib_pd *pd,
 				      enum dma_data_direction dir, size_t size, gfp_t gfp,
-				      struct ib_mr_pool *ib_mr_pool);
+				      struct pcs_ib_mr_pool *ib_mr_pool);
 void pcs_rdma_mr_free(struct pcs_rdma_mr *mr);
 
 void pcs_rdma_mr_sync_for_cpu(struct pcs_rdma_mr *mr, size_t size);
@@ -139,7 +139,7 @@ struct pcs_rdma_mr_pool
 	struct ib_pd *pd;
 	enum dma_data_direction dir;
 	gfp_t gfp;
-	struct ib_mr_pool *ib_mr_pool;
+	struct pcs_ib_mr_pool *ib_mr_pool;
 
 	spinlock_t lock;
 
@@ -150,7 +150,7 @@ struct pcs_rdma_mr_pool
 int pcs_rdma_mr_pool_init(struct pcs_rdma_mr_pool *pool, size_t mr_size,
 			  size_t mr_cnt, struct ib_device *dev, struct ib_pd *pd,
 			  enum dma_data_direction dir, gfp_t gfp,
-			  struct ib_mr_pool *ib_mr_pool);
+			  struct pcs_ib_mr_pool *ib_mr_pool);
 void pcs_rdma_mr_pool_destroy(struct pcs_rdma_mr_pool *pool);
 
 struct pcs_rdma_mr* pcs_rdma_mr_pool_get(struct pcs_rdma_mr_pool *pool);


More information about the Devel mailing list