public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: Roland Dreier <rolandd@cisco.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: general@lists.openfabrics.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hoang-Nam Nguyen <hnguyen@de.ibm.com>,
	Christoph Raisch <raisch@de.ibm.com>
Subject: [PATCH 3/3] Infiniband: don't use task_struct.tgid in make_cm_node()
Date: Mon, 17 Mar 2008 15:50:55 +0300	[thread overview]
Message-ID: <47DE692F.5010600@openvz.org> (raw)

The task_struct->tgid field is about to become deprecated, due to
pid namespaces make tasks have many pids, not one. There is one
place using it left to fix in infiniband - the make_cm_node().

This function uses the task tgid just to generate a session id,
so it's perfectly safe to use appropriate wrapper - task_tgid_nr().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

 drivers/infiniband/hw/nes/nes_cm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 39adb26..7a06156 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1077,7 +1077,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
 	/* get a unique session ID , add thread_id to an upcounter to handle race */
 	atomic_inc(&cm_core->node_cnt);
 	atomic_inc(&cm_core->session_id);
-	cm_node->session_id = (u32)(atomic_read(&cm_core->session_id) + current->tgid);
+	cm_node->session_id = (u32)(atomic_read(&cm_core->session_id) +
+			task_tgid_nr(current));
 	cm_node->conn_type = cm_info->conn_type;
 	cm_node->apbvt_set = 0;
 	cm_node->accept_pend = 0;
@@ -1606,7 +1607,8 @@ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core,
 	atomic_inc(&cm_core->node_cnt);
 	atomic_inc(&cm_core->session_id);
 
-	listener->session_id = (u32)(atomic_read(&cm_core->session_id) + current->tgid);
+	listener->session_id = (u32)(atomic_read(&cm_core->session_id) +
+			task_tgid_nr(current));
 	listener->conn_type = cm_info->conn_type;
 	listener->backlog = cm_info->backlog;
 	listener->listener_state = NES_CM_LISTENER_ACTIVE_STATE;



             reply	other threads:[~2008-03-17 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 12:50 Pavel Emelyanov [this message]
     [not found] <adad4pqjugp.fsf@cisco.com>
2008-03-20 21:51 ` [PATCH 3/3] Infiniband: don't use task_struct.tgid in make_cm_node() Glenn Streiff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47DE692F.5010600@openvz.org \
    --to=xemul@openvz.org \
    --cc=general@lists.openfabrics.org \
    --cc=hal.rosenstock@gmail.com \
    --cc=hnguyen@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raisch@de.ibm.com \
    --cc=rolandd@cisco.com \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox