diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-04 06:08:37 -0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-23 06:27:09 -0400 |
commit | 6827400713fa22312ca3b4f47b0e64871c88040c (patch) | |
tree | a42a02ce68671443576482c5e38bd42735383579 | |
parent | 4c150f6c30f5129bbce5c41568a285b1f7ca8d8b (diff) |
proc: move /proc/filesystems to fs/filesystems.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-rw-r--r-- | fs/filesystems.c | 39 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 8 |
2 files changed, 39 insertions, 8 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; |
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index ec37d3aeaf19..9fa20f157cf3 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -472,13 +472,6 @@ static const struct file_operations proc_interrupts_operations = { | |||
472 | .release = seq_release, | 472 | .release = seq_release, |
473 | }; | 473 | }; |
474 | 474 | ||
475 | static int filesystems_read_proc(char *page, char **start, off_t off, | ||
476 | int count, int *eof, void *data) | ||
477 | { | ||
478 | int len = get_filesystem_list(page); | ||
479 | return proc_calc_metrics(page, start, off, count, eof, len); | ||
480 | } | ||
481 | |||
482 | static int cmdline_read_proc(char *page, char **start, off_t off, | 475 | static int cmdline_read_proc(char *page, char **start, off_t off, |
483 | int count, int *eof, void *data) | 476 | int count, int *eof, void *data) |
484 | { | 477 | { |
@@ -648,7 +641,6 @@ void __init proc_misc_init(void) | |||
648 | char *name; | 641 | char *name; |
649 | int (*read_proc)(char*,char**,off_t,int,int*,void*); | 642 | int (*read_proc)(char*,char**,off_t,int,int*,void*); |
650 | } *p, simple_ones[] = { | 643 | } *p, simple_ones[] = { |
651 | {"filesystems", filesystems_read_proc}, | ||
652 | {"cmdline", cmdline_read_proc}, | 644 | {"cmdline", cmdline_read_proc}, |
653 | {"execdomains", execdomains_read_proc}, | 645 | {"execdomains", execdomains_read_proc}, |
654 | {NULL,} | 646 | {NULL,} |