diff options
author | Christoph Hellwig <hch@lst.de> | 2015-12-23 21:12:54 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-23 22:29:06 +0300 |
commit | ab67ed8de0250e9ad7956ff4d98c3c98858b6c3c (patch) | |
tree | 57db1670b47a399a42277568be2f45e4b886fb74 /drivers/infiniband/core/verbs.c | |
parent | 7cf9ff643b7f709173ca6ff6376fdff5b8d16124 (diff) | |
download | linux-ab67ed8de0250e9ad7956ff4d98c3c98858b6c3c.tar.xz |
IB: remove the write-only usecnt field from struct ib_mr
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@sandisk.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index c5e0f07a7f82..072b94df870a 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1345,7 +1345,6 @@ struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags) mr->pd = pd; mr->uobject = NULL; atomic_inc(&pd->usecnt); - atomic_set(&mr->usecnt, 0); } return mr; @@ -1354,13 +1353,9 @@ EXPORT_SYMBOL(ib_get_dma_mr); int ib_dereg_mr(struct ib_mr *mr) { - struct ib_pd *pd; + struct ib_pd *pd = mr->pd; int ret; - if (atomic_read(&mr->usecnt)) - return -EBUSY; - - pd = mr->pd; ret = mr->device->dereg_mr(mr); if (!ret) atomic_dec(&pd->usecnt); @@ -1396,7 +1391,6 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd, mr->pd = pd; mr->uobject = NULL; atomic_inc(&pd->usecnt); - atomic_set(&mr->usecnt, 0); } return mr; |