Import 2.1.118
[davej-history.git] / fs / filesystems.c
blobdcd1cf1d495d3981f22b37f6fabc61b68f9c5039
1 /*
2 * linux/fs/filesystems.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * table of configured filesystems
7 */
9 #include <linux/config.h>
10 #include <linux/fs.h>
12 #include <linux/minix_fs.h>
13 #include <linux/ext2_fs.h>
14 #include <linux/msdos_fs.h>
15 #include <linux/umsdos_fs.h>
16 #include <linux/proc_fs.h>
17 #include <linux/nfs_fs.h>
18 #include <linux/iso_fs.h>
19 #include <linux/sysv_fs.h>
20 #include <linux/hpfs_fs.h>
21 #include <linux/smb_fs.h>
22 #include <linux/ncp_fs.h>
23 #include <linux/affs_fs.h>
24 #include <linux/ufs_fs.h>
25 #include <linux/romfs_fs.h>
26 #include <linux/auto_fs.h>
27 #include <linux/ntfs_fs.h>
28 #include <linux/hfs_fs.h>
29 #include <linux/devpts_fs.h>
30 #include <linux/major.h>
31 #include <linux/smp.h>
32 #include <linux/smp_lock.h>
33 #ifdef CONFIG_KMOD
34 #include <linux/kmod.h>
35 #endif
36 #include <linux/lockd/bind.h>
37 #include <linux/lockd/xdr.h>
38 #include <linux/init.h>
39 #include <linux/nls.h>
41 #ifdef CONFIG_CODA_FS
42 extern int init_coda(void);
43 #endif
45 #ifdef CONFIG_DEVPTS_FS
46 extern int init_devpts_fs(void);
47 #endif
49 extern void device_setup(void);
50 extern void binfmt_setup(void);
51 extern void free_initmem(void);
53 static void __init do_sys_setup(void)
55 device_setup();
57 binfmt_setup();
59 #ifdef CONFIG_EXT2_FS
60 init_ext2_fs();
61 #endif
63 #ifdef CONFIG_MINIX_FS
64 init_minix_fs();
65 #endif
67 #ifdef CONFIG_ROMFS_FS
68 init_romfs_fs();
69 #endif
71 #ifdef CONFIG_UMSDOS_FS
72 init_umsdos_fs();
73 #endif
75 #ifdef CONFIG_FAT_FS
76 init_fat_fs();
77 #endif
79 #ifdef CONFIG_MSDOS_FS
80 init_msdos_fs();
81 #endif
83 #ifdef CONFIG_VFAT_FS
84 init_vfat_fs();
85 #endif
87 #ifdef CONFIG_PROC_FS
88 init_proc_fs();
89 #endif
91 #ifdef CONFIG_LOCKD
92 nlmxdr_init();
93 #endif
95 #ifdef CONFIG_NFS_FS
96 init_nfs_fs();
97 #endif
99 #ifdef CONFIG_CODA_FS
100 init_coda();
101 #endif
103 #ifdef CONFIG_SMB_FS
104 init_smb_fs();
105 #endif
107 #ifdef CONFIG_NCP_FS
108 init_ncp_fs();
109 #endif
111 #ifdef CONFIG_ISO9660_FS
112 init_iso9660_fs();
113 #endif
115 #ifdef CONFIG_SYSV_FS
116 init_sysv_fs();
117 #endif
119 #ifdef CONFIG_HPFS_FS
120 init_hpfs_fs();
121 #endif
123 #ifdef CONFIG_NTFS_FS
124 init_ntfs_fs();
125 #endif
127 #ifdef CONFIG_HFS_FS
128 init_hfs_fs();
129 #endif
131 #ifdef CONFIG_AFFS_FS
132 init_affs_fs();
133 #endif
135 #ifdef CONFIG_UFS_FS
136 init_ufs_fs();
137 #endif
139 #ifdef CONFIG_AUTOFS_FS
140 init_autofs_fs();
141 #endif
143 #ifdef CONFIG_ADFS_FS
144 init_adfs_fs();
145 #endif
147 #ifdef CONFIG_DEVPTS_FS
148 init_devpts_fs();
149 #endif
151 #ifdef CONFIG_NLS
152 init_nls();
153 #endif
155 mount_root();
158 int initmem_freed = 0;
160 /* This may be used only twice, enforced by 'static int callable' */
161 asmlinkage int sys_setup(int magic)
163 static int callable = 1;
164 int err = -1;
166 lock_kernel();
167 if (magic) {
168 if (!initmem_freed) {
169 initmem_freed = 1;
170 free_initmem ();
171 err = 0;
173 } else if (callable) {
174 callable = 0;
175 do_sys_setup();
176 err = 0;
178 unlock_kernel();
179 return err;
182 #ifndef CONFIG_NFSD
183 #ifdef CONFIG_NFSD_MODULE
184 int (*do_nfsservctl)(int, void *, void *) = NULL;
185 #endif
187 asmlinkage sys_nfsservctl(int cmd, void *argp, void *resp)
189 #ifndef CONFIG_NFSD_MODULE
190 return -ENOSYS;
191 #else
192 int ret = -ENOSYS;
194 lock_kernel();
195 if (do_nfsservctl) {
196 ret = do_nfsservctl(cmd, argp, resp);
197 goto out;
199 #ifdef CONFIG_KMOD
200 if (request_module ("nfsd") == 0) {
201 if (do_nfsservctl)
202 ret = do_nfsservctl(cmd, argp, resp);
204 #endif /* CONFIG_KMOD */
205 out:
206 unlock_kernel();
207 return ret;
208 #endif /* CONFIG_NFSD_MODULE */
210 #endif /* CONFIG_NFSD */