LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 03/16] fs: use get_personality()
Date: Sat, 23 Feb 2008 16:14:06 +0800	[thread overview]
Message-ID: <1203754488669-git-send-email-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <1203754478165-git-send-email-xiyou.wangcong@gmail.com>

Use get_personality() macro instead of explicit reference.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>

---
 fs/binfmt_elf.c |    6 +++---
 fs/compat.c     |    6 +++---
 fs/select.c     |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 41a958a..1b5803f 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -516,7 +516,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
 	unsigned int random_variable = 0;
 
 	if ((current->flags & PF_RANDOMIZE) &&
-		!(current->personality & ADDR_NO_RANDOMIZE)) {
+		!(get_personality() & ADDR_NO_RANDOMIZE)) {
 		random_variable = get_random_int() & STACK_RND_MASK;
 		random_variable <<= PAGE_SHIFT;
 	}
@@ -744,7 +744,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 	if (elf_read_implies_exec(loc->elf_ex, executable_stack))
 		current->personality |= READ_IMPLIES_EXEC;
 
-	if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+	if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space)
 		current->flags |= PF_RANDOMIZE;
 	arch_pick_mmap_layout(current->mm);
 
@@ -969,7 +969,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 			arch_randomize_brk(current->mm);
 #endif
 
-	if (current->personality & MMAP_PAGE_ZERO) {
+	if (get_personality() & MMAP_PAGE_ZERO) {
 		/* Why this, you ask???  Well SVr4 maps page 0 as read-only,
 		   and some applications "depend" upon this behavior.
 		   Since we do not have the power to recompile these, we
diff --git a/fs/compat.c b/fs/compat.c
index 2ce4456..eefe23b 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1610,7 +1610,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
 	if (tvp) {
 		struct compat_timeval rtv;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
@@ -1685,7 +1685,7 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
 	if (tsp) {
 		struct compat_timespec rts;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 
 		rts.tv_sec = timeout / HZ;
@@ -1800,7 +1800,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
 	if (tsp && timeout >= 0) {
 		struct compat_timespec rts;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 		/* Yes, we know it's actually an s64, but it's also positive. */
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
diff --git a/fs/select.c b/fs/select.c
index 5633fe9..6041e24 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -401,7 +401,7 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
 	if (tvp) {
 		struct timeval rtv;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
@@ -467,7 +467,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
 	if (tsp) {
 		struct timespec rts;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 						1000;
@@ -814,7 +814,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
 	if (tsp && timeout >= 0) {
 		struct timespec rts;
 
-		if (current->personality & STICKY_TIMEOUTS)
+		if (get_personality() & STICKY_TIMEOUTS)
 			goto sticky;
 		/* Yes, we know it's actually an s64, but it's also positive. */
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
-- 
1.5.3.8


  reply	other threads:[~2008-02-23  8:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23  8:14 [PATCH 00/16] (Resend) Use get_personality() WANG Cong
2008-02-23  8:14 ` [PATCH 01/16] Make the macro get_personality function-like WANG Cong
2008-02-23  8:14   ` [PATCH 02/16] mm: use get_personality() WANG Cong
2008-02-23  8:14     ` WANG Cong [this message]
2008-02-23  8:14       ` [PATCH 04/16] powerpc: " WANG Cong
2008-02-23  8:14         ` [PATCH 05/16] parisc: " WANG Cong
2008-02-23  8:14           ` [PATCH 06/16] sparc(64): " WANG Cong
2008-02-23  8:14             ` [PATCH 07/16] arm: " WANG Cong
2008-02-23  8:14               ` [PATCH 08/16] x86: " WANG Cong
2008-02-23  8:14                 ` [PATCH 09/16] um: " WANG Cong
2008-02-23  8:14                   ` [PATCH 10/16] s390: " WANG Cong
2008-02-23  8:14                     ` [PATCH 11/16] mips: " WANG Cong
2008-02-23  8:14                       ` [PATCH 12/16] ia64: " WANG Cong
2008-02-23  8:14                         ` [PATCH 13/16] alpha: " WANG Cong
2008-02-23  8:14                           ` [PATCH 14/16] frv: " WANG Cong
2008-02-23  8:14                             ` [PATCH 15/16] mn10300: " WANG Cong
2008-02-23  8:14                               ` [PATCH 16/16] kernel: " WANG Cong
2008-02-23 12:03                             ` [PATCH 15/16] mn10300: " David Howells
2008-02-23 12:02                           ` [PATCH 14/16] frv: " David Howells
2008-02-23 10:08                 ` [PATCH 08/16] x86: " Ingo Molnar
2008-02-23 10:19                   ` Ingo Molnar
2008-02-23 10:39                     ` WANG Cong
2008-02-23  9:06           ` Accessor macros vs reference counting Matthew Wilcox
2008-02-23 12:46             ` David Newall
2008-02-23 14:56               ` Matthew Wilcox
2008-02-23  8:58   ` [PATCH 01/16] Make the macro get_personality function-like Bryan Wu
2008-02-23  8:51 ` [PATCH 00/16] (Resend) Use get_personality() Alexey Dobriyan
2008-02-23  8:59   ` WANG Cong
2008-02-23  9:27     ` Alexey Dobriyan
2008-02-23  9:56       ` WANG Cong
2008-02-23 18:37       ` Christoph Hellwig
2008-02-23 19:16         ` Andrew Morton
2008-02-24  4:03           ` WANG Cong
2008-02-25  2:14           ` [PATCH] Remove the macro get_personality WANG Cong
2008-02-23 12:02 ` [PATCH 01/16] Make the macro get_personality function-like David Howells

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=1203754488669-git-send-email-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --subject='Re: [PATCH 03/16] fs: use get_personality()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).