summaryrefslogtreecommitdiff
path: root/fs/proc/proc_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r--fs/proc/proc_misc.c44
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;