Commit f52111b1546943545e67573c4dde1c7613ca33d3

Authored by Al Viro
1 parent f26a398891

[PATCH] take init_files to fs/file.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 25 changed files with 14 additions and 45 deletions Side-by-side Diff

arch/alpha/kernel/init_task.c
... ... @@ -9,7 +9,6 @@
9 9  
10 10  
11 11 static struct fs_struct init_fs = INIT_FS;
12   -static struct files_struct init_files = INIT_FILES;
13 12 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
14 13 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
15 14 struct mm_struct init_mm = INIT_MM(init_mm);
arch/arm/kernel/init_task.c
... ... @@ -13,7 +13,6 @@
13 13 #include <asm/pgtable.h>
14 14  
15 15 static struct fs_struct init_fs = INIT_FS;
16   -static struct files_struct init_files = INIT_FILES;
17 16 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
18 17 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
19 18 struct mm_struct init_mm = INIT_MM(init_mm);
arch/avr32/kernel/init_task.c
... ... @@ -14,7 +14,6 @@
14 14 #include <asm/pgtable.h>
15 15  
16 16 static struct fs_struct init_fs = INIT_FS;
17   -static struct files_struct init_files = INIT_FILES;
18 17 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
19 18 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
20 19 struct mm_struct init_mm = INIT_MM(init_mm);
arch/blackfin/kernel/init_task.c
... ... @@ -34,7 +34,6 @@
34 34 #include <linux/fs.h>
35 35  
36 36 static struct fs_struct init_fs = INIT_FS;
37   -static struct files_struct init_files = INIT_FILES;
38 37 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
39 38 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
40 39  
arch/cris/kernel/process.c
... ... @@ -38,7 +38,6 @@
38 38 */
39 39  
40 40 static struct fs_struct init_fs = INIT_FS;
41   -static struct files_struct init_files = INIT_FILES;
42 41 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
43 42 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
44 43 struct mm_struct init_mm = INIT_MM(init_mm);
arch/frv/kernel/init_task.c
... ... @@ -11,7 +11,6 @@
11 11  
12 12  
13 13 static struct fs_struct init_fs = INIT_FS;
14   -static struct files_struct init_files = INIT_FILES;
15 14 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
16 15 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
17 16 struct mm_struct init_mm = INIT_MM(init_mm);
arch/h8300/kernel/init_task.c
... ... @@ -13,7 +13,6 @@
13 13 #include <asm/pgtable.h>
14 14  
15 15 static struct fs_struct init_fs = INIT_FS;
16   -static struct files_struct init_files = INIT_FILES;
17 16 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
18 17 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
19 18 struct mm_struct init_mm = INIT_MM(init_mm);
arch/ia64/kernel/init_task.c
... ... @@ -18,7 +18,6 @@
18 18 #include <asm/pgtable.h>
19 19  
20 20 static struct fs_struct init_fs = INIT_FS;
21   -static struct files_struct init_files = INIT_FILES;
22 21 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
23 22 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
24 23 struct mm_struct init_mm = INIT_MM(init_mm);
arch/m32r/kernel/init_task.c
... ... @@ -12,7 +12,6 @@
12 12 #include <asm/pgtable.h>
13 13  
14 14 static struct fs_struct init_fs = INIT_FS;
15   -static struct files_struct init_files = INIT_FILES;
16 15 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
17 16 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
18 17 struct mm_struct init_mm = INIT_MM(init_mm);
arch/m68k/kernel/process.c
... ... @@ -41,7 +41,6 @@
41 41 * setup.
42 42 */
43 43 static struct fs_struct init_fs = INIT_FS;
44   -static struct files_struct init_files = INIT_FILES;
45 44 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
46 45 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
47 46 struct mm_struct init_mm = INIT_MM(init_mm);
arch/m68knommu/kernel/init_task.c
... ... @@ -13,7 +13,6 @@
13 13 #include <asm/pgtable.h>
14 14  
15 15 static struct fs_struct init_fs = INIT_FS;
16   -static struct files_struct init_files = INIT_FILES;
17 16 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
18 17 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
19 18 struct mm_struct init_mm = INIT_MM(init_mm);
arch/mips/kernel/init_task.c
... ... @@ -10,7 +10,6 @@
10 10 #include <asm/pgtable.h>
11 11  
12 12 static struct fs_struct init_fs = INIT_FS;
13   -static struct files_struct init_files = INIT_FILES;
14 13 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
15 14 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
16 15 struct mm_struct init_mm = INIT_MM(init_mm);
arch/mn10300/kernel/init_task.c
... ... @@ -19,7 +19,6 @@
19 19 #include <asm/pgtable.h>
20 20  
21 21 static struct fs_struct init_fs = INIT_FS;
22   -static struct files_struct init_files = INIT_FILES;
23 22 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
24 23 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
25 24 struct mm_struct init_mm = INIT_MM(init_mm);
arch/parisc/kernel/init_task.c
... ... @@ -35,7 +35,6 @@
35 35 #include <asm/pgalloc.h>
36 36  
37 37 static struct fs_struct init_fs = INIT_FS;
38   -static struct files_struct init_files = INIT_FILES;
39 38 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
40 39 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
41 40 struct mm_struct init_mm = INIT_MM(init_mm);
arch/powerpc/kernel/init_task.c
... ... @@ -8,7 +8,6 @@
8 8 #include <asm/uaccess.h>
9 9  
10 10 static struct fs_struct init_fs = INIT_FS;
11   -static struct files_struct init_files = INIT_FILES;
12 11 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
13 12 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
14 13 struct mm_struct init_mm = INIT_MM(init_mm);
arch/s390/kernel/init_task.c
... ... @@ -17,7 +17,6 @@
17 17 #include <asm/pgtable.h>
18 18  
19 19 static struct fs_struct init_fs = INIT_FS;
20   -static struct files_struct init_files = INIT_FILES;
21 20 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
22 21 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
23 22 struct mm_struct init_mm = INIT_MM(init_mm);
arch/sh/kernel/init_task.c
... ... @@ -8,7 +8,6 @@
8 8 #include <asm/pgtable.h>
9 9  
10 10 static struct fs_struct init_fs = INIT_FS;
11   -static struct files_struct init_files = INIT_FILES;
12 11 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
13 12 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
14 13 struct pt_regs fake_swapper_regs;
arch/sparc/kernel/init_task.c
... ... @@ -9,7 +9,6 @@
9 9 #include <asm/uaccess.h>
10 10  
11 11 static struct fs_struct init_fs = INIT_FS;
12   -static struct files_struct init_files = INIT_FILES;
13 12 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
14 13 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
15 14 struct mm_struct init_mm = INIT_MM(init_mm);
arch/sparc64/kernel/init_task.c
... ... @@ -10,7 +10,6 @@
10 10 #include <asm/processor.h>
11 11  
12 12 static struct fs_struct init_fs = INIT_FS;
13   -static struct files_struct init_files = INIT_FILES;
14 13 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
15 14 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
16 15 struct mm_struct init_mm = INIT_MM(init_mm);
arch/um/kernel/init_task.c
... ... @@ -12,7 +12,6 @@
12 12  
13 13 static struct fs_struct init_fs = INIT_FS;
14 14 struct mm_struct init_mm = INIT_MM(init_mm);
15   -static struct files_struct init_files = INIT_FILES;
16 15 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
17 16 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
18 17 EXPORT_SYMBOL(init_mm);
arch/v850/kernel/init_task.c
... ... @@ -21,7 +21,6 @@
21 21 #include <asm/pgtable.h>
22 22  
23 23 static struct fs_struct init_fs = INIT_FS;
24   -static struct files_struct init_files = INIT_FILES;
25 24 static struct signal_struct init_signals = INIT_SIGNALS (init_signals);
26 25 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
27 26 struct mm_struct init_mm = INIT_MM (init_mm);
arch/x86/kernel/init_task.c
... ... @@ -11,7 +11,6 @@
11 11 #include <asm/desc.h>
12 12  
13 13 static struct fs_struct init_fs = INIT_FS;
14   -static struct files_struct init_files = INIT_FILES;
15 14 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
16 15 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
17 16 struct mm_struct init_mm = INIT_MM(init_mm);
arch/xtensa/kernel/init_task.c
... ... @@ -22,7 +22,6 @@
22 22 #include <asm/uaccess.h>
23 23  
24 24 static struct fs_struct init_fs = INIT_FS;
25   -static struct files_struct init_files = INIT_FILES;
26 25 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
27 26 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
28 27 struct mm_struct init_mm = INIT_MM(init_mm);
... ... @@ -275,4 +275,17 @@
275 275 for_each_possible_cpu(i)
276 276 fdtable_defer_list_init(i);
277 277 }
  278 +
  279 +struct files_struct init_files = {
  280 + .count = ATOMIC_INIT(1),
  281 + .fdt = &init_files.fdtab,
  282 + .fdtab = {
  283 + .max_fds = NR_OPEN_DEFAULT,
  284 + .fd = &init_files.fd_array[0],
  285 + .close_on_exec = (fd_set *)&init_files.close_on_exec_init,
  286 + .open_fds = (fd_set *)&init_files.open_fds_init,
  287 + .rcu = RCU_HEAD_INIT,
  288 + },
  289 + .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock),
  290 +};
