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 b872a01ad3af..0071939c0095 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) |
| @@ -624,16 +623,18 @@ static int cmdline_read_proc(char *page, char **start, off_t off, | |||
| 624 | return proc_calc_metrics(page, start, off, count, eof, len); | 623 | return proc_calc_metrics(page, start, off, count, eof, len); |
| 625 | } | 624 | } |
| 626 | 625 | ||
| 627 | static int locks_read_proc(char *page, char **start, off_t off, | 626 | static int locks_open(struct inode *inode, struct file *filp) |
| 628 | int count, int *eof, void *data) | ||
| 629 | { | 627 | { |
| 630 | int len = get_locks_status(page, start, off, count); | 628 | return seq_open(filp, &locks_seq_operations); |
| 631 | |||
| 632 | if (len < count) | ||
| 633 | *eof = 1; | ||
| 634 | return len; | ||
| 635 | } | 629 | } |
| 636 | 630 | ||
| 631 | static const struct file_operations proc_locks_operations = { | ||
| 632 | .open = locks_open, | ||
| 633 | .read = seq_read, | ||
| 634 | .llseek = seq_lseek, | ||
| 635 | .release = seq_release, | ||
| 636 | }; | ||
| 637 | |||
| 637 | static int execdomains_read_proc(char *page, char **start, off_t off, | 638 | static int execdomains_read_proc(char *page, char **start, off_t off, |
| 638 | int count, int *eof, void *data) | 639 | int count, int *eof, void *data) |
| 639 | { | 640 | { |
| @@ -691,7 +692,6 @@ void __init proc_misc_init(void) | |||
| 691 | #endif | 692 | #endif |
| 692 | {"filesystems", filesystems_read_proc}, | 693 | {"filesystems", filesystems_read_proc}, |
| 693 | {"cmdline", cmdline_read_proc}, | 694 | {"cmdline", cmdline_read_proc}, |
| 694 | {"locks", locks_read_proc}, | ||
| 695 | {"execdomains", execdomains_read_proc}, | 695 | {"execdomains", execdomains_read_proc}, |
| 696 | {NULL,} | 696 | {NULL,} |
| 697 | }; | 697 | }; |
| @@ -709,6 +709,7 @@ void __init proc_misc_init(void) | |||
| 709 | entry->proc_fops = &proc_kmsg_operations; | 709 | entry->proc_fops = &proc_kmsg_operations; |
| 710 | } | 710 | } |
| 711 | #endif | 711 | #endif |
| 712 | create_seq_entry("locks", 0, &proc_locks_operations); | ||
| 712 | create_seq_entry("devices", 0, &proc_devinfo_operations); | 713 | create_seq_entry("devices", 0, &proc_devinfo_operations); |
| 713 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); | 714 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); |
| 714 | #ifdef CONFIG_BLOCK | 715 | #ifdef CONFIG_BLOCK |
