From: Varsha Rao <rvarsha016@gmail.com>
To: mawilcox@microsoft.com
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: [PATCH v3 3/3] kernel: pid: Add blank line after declarations.
Date: Tue, 28 Mar 2017 10:29:49 +0530 [thread overview]
Message-ID: <58d9edc8.467f630a.24d1f.ce41@mx.google.com> (raw)
In-Reply-To: <cover.1490676249.git.rvarsha016@gmail.com>
Add a blank line after declarations, to fix the checkpatch issue.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
Changes in v3:
- No changes.
Changes in v2:
- No changes.
kernel/pid.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/pid.c b/kernel/pid.c
index bb0a1c0..fe16058 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -148,6 +148,7 @@ static void set_last_pid(struct pid_namespace *pid_ns, int base, int pid)
{
int prev;
int last_write = base;
+
do {
prev = last_write;
last_write = cmpxchg(&pid_ns->last_pid, prev, pid);
@@ -269,6 +270,7 @@ EXPORT_SYMBOL_GPL(put_pid);
static void delayed_put_pid(struct rcu_head *rhp)
{
struct pid *pid = container_of(rhp, struct pid, rcu);
+
put_pid(pid);
}
@@ -409,6 +411,7 @@ EXPORT_SYMBOL_GPL(find_vpid);
void attach_pid(struct task_struct *task, enum pid_type type)
{
struct pid_link *link = &task->pids[type];
+
hlist_add_head_rcu(&link->node, &link->pid->tasks[type]);
}
@@ -455,8 +458,10 @@ void transfer_pid(struct task_struct *old, struct task_struct *new,
struct task_struct *pid_task(struct pid *pid, enum pid_type type)
{
struct task_struct *result = NULL;
+
if (pid) {
struct hlist_node *first;
+
first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]),
lockdep_tasklist_lock_is_held());
if (first)
@@ -484,6 +489,7 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
{
struct pid *pid;
+
rcu_read_lock();
if (type != PIDTYPE_PID)
task = task->group_leader;
@@ -496,6 +502,7 @@ EXPORT_SYMBOL_GPL(get_task_pid);
struct task_struct *get_pid_task(struct pid *pid, enum pid_type type)
{
struct task_struct *result;
+
rcu_read_lock();
result = pid_task(pid, type);
if (result)
--
2.9.3
prev parent reply other threads:[~2017-03-28 4:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1490676249.git.rvarsha016@gmail.com>
2017-03-28 4:54 ` [PATCH v3 1/3] kernel: pid: Update documentation Varsha Rao
2017-03-28 4:58 ` [PATCH v3 2/3] kernel: pid: Change function return value to bool Varsha Rao
2017-03-28 4:59 ` Varsha Rao [this message]
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=58d9edc8.467f630a.24d1f.ce41@mx.google.com \
--to=rvarsha016@gmail.com \
--cc=mawilcox@microsoft.com \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.