diff options
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r-- | fs/proc/proc_misc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index bee251cb87c8..c9d6d5f400ad 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -66,7 +66,6 @@ extern int get_stram_list(char *); | |||
66 | extern int get_filesystem_list(char *); | 66 | extern int get_filesystem_list(char *); |
67 | extern int get_exec_domain_list(char *); | 67 | extern int get_exec_domain_list(char *); |
68 | extern int get_dma_list(char *); | 68 | extern int get_dma_list(char *); |
69 | extern int get_locks_status (char *, char **, off_t, int); | ||
70 | 69 | ||
71 | static int proc_calc_metrics(char *page, char **start, off_t off, | 70 | static int proc_calc_metrics(char *page, char **start, off_t off, |
72 | int count, int *eof, int len) | 71 | int count, int *eof, int len) |
@@ -617,16 +616,18 @@ static int cmdline_read_proc(char *page, char **start, off_t off, | |||
617 | return proc_calc_metrics(page, start, off, count, eof, len); | 616 | return proc_calc_metrics(page, start, off, count, eof, len); |
618 | } | 617 | } |
619 | 618 | ||
620 | static int locks_read_proc(char *page, char **start, off_t off, | 619 | static int locks_open(struct inode *inode, struct file *filp) |
621 | int count, int *eof, void *data) | ||
622 | { | 620 | { |
623 | int len = get_locks_status(page, start, off, count); | 621 | return seq_open(filp, &locks_seq_operations); |
624 | |||
625 | if (len < count) | ||
626 | *eof = 1; | ||
627 | return len; | ||
628 | } | 622 | } |
629 | 623 | ||
624 | static const struct file_operations proc_locks_operations = { | ||
625 | .open = locks_open, | ||
626 | .read = seq_read, | ||
627 | .llseek = seq_lseek, | ||
628 | .release = seq_release, | ||
629 | }; | ||
630 | |||
630 | static int execdomains_read_proc(char *page, char **start, off_t off, | 631 | static int execdomains_read_proc(char *page, char **start, off_t off, |
631 | int count, int *eof, void *data) | 632 | int count, int *eof, void *data) |
632 | { | 633 | { |
@@ -684,7 +685,6 @@ void __init proc_misc_init(void) | |||
684 | #endif | 685 | #endif |
685 | {"filesystems", filesystems_read_proc}, | 686 | {"filesystems", filesystems_read_proc}, |
686 | {"cmdline", cmdline_read_proc}, | 687 | {"cmdline", cmdline_read_proc}, |
687 | {"locks", locks_read_proc}, | ||
688 | {"execdomains", execdomains_read_proc}, | 688 | {"execdomains", execdomains_read_proc}, |
689 | {NULL,} | 689 | {NULL,} |
690 | }; | 690 | }; |
@@ -702,6 +702,7 @@ void __init proc_misc_init(void) | |||
702 | entry->proc_fops = &proc_kmsg_operations; | 702 | entry->proc_fops = &proc_kmsg_operations; |
703 | } | 703 | } |
704 | #endif | 704 | #endif |
705 | create_seq_entry("locks", 0, &proc_locks_operations); | ||
705 | create_seq_entry("devices", 0, &proc_devinfo_operations); | 706 | create_seq_entry("devices", 0, &proc_devinfo_operations); |
706 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); | 707 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); |
707 | #ifdef CONFIG_BLOCK | 708 | #ifdef CONFIG_BLOCK |