IB/core: rename pd->local_mr to pd->__internal_mr
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Sep 2016 10:56:16 +0000 (12:56 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 23 Sep 2016 17:47:44 +0000 (13:47 -0400)
This has two reasons: a) to clearly mark that drivers don't have any
business using it, and b) because we're going to use it for the
(dangerous) global rkey soon, so that drivers don't create on themselves.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h

index f6647318138d77cf7d621dfc9f66515ad9a4b9f9..fe784a90881730d3f13ffcb5428bbb8c30ccfa89 100644 (file)
@@ -571,7 +571,7 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
 
        pd->device  = ib_dev;
        pd->uobject = uobj;
-       pd->local_mr = NULL;
+       pd->__internal_mr = NULL;
        atomic_set(&pd->usecnt, 0);
 
        uobj->object = pd;
index f2b776efab3a3ee1ffdc306ef7af01d3093e9ed7..9159ea5ad821818561d9665c93133ae8fb270062 100644 (file)
@@ -237,7 +237,7 @@ struct ib_pd *ib_alloc_pd(struct ib_device *device)
 
        pd->device = device;
        pd->uobject = NULL;
-       pd->local_mr = NULL;
+       pd->__internal_mr = NULL;
        atomic_set(&pd->usecnt, 0);
 
        if (device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
@@ -251,8 +251,8 @@ struct ib_pd *ib_alloc_pd(struct ib_device *device)
                        return (struct ib_pd *)mr;
                }
 
-               pd->local_mr = mr;
-               pd->local_dma_lkey = pd->local_mr->lkey;
+               pd->__internal_mr = mr;
+               pd->local_dma_lkey = pd->__internal_mr->lkey;
        }
        return pd;
 }
@@ -270,10 +270,10 @@ void ib_dealloc_pd(struct ib_pd *pd)
 {
        int ret;
 
-       if (pd->local_mr) {
-               ret = ib_dereg_mr(pd->local_mr);
+       if (pd->__internal_mr) {
+               ret = ib_dereg_mr(pd->__internal_mr);
                WARN_ON(ret);
-               pd->local_mr = NULL;
+               pd->__internal_mr = NULL;
        }
 
        /* uverbs manipulates usecnt with proper locking, while the kabi
index 8e90dd28bb7536d16058d711b096f8125bd42874..38a08dae49c4c420c3ba98f8c1c7f613abcadbb6 100644 (file)
@@ -1373,7 +1373,11 @@ struct ib_pd {
        struct ib_device       *device;
        struct ib_uobject      *uobject;
        atomic_t                usecnt; /* count all resources */
-       struct ib_mr           *local_mr;
+
+       /*
+        * Implementation details of the RDMA core, don't use in drivers:
+        */
+       struct ib_mr           *__internal_mr;
 };
 
 struct ib_xrcd {