diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:33:15 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:33:15 -0800 |
| commit | d40d1af9f0aebf7e108f1dfb66ac5af671bc9719 (patch) | |
| tree | 7a2518e82986a8eb5b4eb76553df04d8ba6e4642 /fs/proc/proc_misc.c | |
| parent | a8a2069f432c5597bdf9c83ab3045b9ef32ab5e3 (diff) | |
v2.4.14.2 -> v2.4.14.3
- Alan Cox: more driver merging
- Al Viro: make ext2 group allocation more readable
Diffstat (limited to 'fs/proc/proc_misc.c')
| -rw-r--r-- | fs/proc/proc_misc.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index e1601dba7ca8..ee030ece19d2 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -35,6 +35,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/smp_lock.h> +#include <linux/seq_file.h> #include <asm/uaccess.h> #include <asm/pgtable.h> @@ -57,12 +58,10 @@ extern int get_malloc(char * buffer); #endif #ifdef CONFIG_MODULES extern int get_module_list(char *); -extern int get_ksyms_list(char *, char **, off_t, int); #endif extern int get_device_list(char *); extern int get_partition_list(char *, char **, off_t, int); extern int get_filesystem_list(char *); -extern int get_filesystem_info(char *); extern int get_exec_domain_list(char *); extern int get_irq_list(char *); extern int get_dma_list(char *); @@ -251,13 +250,17 @@ static int modules_read_proc(char *page, char **start, off_t off, return proc_calc_metrics(page, start, off, count, eof, len); } -static int ksyms_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) +extern struct seq_operations ksyms_op; +static int ksyms_open(struct inode *inode, struct file *file) { - int len = get_ksyms_list(page, start, off, count); - if (len < count) *eof = 1; - return len; + return seq_open(file, &ksyms_op); } +static struct file_operations proc_ksyms_operations = { + open: ksyms_open, + read: seq_read, + llseek: seq_lseek, + release: seq_release, +}; #endif static int kstat_read_proc(char *page, char **start, off_t off, @@ -414,13 +417,6 @@ static int locks_read_proc(char *page, char **start, off_t off, return len; } -static int mounts_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = get_filesystem_info(page); - return proc_calc_metrics(page, start, off, count, eof, len); -} - static int execdomains_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -505,6 +501,18 @@ static struct file_operations proc_profile_operations = { write: write_profile, }; +extern struct seq_operations mounts_op; +static int mounts_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &mounts_op); +} +static struct file_operations proc_mounts_operations = { + open: mounts_open, + read: seq_read, + llseek: seq_lseek, + release: seq_release, +}; + struct proc_dir_entry *proc_root_kcore; void __init proc_misc_init(void) @@ -530,7 +538,6 @@ void __init proc_misc_init(void) #endif #ifdef CONFIG_MODULES {"modules", modules_read_proc}, - {"ksyms", ksyms_read_proc}, #endif {"stat", kstat_read_proc}, {"devices", devices_read_proc}, @@ -546,7 +553,6 @@ void __init proc_misc_init(void) {"rtc", ds1286_read_proc}, #endif {"locks", locks_read_proc}, - {"mounts", mounts_read_proc}, {"swaps", swaps_read_proc}, {"iomem", memory_read_proc}, {"execdomains", execdomains_read_proc}, @@ -559,6 +565,12 @@ void __init proc_misc_init(void) entry = create_proc_entry("kmsg", S_IRUSR, &proc_root); if (entry) entry->proc_fops = &proc_kmsg_operations; + entry = create_proc_entry("mounts", 0, NULL); + if (entry) + entry->proc_fops = &proc_mounts_operations; + entry = create_proc_entry("ksyms", 0, NULL); + if (entry) + entry->proc_fops = &proc_ksyms_operations; proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL); if (proc_root_kcore) { proc_root_kcore->proc_fops = &proc_kcore_operations; |
