diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-10-09 18:30:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:26:04 -0400 |
commit | 067b722faf98adbe1e94581f39c06a7c82b58676 (patch) | |
tree | 9e3613e3759e926e99486a433fe0152667954162 | |
parent | 27fb10edcacbb70ac4e97fe1506006d732421210 (diff) |
acct: eliminate compile warning
If ACCT_VERSION is not defined to 3, below warning appears:
CC kernel/acct.o
kernel/acct.c: In function `do_acct_process':
kernel/acct.c:475:24: warning: unused variable `ns' [-Wunused-variable]
[akpm@linux-foundation.org: retain the local for code size improvements
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/acct.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index b4c667d22e79..33738ef972f3 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -472,7 +472,6 @@ static void do_acct_process(struct bsd_acct_struct *acct) | |||
472 | acct_t ac; | 472 | acct_t ac; |
473 | unsigned long flim; | 473 | unsigned long flim; |
474 | const struct cred *orig_cred; | 474 | const struct cred *orig_cred; |
475 | struct pid_namespace *ns = acct->ns; | ||
476 | struct file *file = acct->file; | 475 | struct file *file = acct->file; |
477 | 476 | ||
478 | /* | 477 | /* |
@@ -500,10 +499,15 @@ static void do_acct_process(struct bsd_acct_struct *acct) | |||
500 | ac.ac_gid16 = ac.ac_gid; | 499 | ac.ac_gid16 = ac.ac_gid; |
501 | #endif | 500 | #endif |
502 | #if ACCT_VERSION == 3 | 501 | #if ACCT_VERSION == 3 |
503 | ac.ac_pid = task_tgid_nr_ns(current, ns); | 502 | { |
504 | rcu_read_lock(); | 503 | struct pid_namespace *ns = acct->ns; |
505 | ac.ac_ppid = task_tgid_nr_ns(rcu_dereference(current->real_parent), ns); | 504 | |
506 | rcu_read_unlock(); | 505 | ac.ac_pid = task_tgid_nr_ns(current, ns); |
506 | rcu_read_lock(); | ||
507 | ac.ac_ppid = task_tgid_nr_ns(rcu_dereference(current->real_parent), | ||
508 | ns); | ||
509 | rcu_read_unlock(); | ||
510 | } | ||
507 | #endif | 511 | #endif |
508 | /* | 512 | /* |
509 | * Get freeze protection. If the fs is frozen, just skip the write | 513 | * Get freeze protection. If the fs is frozen, just skip the write |