public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
@ 2008-12-10 23:37 Steven Rostedt
  2008-12-10 23:43 ` Al Viro
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2008-12-10 23:37 UTC (permalink / raw)
  To: LKML, linux-arch; +Cc: Andrew Morton, Ingo Molnar, Thomas Gleixner


The following patch is in:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

    branch: cleanups


Steven Rostedt (1):
      make INIT_FS use the __RW_LOCK_UNLOCKED initialization

----
 arch/alpha/kernel/init_task.c     |    2 +-
 arch/arm/kernel/init_task.c       |    2 +-
 arch/avr32/kernel/init_task.c     |    2 +-
 arch/blackfin/kernel/init_task.c  |    2 +-
 arch/cris/kernel/process.c        |    2 +-
 arch/frv/kernel/init_task.c       |    2 +-
 arch/h8300/kernel/init_task.c     |    2 +-
 arch/ia64/kernel/init_task.c      |    2 +-
 arch/m32r/kernel/init_task.c      |    2 +-
 arch/m68k/kernel/process.c        |    2 +-
 arch/m68knommu/kernel/init_task.c |    2 +-
 arch/mips/kernel/init_task.c      |    2 +-
 arch/mn10300/kernel/init_task.c   |    2 +-
 arch/parisc/kernel/init_task.c    |    2 +-
 arch/powerpc/kernel/init_task.c   |    2 +-
 arch/s390/kernel/init_task.c      |    2 +-
 arch/sh/kernel/init_task.c        |    2 +-
 arch/sparc/kernel/init_task.c     |    2 +-
 arch/sparc64/kernel/init_task.c   |    2 +-
 arch/um/kernel/init_task.c        |    2 +-
 arch/x86/kernel/init_task.c       |    2 +-
 arch/xtensa/kernel/init_task.c    |    2 +-
 include/linux/fs_struct.h         |    8 ++++----
 23 files changed, 26 insertions(+), 26 deletions(-)
---------------------------
commit a01548072bd37397057019f8eec5b8a12f364763
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Wed Dec 10 16:55:00 2008 -0500

    make INIT_FS use the __RW_LOCK_UNLOCKED initialization
    
    Impact: clean up
    
    The INIT_FS macro still uses the deprecated RW_LOCK_UNLOCKED macro.
    This patch updates it to use the __RW_LOCK_UNLOCKED(lock) macro.
    
    Signed-off-by: Steven Rostedt <srostedt@redhat.com>

diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index 1f76218..e2470eb 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -8,7 +8,7 @@
 #include <asm/uaccess.h>
 
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index 0bbf806..cd2cd8f 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -12,7 +12,7 @@
 
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 4405846..f5fe900 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -13,7 +13,7 @@
 
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/blackfin/kernel/init_task.c b/arch/blackfin/kernel/init_task.c
index 6bdba7b..6cd2bc9 100644
--- a/arch/blackfin/kernel/init_task.c
+++ b/arch/blackfin/kernel/init_task.c
@@ -33,7 +33,7 @@
 #include <linux/mqueue.h>
 #include <linux/fs.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 5933656..78002b9 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -37,7 +37,7 @@
  * setup.
  */
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/frv/kernel/init_task.c b/arch/frv/kernel/init_task.c
index e219881..749091c 100644
--- a/arch/frv/kernel/init_task.c
+++ b/arch/frv/kernel/init_task.c
@@ -10,7 +10,7 @@
 #include <asm/pgtable.h>
 
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index 93a4899..67c5a74 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -12,7 +12,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 9d7e1c6..d793c55 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -17,7 +17,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 0d658db..c4cc7a3 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -11,7 +11,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 3042c2b..480b4cf 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -40,7 +40,7 @@
  * alignment requirements and potentially different initial
  * setup.
  */
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index 344c01a..4669391 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -12,7 +12,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index d72487a..9e31228 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -9,7 +9,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index af16f6e..2cc5046 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -18,7 +18,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index f5941c0..c83e11d 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -34,7 +34,7 @@
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/powerpc/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 4c85b8d..c96b1c2 100644
--- a/arch/powerpc/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
@@ -7,7 +7,7 @@
 #include <linux/mqueue.h>
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index e807168..c99c903 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -16,7 +16,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index b151a25..c5b1c3e 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -7,7 +7,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct pt_regs fake_swapper_regs;
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index 8e64ebc..d39d22e 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -8,7 +8,7 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c
index d2b3123..8995483 100644
--- a/arch/sparc64/kernel/init_task.c
+++ b/arch/sparc64/kernel/init_task.c
@@ -9,7 +9,7 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 910eda8..cb33b7d 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -10,7 +10,7 @@
 #include "linux/mqueue.h"
 #include "asm/uaccess.h"
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 struct mm_struct init_mm = INIT_MM(init_mm);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index a4f93b4..479cc0f 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -10,7 +10,7 @@
 #include <asm/pgtable.h>
 #include <asm/desc.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index 3df469d..2841b55 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -21,7 +21,7 @@
 
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
+static struct fs_struct init_fs = INIT_FS(init_fs);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 9e5a06e..407cd69 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -10,10 +10,10 @@ struct fs_struct {
 	struct path root, pwd;
 };
 
-#define INIT_FS {				\
-	.count		= ATOMIC_INIT(1),	\
-	.lock		= RW_LOCK_UNLOCKED,	\
-	.umask		= 0022, \
+#define INIT_FS(name) {						\
+	.count		= ATOMIC_INIT(1),			\
+	.lock		= __RW_LOCK_UNLOCKED((name).lock),	\
+	.umask		= 0022,					\
 }
 
 extern struct kmem_cache *fs_cachep;

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-10 23:37 [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Steven Rostedt
@ 2008-12-10 23:43 ` Al Viro
  2008-12-11  0:01   ` Steven Rostedt
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Al Viro @ 2008-12-10 23:43 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, linux-arch, Andrew Morton, Ingo Molnar, Thomas Gleixner

On Wed, Dec 10, 2008 at 06:37:28PM -0500, Steven Rostedt wrote:
> 
> The following patch is in:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> 
>     branch: cleanups

Would be better to take init_fs to something in fs/ or kernel/ and kill
the duplicates, along with INIT_FS macro itself...

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-10 23:43 ` Al Viro
@ 2008-12-11  0:01   ` Steven Rostedt
  2008-12-11  0:23   ` [PATCH] remove duplicate init_fs Steven Rostedt
  2008-12-11  1:07   ` [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Mike Frysinger
  2 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2008-12-11  0:01 UTC (permalink / raw)
  To: Al Viro; +Cc: LKML, linux-arch, Andrew Morton, Ingo Molnar, Thomas Gleixner


On Wed, 10 Dec 2008, Al Viro wrote:

> On Wed, Dec 10, 2008 at 06:37:28PM -0500, Steven Rostedt wrote:
> > 
> > The following patch is in:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> > 
> >     branch: cleanups
> 
> Would be better to take init_fs to something in fs/ or kernel/ and kill
> the duplicates, along with INIT_FS macro itself...

What about putting it in init/main.c?

It would then also need to become a global variable (it is currently 
static). But I do not think that should be an issue.

-- Steve

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] remove duplicate init_fs
  2008-12-10 23:43 ` Al Viro
  2008-12-11  0:01   ` Steven Rostedt
@ 2008-12-11  0:23   ` Steven Rostedt
  2008-12-11  1:07   ` [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Mike Frysinger
  2 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2008-12-11  0:23 UTC (permalink / raw)
  To: Al Viro; +Cc: LKML, linux-arch, Andrew Morton, Ingo Molnar, Thomas Gleixner


The following patch is in:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

    branch: cleanups


Steven Rostedt (1):
      remove duplicate init_fs

----
 arch/alpha/kernel/init_task.c     |    1 -
 arch/arm/kernel/init_task.c       |    1 -
 arch/avr32/kernel/init_task.c     |    1 -
 arch/blackfin/kernel/init_task.c  |    1 -
 arch/cris/kernel/process.c        |    1 -
 arch/frv/kernel/init_task.c       |    1 -
 arch/h8300/kernel/init_task.c     |    1 -
 arch/ia64/kernel/init_task.c      |    1 -
 arch/m32r/kernel/init_task.c      |    1 -
 arch/m68k/kernel/process.c        |    1 -
 arch/m68knommu/kernel/init_task.c |    1 -
 arch/mips/kernel/init_task.c      |    1 -
 arch/mn10300/kernel/init_task.c   |    1 -
 arch/parisc/kernel/init_task.c    |    1 -
 arch/powerpc/kernel/init_task.c   |    1 -
 arch/s390/kernel/init_task.c      |    1 -
 arch/sh/kernel/init_task.c        |    1 -
 arch/sparc/kernel/init_task.c     |    1 -
 arch/sparc64/kernel/init_task.c   |    1 -
 arch/um/kernel/init_task.c        |    1 -
 arch/x86/kernel/init_task.c       |    1 -
 arch/xtensa/kernel/init_task.c    |    1 -
 include/linux/fs_struct.h         |    7 +------
 init/main.c                       |    6 ++++++
 24 files changed, 7 insertions(+), 28 deletions(-)
---------------------------
commit a0f599b0f8479b7e4d7a7fc22150154a4bc26227
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Wed Dec 10 19:18:06 2008 -0500

    remove duplicate init_fs
    
    Impact: clean up
    
    This patch removes the funny INIT_FS macro and creates a single
    init_fs variable in init/main.c for all archs to use.
    
    Signed-off-by: Steven Rostedt <srostedt@redhat.com>

diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index 1f76218..c2938e5 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -8,7 +8,6 @@
 #include <asm/uaccess.h>
 
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index 0bbf806..e859af3 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -12,7 +12,6 @@
 
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 4405846..993d56e 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -13,7 +13,6 @@
 
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/blackfin/kernel/init_task.c b/arch/blackfin/kernel/init_task.c
index 6bdba7b..2c228c0 100644
--- a/arch/blackfin/kernel/init_task.c
+++ b/arch/blackfin/kernel/init_task.c
@@ -33,7 +33,6 @@
 #include <linux/mqueue.h>
 #include <linux/fs.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 5933656..60816e8 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -37,7 +37,6 @@
  * setup.
  */
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/frv/kernel/init_task.c b/arch/frv/kernel/init_task.c
index e219881..29429a8 100644
--- a/arch/frv/kernel/init_task.c
+++ b/arch/frv/kernel/init_task.c
@@ -10,7 +10,6 @@
 #include <asm/pgtable.h>
 
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index 93a4899..cb5dc55 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -12,7 +12,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 9d7e1c6..5b0e830 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -17,7 +17,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 0d658db..016885c 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -11,7 +11,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 3042c2b..632ce01 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -40,7 +40,6 @@
  * alignment requirements and potentially different initial
  * setup.
  */
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index 344c01a..fe282de 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -12,7 +12,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index d72487a..149cd91 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -9,7 +9,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index af16f6e..5ac3566 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -18,7 +18,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index f5941c0..1e25a45 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -34,7 +34,6 @@
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/powerpc/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 4c85b8d..688b329 100644
--- a/arch/powerpc/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
@@ -7,7 +7,6 @@
 #include <linux/mqueue.h>
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index e807168..7db95c0 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -16,7 +16,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index b151a25..80c35ff 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -7,7 +7,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct pt_regs fake_swapper_regs;
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index 8e64ebc..94fcae3 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -8,7 +8,6 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c
index d2b3123..84fb09e 100644
--- a/arch/sparc64/kernel/init_task.c
+++ b/arch/sparc64/kernel/init_task.c
@@ -9,7 +9,6 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 910eda8..806d381 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -10,7 +10,6 @@
 #include "linux/mqueue.h"
 #include "asm/uaccess.h"
 
-static struct fs_struct init_fs = INIT_FS;
 struct mm_struct init_mm = INIT_MM(init_mm);
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index a4f93b4..42dcd6e 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -10,7 +10,6 @@
 #include <asm/pgtable.h>
 #include <asm/desc.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index 3df469d..e07f5c9 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -21,7 +21,6 @@
 
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 9e5a06e..ab79e82 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -10,12 +10,7 @@ struct fs_struct {
 	struct path root, pwd;
 };
 
-#define INIT_FS {				\
-	.count		= ATOMIC_INIT(1),	\
-	.lock		= RW_LOCK_UNLOCKED,	\
-	.umask		= 0022, \
-}
-
+extern struct fs_struct init_fs;
 extern struct kmem_cache *fs_cachep;
 
 extern void exit_fs(struct task_struct *);
diff --git a/init/main.c b/init/main.c
index 7e117a2..0801e74 100644
--- a/init/main.c
+++ b/init/main.c
@@ -108,6 +108,12 @@ extern void tc_init(void);
 enum system_states system_state;
 EXPORT_SYMBOL(system_state);
 
+struct fs_struct init_fs = {
+	.count		= ATOMIC_INIT(1),
+	.lock		= __RW_LOCK_UNLOCKED(init_fs.lock),
+	.umask		= 0022,
+};
+
 /*
  * Boot command-line arguments
  */

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-10 23:43 ` Al Viro
  2008-12-11  0:01   ` Steven Rostedt
  2008-12-11  0:23   ` [PATCH] remove duplicate init_fs Steven Rostedt