include/linux/init_task.h
1 1 #ifndef _LINUX__INIT_TASK_H
2 2 #define _LINUX__INIT_TASK_H
3 3  
4   -#include <linux/fdtable.h>
5 4 #include <linux/rcupdate.h>
6 5 #include <linux/irqflags.h>
7 6 #include <linux/utsname.h>
... ... @@ -12,27 +11,7 @@
12 11 #include <linux/securebits.h>
13 12 #include <net/net_namespace.h>
14 13  
15   -#define INIT_FDTABLE \
16   -{ \
17   - .max_fds = NR_OPEN_DEFAULT, \
18   - .fd = &init_files.fd_array[0], \
19   - .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
20   - .open_fds = (fd_set *)&init_files.open_fds_init, \
21   - .rcu = RCU_HEAD_INIT, \
22   - .next = NULL, \
23   -}
24   -
25   -#define INIT_FILES \
26   -{ \
27   - .count = ATOMIC_INIT(1), \
28   - .fdt = &init_files.fdtab, \
29   - .fdtab = INIT_FDTABLE, \
30   - .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), \
31   - .next_fd = 0, \
32   - .close_on_exec_init = { { 0, } }, \
33   - .open_fds_init = { { 0, } }, \
34   - .fd_array = { NULL, } \
35   -}
  14 +extern struct files_struct init_files;
36 15  
37 16 #define INIT_KIOCTX(name, which_mm) \
38 17 { \