aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ehca/ehca_uverbs.c
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@de.ibm.com>2008-04-17 00:01:13 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:01:13 -0400
commitf4f82994d1ea0cd01058a245985f1eb5e569e6d3 (patch)
tree67244352967536dd4330928cd53c3e37011fa2ec /drivers/infiniband/hw/ehca/ehca_uverbs.c
parent1e89a1946cfd906d12eff437d2a76b3aa7f5e731 (diff)
IB/ehca: Remove tgid checking
Pavel Emelyanov <xemul@openvz.org> mentioned in <http://lkml.org/lkml/2008/3/17/131> that the task_struct->tgid field is about to become deprecated, so the uses in the ehca driver need to be fixed up. However, all the uses in ehca are for some object ownership checking that is not really needed, and anyway is implementing a policy that should be in common code rather than a low-level driver. So just remove all the checks. Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_uverbs.c')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_uverbs.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_uverbs.c b/drivers/infiniband/hw/ehca/ehca_uverbs.c
index 5234d6c15c49..1b07f2beafaf 100644
--- a/drivers/infiniband/hw/ehca/ehca_uverbs.c
+++ b/drivers/infiniband/hw/ehca/ehca_uverbs.c
@@ -40,8 +40,6 @@
40 * POSSIBILITY OF SUCH DAMAGE. 40 * POSSIBILITY OF SUCH DAMAGE.
41 */ 41 */
42 42
43#include <asm/current.h>
44
45#include "ehca_classes.h" 43#include "ehca_classes.h"
46#include "ehca_iverbs.h" 44#include "ehca_iverbs.h"
47#include "ehca_mrmw.h" 45#include "ehca_mrmw.h"
@@ -253,11 +251,9 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
253 u32 idr_handle = fileoffset & 0x1FFFFFF; 251 u32 idr_handle = fileoffset & 0x1FFFFFF;
254 u32 q_type = (fileoffset >> 27) & 0x1; /* CQ, QP,... */ 252 u32 q_type = (fileoffset >> 27) & 0x1; /* CQ, QP,... */
255 u32 rsrc_type = (fileoffset >> 25) & 0x3; /* sq,rq,cmnd_window */ 253 u32 rsrc_type = (fileoffset >> 25) & 0x3; /* sq,rq,cmnd_window */
256 u32 cur_pid = current->tgid;
257 u32 ret; 254 u32 ret;
258 struct ehca_cq *cq; 255 struct ehca_cq *cq;
259 struct ehca_qp *qp; 256 struct ehca_qp *qp;
260 struct ehca_pd *pd;
261 struct ib_uobject *uobject; 257 struct ib_uobject *uobject;
262 258
263 switch (q_type) { 259 switch (q_type) {
@@ -270,13 +266,6 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
270 if (!cq) 266 if (!cq)
271 return -EINVAL; 267 return -EINVAL;
272 268
273 if (cq->ownpid != cur_pid) {
274 ehca_err(cq->ib_cq.device,
275 "Invalid caller pid=%x ownpid=%x",
276 cur_pid, cq->ownpid);
277 return -ENOMEM;
278 }
279
280 if (!cq->ib_cq.uobject || cq->ib_cq.uobject->context != context) 269 if (!cq->ib_cq.uobject || cq->ib_cq.uobject->context != context)
281 return -EINVAL; 270 return -EINVAL;
282 271
@@ -298,14 +287,6 @@ int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
298 if (!qp) 287 if (!qp)
299 return -EINVAL; 288 return -EINVAL;
300 289
301 pd = container_of(qp->ib_qp.pd, struct ehca_pd, ib_pd);
302 if (pd->ownpid != cur_pid) {
303 ehca_err(qp->ib_qp.device,
304 "Invalid caller pid=%x ownpid=%x",
305 cur_pid, pd->ownpid);
306 return -ENOMEM;
307 }
308
309 uobject = IS_SRQ(qp) ? qp->ib_srq.uobject : qp->ib_qp.uobject; 290 uobject = IS_SRQ(qp) ? qp->ib_srq.uobject : qp->ib_qp.uobject;
310 if (!uobject || uobject->context != context) 291 if (!uobject || uobject->context != context)
311 return -EINVAL; 292 return -EINVAL;