diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-10-24 12:48:46 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-10-24 12:48:46 +0200 |
| commit | 8c82a17e9c924c0e9f13e75e4c2f6bca19a4b516 (patch) | |
| tree | d535f46a917e14e90deccb29ad00aac016ad18dd /fs/filesystems.c | |
| parent | 4ce72a2c063a7fa8e42a9435440ae3364115a58d (diff) | |
| parent | 57f8f7b60db6f1ed2c6918ab9230c4623a9dbe37 (diff) | |
Merge commit 'v2.6.28-rc1' into sched/urgent
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 f37f8726283..d0e20ced62d 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -8,6 +8,8 @@ #include <linux/syscalls.h> #include <linux/fs.h> +#include <linux/proc_fs.h> +#include <linux/seq_file.h> #include <linux/slab.h> #include <linux/kmod.h> #include <linux/init.h> @@ -214,6 +216,43 @@ int get_filesystem_list(char * buf) return len; } +#ifdef CONFIG_PROC_FS +static int filesystems_proc_show(struct seq_file *m, void *v) +{ + struct file_system_type * tmp; + + read_lock(&file_systems_lock); + tmp = file_systems; + while (tmp) { + seq_printf(m, "%s\t%s\n", + (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev", + tmp->name); + tmp = tmp->next; + } + read_unlock(&file_systems_lock); + return 0; +} + +static int filesystems_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, filesystems_proc_show, NULL); +} + +static const struct file_operations filesystems_proc_fops = { + .open = filesystems_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static int __init proc_filesystems_init(void) +{ + proc_create("filesystems", 0, NULL, &filesystems_proc_fops); + return 0; +} +module_init(proc_filesystems_init); +#endif + struct file_system_type *get_fs_type(const char *name) { struct file_system_type *fs; |
