mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] don't hide thread_group_leader() from grep
Date: Tue, 09 Nov 2004 19:50:38 +0300	[thread overview]
Message-ID: <4190F55E.DF508D9F@tv-sign.ru> (raw)

Trivial. replace open-coded thread_group_leader() calls.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.10-rc1/fs/binfmt_elf.c~	2004-11-08 19:43:28.000000000 +0300
+++ 2.6.10-rc1/fs/binfmt_elf.c	2004-11-09 21:32:09.331095272 +0300
@@ -1181,7 +1181,7 @@ static void fill_prstatus(struct elf_prs
 	prstatus->pr_ppid = p->parent->pid;
 	prstatus->pr_pgrp = process_group(p);
 	prstatus->pr_sid = p->signal->session;
-	if (p->pid == p->tgid) {
+	if (thread_group_leader(p)) {
 		/*
 		 * This is the record for the group leader.  Add in the
 		 * cumulative times of previous dead threads.  This total
--- 2.6.10-rc1/fs/exec.c~	2004-11-08 19:43:29.000000000 +0300
+++ 2.6.10-rc1/fs/exec.c	2004-11-09 22:10:56.767271192 +0300
@@ -605,7 +605,7 @@ static inline int de_thread(struct task_
 	 * Account for the thread group leader hanging around:
 	 */
 	count = 2;
-	if (current->pid == current->tgid)
+	if (thread_group_leader(current))
 		count = 1;
 	while (atomic_read(&sig->count) > count) {
 		sig->group_exit_task = current;
@@ -624,7 +624,7 @@ static inline int de_thread(struct task_
 	 * do is to wait for the thread group leader to become inactive,
 	 * and to assume its PID:
 	 */
-	if (current->pid != current->tgid) {
+	if (!thread_group_leader(current)) {
 		struct task_struct *leader = current->group_leader, *parent;
 		struct dentry *proc_dentry1, *proc_dentry2;
 		unsigned long exit_state, ptrace;
@@ -734,7 +734,7 @@ no_thread_group:
 
 	if (!thread_group_empty(current))
 		BUG();
-	if (current->tgid != current->pid)
+	if (!thread_group_leader(current))
 		BUG();
 	return 0;
 }

             reply	other threads:[~2004-11-09 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-09 16:50 Oleg Nesterov [this message]
2004-11-09 17:00 ` Ingo Molnar

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=4190F55E.DF508D9F@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®