@ 2008-12-11  1:07   ` Mike Frysinger
  2008-12-11  1:11     ` Steven Rostedt
  2 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2008-12-11  1:07 UTC (permalink / raw)
  To: Al Viro
  Cc: Steven Rostedt, LKML, linux-arch, Andrew Morton, Ingo Molnar,
	Thomas Gleixner

On Wed, Dec 10, 2008 at 18:43, Al Viro wrote:
> On Wed, Dec 10, 2008 at 06:37:28PM -0500, Steven Rostedt wrote:
>>
>> The following patch is in:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
>>
>>     branch: cleanups
>
> Would be better to take init_fs to something in fs/ or kernel/ and kill
> the duplicates, along with INIT_FS macro itself...

how about the next level: unify init_task.c.  a quick check shows that
like 90% of the stuff in there is the same for everyone ...
-mike

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-11  1:07   ` [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Mike Frysinger
@ 2008-12-11  1:11     ` Steven Rostedt
  2008-12-11  2:34       ` Al Viro
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2008-12-11  1:11 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Al Viro, LKML, linux-arch, Andrew Morton, Ingo Molnar,
	Thomas Gleixner


On Wed, 10 Dec 2008, Mike Frysinger wrote:

> On Wed, Dec 10, 2008 at 18:43, Al Viro wrote:
> > On Wed, Dec 10, 2008 at 06:37:28PM -0500, Steven Rostedt wrote:
> >>
> >> The following patch is in:
> >>
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> >>
> >>     branch: cleanups
> >
> > Would be better to take init_fs to something in fs/ or kernel/ and kill
> > the duplicates, along with INIT_FS macro itself...
> 
> how about the next level: unify init_task.c.  a quick check shows that
> like 90% of the stuff in there is the same for everyone ...
> -mike

I could probably do it for x86 and PPC, but beyond that, each arch 
maintainer will have to do it separately. That's a change that would need 
testing.

These changes are trivial (something I need to get RT working).

-- Steve

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-11  1:11     ` Steven Rostedt
@ 2008-12-11  2:34       ` Al Viro
  2008-12-11 21:22         ` Sam Ravnborg
  0 siblings, 1 reply; 9+ messages in thread
