15 #include <linux/module.h>
16 #include <linux/slab.h>
17 #include <asm/uaccess.h>
38 __module_get(fs->
owner);
43 module_put(fs->
owner);
49 for (p=&file_systems; *
p; p=&(*p)->
next)
50 if (
strlen((*p)->name) == len &&
51 strncmp((*p)->name, name, len) == 0)
124 static int fs_index(
const char __user * __name)
137 for (tmp=file_systems, index=0 ;
tmp ; tmp=tmp->
next, index++) {
148 static int fs_name(
unsigned int index,
char __user *
buf)
154 for (tmp = file_systems;
tmp; tmp = tmp->
next, index--)
155 if (index <= 0 && try_module_get(tmp->
owner))
168 static int fs_maxindex(
void)
174 for (tmp = file_systems, index = 0 ;
tmp ; tmp = tmp->
next, index++)
189 retval = fs_index((
const char __user *)
arg1);
197 retval = fs_maxindex();
211 len +=
sprintf(buf+len,
"%s\t%s\n",
220 #ifdef CONFIG_PROC_FS
221 static int filesystems_proc_show(
struct seq_file *
m,
void *
v)
243 .
open = filesystems_proc_open,
249 static int __init proc_filesystems_init(
void)
251 proc_create(
"filesystems", 0,
NULL, &filesystems_proc_fops);
262 fs = *(find_filesystem(name, len));
263 if (fs && !try_module_get(fs->
owner))
272 const char *dot =
strchr(name,
'.');
273 int len = dot ? dot - name :
strlen(name);
275 fs = __get_fs_type(name, len);
276 if (!fs && (request_module(
"%.*s", len, name) == 0))
277 fs = __get_fs_type(name, len);