diff options
Diffstat (limited to 'fs/filesystems.c')
-rw-r--r-- | fs/filesystems.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/fs/filesystems.c b/fs/filesystems.c index f37f87262837..d0e20ced62dd 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c | |||
@@ -8,6 +8,8 @@ | |||
8 | 8 | ||
9 | #include <linux/syscalls.h> | 9 | #include <linux/syscalls.h> |
10 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
11 | #include <linux/proc_fs.h> | ||
12 | #include <linux/seq_file.h> | ||
11 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
12 | #include <linux/kmod.h> | 14 | #include <linux/kmod.h> |
13 | #include <linux/init.h> | 15 | #include <linux/init.h> |
@@ -214,6 +216,43 @@ int get_filesystem_list(char * buf) | |||
214 | return len; | 216 | return len; |
215 | } | 217 | } |
216 | 218 | ||
219 | #ifdef CONFIG_PROC_FS | ||
220 | static int filesystems_proc_show(struct seq_file *m, void *v) | ||
221 | { | ||
222 | struct file_system_type * tmp; | ||
223 | |||
224 | read_lock(&file_systems_lock); | ||
225 | tmp = file_systems; | ||
226 | while (tmp) { | ||
227 | seq_printf(m, "%s\t%s\n", | ||
228 | (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev", | ||
229 | tmp->name); | ||
230 | tmp = tmp->next; | ||
231 | } | ||
232 | read_unlock(&file_systems_lock); | ||
233 | return 0; | ||
234 | } | ||
235 | |||
236 | static int filesystems_proc_open(struct inode *inode, struct file *file) | ||
237 | { | ||
238 | return single_open(file, filesystems_proc_show, NULL); | ||
239 | } | ||
240 | |||
241 | static const struct file_operations filesystems_proc_fops = { | ||
242 | .open = filesystems_proc_open, | ||
243 | .read = seq_read, | ||
244 | .llseek = seq_lseek, | ||
245 | .release = single_release, | ||
246 | }; | ||
247 | |||
248 | static int __init proc_filesystems_init(void) | ||
249 | { | ||
250 | proc_create("filesystems", 0, NULL, &filesystems_proc_fops); | ||
251 | return 0; | ||
252 | } | ||
253 | module_init(proc_filesystems_init); | ||
254 | #endif | ||
255 | |||
217 | struct file_system_type *get_fs_type(const char *name) | 256 | struct file_system_type *get_fs_type(const char *name) |
218 | { | 257 | { |
219 | struct file_system_type *fs; | 258 | struct file_system_type *fs; |