From: Al Viro @ 2008-12-11  2:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Mike Frysinger, LKML, linux-arch, Andrew Morton, Ingo Molnar,
	Thomas Gleixner

On Wed, Dec 10, 2008 at 08:11:02PM -0500, Steven Rostedt wrote:
> 
> On Wed, 10 Dec 2008, Mike Frysinger wrote:
> 
> > On Wed, Dec 10, 2008 at 18:43, Al Viro wrote:
> > > On Wed, Dec 10, 2008 at 06:37:28PM -0500, Steven Rostedt wrote:
> > >>
> > >> The following patch is in:
> > >>
> > >>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> > >>
> > >>     branch: cleanups
> > >
> > > Would be better to take init_fs to something in fs/ or kernel/ and kill
> > > the duplicates, along with INIT_FS macro itself...
> > 
> > how about the next level: unify init_task.c.  a quick check shows that
> > like 90% of the stuff in there is the same for everyone ...
> > -mike
> 
> I could probably do it for x86 and PPC, but beyond that, each arch 
> maintainer will have to do it separately. That's a change that would need 
> testing.
> 
> These changes are trivial (something I need to get RT working).

Guys, let's not take it to init/main.c, please.  That file is basically
a trashcan and I'd rather take that stuff to more or less relevant places
in kernel/* and fs/*.  FWIW, I've done that with init_files (fs/file.c)
some time ago.  For init_fs...  Hell knows.  Might make sense to take
that to separate file, actually (kernel/exit.c and kernel/fork.c bits
related to fs_struct).

BTW, why does sparc64 export put_fs_struct?  And is there any good reason
for doing copy_fs_struct() in nfsd instead of just teaching kthread_create()
how to create threads without sharing fs_struct (or descriptors, while we
are at it)?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-11  2:34       ` Al Viro
@ 2008-12-11 21:22         ` Sam Ravnborg
  2008-12-12  4:28           ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Sam Ravnborg @ 2008-12-11 21:22 UTC (permalink / raw)
  To: Al Viro
  Cc: Steven Rostedt, Mike Frysinger, LKML, linux-arch, Andrew Morton,
	Ingo Molnar, Thomas Gleixner

> 
> Guys, let's not take it to init/main.c, please.  That file is basically
> a trashcan and I'd rather take that stuff to more or less relevant places
> in kernel/* and fs/*.  FWIW, I've done that with init_files (fs/file.c)
> some time ago.  For init_fs...  Hell knows.  Might make sense to take
> that to separate file, actually (kernel/exit.c and kernel/fork.c bits
> related to fs_struct).
> 
> BTW, why does sparc64 export put_fs_struct?
I have sent a patch to davem now to get it removed.

	Sam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  2008-12-11 21:22         ` Sam Ravnborg
@ 2008-12-12  4:28           ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2008-12-12  4:28 UTC (permalink / raw)
  To: sam; +Cc: viro, rostedt, vapier.adi, linux-kernel, linux-arch, akpm, mingo,
	tglx

From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 11 Dec 2008 22:22:28 +0100

> > 
> > Guys, let's not take it to init/main.c, please.  That file is basically
> > a trashcan and I'd rather take that stuff to more or less relevant places
> > in kernel/* and fs/*.  FWIW, I've done that with init_files (fs/file.c)
> > some time ago.  For init_fs...  Hell knows.  Might make sense to take
> > that to separate file, actually (kernel/exit.c and kernel/fork.c bits
> > related to fs_struct).
> > 
> > BTW, why does sparc64 export put_fs_struct?
> I have sent a patch to davem now to get it removed.

It was used by the sunos and solaris syscall compat layers, which were
removed recently.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-12-12  4:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 23:37 [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Steven Rostedt
2008-12-10 23:43 ` Al Viro
2008-12-11  0:01   ` Steven Rostedt
2008-12-11  0:23   ` [PATCH] remove duplicate init_fs Steven Rostedt
2008-12-11  1:07   ` [PATCH] make INIT_FS use the __RW_LOCK_UNLOCKED initialization Mike Frysinger
2008-12-11  1:11     ` Steven Rostedt
2008-12-11  2:34       ` Al Viro
2008-12-11 21:22         ` Sam Ravnborg
2008-12-12  4:28           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox