[PATCH] Use task_pid_nr() in ip_vs_sync.c

Previous thread: speeding up swapoff by Daniel Drake on Wednesday, August 29, 2007 - 9:29 am. (15 messages)

Next thread: [PATCH] Switch nfs/callback.c to using struct pid, not pid_t by Pavel Emelyanov on Wednesday, August 29, 2007 - 9:36 am. (4 messages)
To: Andrew Morton <akpm@...>
Cc: Oleg Nesterov <oleg@...>, Sukadev Bhattiprolu <sukadev@...>, Linux Containers <containers@...>, Linux Kernel Mailing List <linux-kernel@...>, Linux Netdev List <netdev@...>
Date: Wednesday, August 29, 2007 - 9:30 am

The sync_master_pid and sync_backup_pid are set in set_sync_pid()
and are used later for set/not-set checks and in printk. So it
is safe to use the global pid value in this case.

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

---

diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 959c08d..d0798a5 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -794,7 +794,7 @@ static int sync_thread(void *startup)

add_wait_queue(&sync_wait, &wait);

- set_sync_pid(state, current->pid);
+ set_sync_pid(state, task_pid_nr(current));
complete(tinfo->startup);

/*
-

To: Pavel Emelyanov <xemul@...>
Cc: Andrew Morton <akpm@...>, Oleg Nesterov <oleg@...>, Linux Containers <containers@...>, Linux Kernel Mailing List <linux-kernel@...>, Linux Netdev List <netdev@...>
Date: Wednesday, August 29, 2007 - 5:50 pm

Pavel Emelianov [xemul@openvz.org] wrote:
| The sync_master_pid and sync_backup_pid are set in set_sync_pid()
| and are used later for set/not-set checks and in printk. So it
| is safe to use the global pid value in this case.
|
| Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Acked-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
|
| ---
|
| diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
| index 959c08d..d0798a5 100644
| --- a/net/ipv4/ipvs/ip_vs_sync.c
| +++ b/net/ipv4/ipvs/ip_vs_sync.c
| @@ -794,7 +794,7 @@ static int sync_thread(void *startup)
|
| add_wait_queue(&sync_wait, &wait);
|
| - set_sync_pid(state, current->pid);
| + set_sync_pid(state, task_pid_nr(current));
| complete(tinfo->startup);
|
| /*
-

Previous thread: speeding up swapoff by Daniel Drake on Wednesday, August 29, 2007 - 9:29 am. (15 messages)

Next thread: [PATCH] Switch nfs/callback.c to using struct pid, not pid_t by Pavel Emelyanov on Wednesday, August 29, 2007 - 9:36 am. (4 messages)