diff options
Diffstat (limited to 'fs/jfs/jfs_logmgr.c')
-rw-r--r-- | fs/jfs/jfs_logmgr.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 325a9679b95a..cd2ec2988b59 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #include <linux/freezer.h> | 69 | #include <linux/freezer.h> |
70 | #include <linux/delay.h> | 70 | #include <linux/delay.h> |
71 | #include <linux/mutex.h> | 71 | #include <linux/mutex.h> |
72 | #include <linux/seq_file.h> | ||
72 | #include "jfs_incore.h" | 73 | #include "jfs_incore.h" |
73 | #include "jfs_filsys.h" | 74 | #include "jfs_filsys.h" |
74 | #include "jfs_metapage.h" | 75 | #include "jfs_metapage.h" |
@@ -2503,13 +2504,9 @@ exit: | |||
2503 | } | 2504 | } |
2504 | 2505 | ||
2505 | #ifdef CONFIG_JFS_STATISTICS | 2506 | #ifdef CONFIG_JFS_STATISTICS |
2506 | int jfs_lmstats_read(char *buffer, char **start, off_t offset, int length, | 2507 | static int jfs_lmstats_proc_show(struct seq_file *m, void *v) |
2507 | int *eof, void *data) | ||
2508 | { | 2508 | { |
2509 | int len = 0; | 2509 | seq_printf(m, |
2510 | off_t begin; | ||
2511 | |||
2512 | len += sprintf(buffer, | ||
2513 | "JFS Logmgr stats\n" | 2510 | "JFS Logmgr stats\n" |
2514 | "================\n" | 2511 | "================\n" |
2515 | "commits = %d\n" | 2512 | "commits = %d\n" |
@@ -2522,19 +2519,19 @@ int jfs_lmstats_read(char *buffer, char **start, off_t offset, int length, | |||
2522 | lmStat.pagedone, | 2519 | lmStat.pagedone, |
2523 | lmStat.full_page, | 2520 | lmStat.full_page, |
2524 | lmStat.partial_page); | 2521 | lmStat.partial_page); |
2522 | return 0; | ||
2523 | } | ||
2525 | 2524 | ||
2526 | begin = offset; | 2525 | static int jfs_lmstats_proc_open(struct inode *inode, struct file *file) |
2527 | *start = buffer + begin; | 2526 | { |
2528 | len -= begin; | 2527 | return single_open(file, jfs_lmstats_proc_show, NULL); |
2529 | |||
2530 | if (len > length) | ||
2531 | len = length; | ||
2532 | else | ||
2533 | *eof = 1; | ||
2534 | |||
2535 | if (len < 0) | ||
2536 | len = 0; | ||
2537 | |||
2538 | return len; | ||
2539 | } | 2528 | } |
2529 | |||
2530 | const struct file_operations jfs_lmstats_proc_fops = { | ||
2531 | .owner = THIS_MODULE, | ||
2532 | .open = jfs_lmstats_proc_open, | ||
2533 | .read = seq_read, | ||
2534 | .llseek = seq_lseek, | ||
2535 | .release = single_release, | ||
2536 | }; | ||
2540 | #endif /* CONFIG_JFS_STATISTICS */ | 2537 | #endif /* CONFIG_JFS_STATISTICS */ |