提交 f84dfa26 编写于 作者: S Sebastian Sanchez 提交者: Doug Ledford

IB/hfi1: Use reference count wrapper for MRs

Some parts of the code don't use the standard driver
wrapper for memory region reference counters. Use the
standard driver wrapper throughout the code.
Reviewed-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: NSebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 b44980f8
...@@ -793,7 +793,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd, ...@@ -793,7 +793,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
mr = rcu_dereference(dev->dma_mr); mr = rcu_dereference(dev->dma_mr);
if (!mr) if (!mr)
goto bail; goto bail;
atomic_inc(&mr->refcount); rvt_get_mr(mr);
rcu_read_unlock(); rcu_read_unlock();
isge->mr = mr; isge->mr = mr;
...@@ -814,7 +814,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd, ...@@ -814,7 +814,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
off + sge->length > mr->length || off + sge->length > mr->length ||
(mr->access_flags & acc) != acc)) (mr->access_flags & acc) != acc))
goto bail; goto bail;
atomic_inc(&mr->refcount); rvt_get_mr(mr);
rcu_read_unlock(); rcu_read_unlock();
off += mr->offset; off += mr->offset;
...@@ -892,7 +892,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge, ...@@ -892,7 +892,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
mr = rcu_dereference(rdi->dma_mr); mr = rcu_dereference(rdi->dma_mr);
if (!mr) if (!mr)
goto bail; goto bail;
atomic_inc(&mr->refcount); rvt_get_mr(mr);
rcu_read_unlock(); rcu_read_unlock();
sge->mr = mr; sge->mr = mr;
...@@ -913,7 +913,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge, ...@@ -913,7 +913,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
if (unlikely(vaddr < mr->iova || off + len > mr->length || if (unlikely(vaddr < mr->iova || off + len > mr->length ||
(mr->access_flags & acc) == 0)) (mr->access_flags & acc) == 0))
goto bail; goto bail;
atomic_inc(&mr->refcount); rvt_get_mr(mr);
rcu_read_unlock(); rcu_read_unlock();
off += mr->offset; off += mr->offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册